Chart legend, extending checkbox hitbox to include string

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
cwodarczyk82
Posts: 43
Joined: Mon Oct 19, 2015 2:50 am

Chart legend, extending checkbox hitbox to include string

Post by cwodarczyk82 » Mon Feb 22, 2016 4:08 pm

Hi...

Sorry for all these questions on the legend box lately... we successfully moved from our own WPF 'legend' back to the Arction legend (mainly to get it stored into the image file when using SaveToFile()). One difference I noticed between the two mainly is the WPF control's checkbox could be selected/unselected by also clicking the string Content associated with the checkbox... is there a way to extend that into the Arction legend as well? It's ok if the answer is no, just thought I would ask..


[img]
ClickOnString.PNG
ClickOnString.PNG (35.66 KiB) Viewed 6924 times
[/img]
Thanks
--Chris

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Chart legend, extending checkbox hitbox to include strin

Post by ArctionPasi » Mon Feb 22, 2016 8:11 pm

Hi Chris,

You can do that by setting SeriesTitleMouseClick event handler, and changing the visibility of the series there. Check box status is changed bases on series visibility.

Code: Select all

 
       m_chart.ViewXY.LegendBox.MoveFromSeriesTitle = false;
       m_chart.ViewXY.LegendBox.SeriesTitleMouseClick += LegendBox_SeriesTitleMouseClick;

        void LegendBox_SeriesTitleMouseClick(MouseItemBase series)
        {
            SeriesBaseXY s = (SeriesBaseXY)series;
            s.Visible = !s.Visible;
        }
LightningChart Support Team, PT

cwodarczyk82
Posts: 43
Joined: Mon Oct 19, 2015 2:50 am

Re: Chart legend, extending checkbox hitbox to include strin

Post by cwodarczyk82 » Mon Feb 22, 2016 9:14 pm

Wondeful! I will give this a try and let you know if i run into any additional problems...

Post Reply