I'm showing a lot of channels (128) on 1 chart and the Legend Box covers a big portion of the chart. I'd like the legend to be accessible quickly if I need it. Is there a way to pin it or something like that and show when I hover over that? If not can this be added as a feature request?
LegendBox Customization
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: LegendBox Customization
There's currently no built-in feature for collapsing the legendbox, but here's the code to achieve this functionality:
Code: Select all
m_chart.ViewXY.LegendBox.MouseOverOn += new MouseEventHandler(LegendBox_MouseOverOn);
m_chart.ViewXY.LegendBox.MouseOverOff += new MouseEventHandler(LegendBox_MouseOverOff);
void LegendBox_MouseOverOff(object sender, MouseEventArgs e)
{
m_chart.BeginUpdate();
foreach (SeriesBaseXY series in m_chart.ViewXY.GetAll2DSeries())
series.ShowInLegendBox = false;
m_chart.EndUpdate();
}
void LegendBox_MouseOverOn(object sender, MouseEventArgs e)
{
m_chart.BeginUpdate();
foreach(SeriesBaseXY series in m_chart.ViewXY.GetAll2DSeries())
series.ShowInLegendBox = true;
m_chart.EndUpdate();
}
LightningChart Support Team, PT
- blakeadkins
- Posts: 44
- Joined: Tue Feb 25, 2014 7:49 pm
Re: LegendBox Customization
Is it possible that the LegendBox will eventually be made into a FrameworkElement so that i can be more easily manipulated and customized?
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: LegendBox Customization
FrameworkElement is not unfortunately a suitable approach, LightningChart uses low-level DirectX rendering. Mouse events and appearance settings are different from what FrameworkElement provides.
If LC's legend box doesn't provide suitable functionality for your application, you can of course create a custom UserControl, populating it from series titles, and placing it over the chart.
If LC's legend box doesn't provide suitable functionality for your application, you can of course create a custom UserControl, populating it from series titles, and placing it over the chart.
LightningChart Support Team, PT