Legend Control - ChartListBox missing in WPF
Posted: Thu Mar 25, 2010 10:25 am
Dear Steema,
We have been using the WPF TChart controls for over six months and we are having some trouble configuring the legend to meet our needs.
While investigating the controls and tools in the library I came accross the ChartListBox that seemed to be flexible enough to control the series displayed.
However, it seems that this control is a .NET Form Control that has not been ported to the WPF library. (We need our controls to be WPF compatible because we take advantage of the WPF features such as scaling and routed events, etc ).
In summary what we are doing is adding multiple series(lines) to one chart but the series are grouped into two conceptual sets. (For example, we plot 10 series of group A and 10 series of group B). We would like to show the two separate groups in separate legends and ideally control each series serarately.
We have found several problems when trying to do this using the legend and extra Lengend tool.
1) When using the legend in series mode - both legends always display the same series. It is not configurable per legend.
2) The check boxes on the extra legend do not correctly deselect the series.
3) The GetLegendText event does not pass the legend, that the event relates to, in the event args so the event is not flexible enough.
4) There is a Legend.FirstValue method that enables each legend to select the starting series but there is no equivalent LastValue method.
Would you be able to comment on
1) Why the ChartListBox control is not in the WPF library
2) Any additional thoughts on how to overcome the legend method shortfalls
Here is a simple example if that helps
Kind Regards
Freddie
We have been using the WPF TChart controls for over six months and we are having some trouble configuring the legend to meet our needs.
While investigating the controls and tools in the library I came accross the ChartListBox that seemed to be flexible enough to control the series displayed.
However, it seems that this control is a .NET Form Control that has not been ported to the WPF library. (We need our controls to be WPF compatible because we take advantage of the WPF features such as scaling and routed events, etc ).
In summary what we are doing is adding multiple series(lines) to one chart but the series are grouped into two conceptual sets. (For example, we plot 10 series of group A and 10 series of group B). We would like to show the two separate groups in separate legends and ideally control each series serarately.
We have found several problems when trying to do this using the legend and extra Lengend tool.
1) When using the legend in series mode - both legends always display the same series. It is not configurable per legend.
2) The check boxes on the extra legend do not correctly deselect the series.
3) The GetLegendText event does not pass the legend, that the event relates to, in the event args so the event is not flexible enough.
4) There is a Legend.FirstValue method that enables each legend to select the starting series but there is no equivalent LastValue method.
Would you be able to comment on
1) Why the ChartListBox control is not in the WPF library
2) Any additional thoughts on how to overcome the legend method shortfalls
Here is a simple example if that helps
Code: Select all
Steema.TeeChart.WPF.Styles.Series line1 = new Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
line1.FillSampleValues(10);
Steema.TeeChart.WPF.Styles.Series line2 = new Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
line2.FillSampleValues(10);
Steema.TeeChart.WPF.Styles.Series line3 = new Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
line3.FillSampleValues(10);
Steema.TeeChart.WPF.Styles.Series line4 = new Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
line4.FillSampleValues(10);
tChart1.Chart.Legend.CheckBoxes = true;
tChart1.Chart.Legend.Tag = 0;
ExtraLegend tool = new ExtraLegend(tChart1.Chart);
tool.Legend.LegendStyle = LegendStyles.Series;
tool.Legend.CheckBoxes = true;
Freddie