Jump to content

 

Photo

Can we add checkboxes to the legends?


  • Please log in to reply
1 reply to this topic

#1 sourabh bose

sourabh bose

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts
  • Gender:Male

Posted 28 July 2011 - 10:39 AM

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

#2 shoaib

shoaib

    Advanced Member

  • Members
  • PipPipPip
  • 924 posts
  • Gender:Male
  • Location:Bangalore

Posted 29 July 2011 - 05:32 AM

Hi Sourabh,

Can we add checkboxes to the chart legends? My requirement is to switch on/off the data series by clicking the check boxes.

Visifire doesn't allow adding checkboxes to the chart Legend. Instead you can create custom Legend with checkboxes and place it inside the chart.

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.
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