Hi There,
Can we add checkboxes to the chart legends? My requirement is to switch on/off the data series by clicking the check boxes.
Regards,
Sourabh Bose
Can we add checkboxes to the legends?
Started by sourabh bose, Jul 28 2011 10:39 AM
1 reply to this topic
#1
Posted 28 July 2011 - 10:39 AM
#2
Posted 29 July 2011 - 05:32 AM
Hi Sourabh,
Shoaib
Visifire doesn't allow adding checkboxes to the chart Legend. Instead you can create custom Legend with checkboxes and place it inside the chart.Can we add checkboxes to the chart legends? My requirement is to switch on/off the data series by clicking the check boxes.
As you are trying to enable or disable DataSeries on click of corresponding legend entry, you can achieve this by attaching mouse event on legend. Inside the event handler you will get DataSeries and DataPoint as event argument which will help you to perform operation on the corresponding DataSeries or DataPoint. Please follow the code below.My requirement is to switch on/off the data series by clicking the check boxes.
void Legend_MouseLeftButtonUp(object sender, LegendMouseButtonEventArgs e)
{
if (e.DataSeries == null)
return;
if (e.DataSeries.Opacity == 0)
e.DataSeries.Opacity = 1;
else
e.DataSeries.Opacity = 0;
}
Regards,Shoaib
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











