Legend Control - ChartListBox missing in WPF

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Freddie
Newbie
Newbie
Posts: 13
Joined: Thu Jun 25, 2009 12:00 am

Legend Control - ChartListBox missing in WPF

Post by Freddie » 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

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;
Kind Regards
Freddie

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Legend Control - ChartListBox missing in WPF

Post by Yeray » Mon Mar 29, 2010 2:32 pm

Hi Freddie,

I'm afraid that ChartListBox hasn't been implemented yet for WPF. I've added the request to the wish list to be implemented in future releases (TW16014761).

I've also seen that there is no SeriesGroups LegendStyle that could help to do a workaround so I've added the inclusion of this style to the wish list be implemented in future releases too (TF02014762). With it, one could have some series in the default legend and the other series to the ExtraLegendTool (one series per group).

Right now, the only way I can think you could do it is creating your own Legend. Something similar to what was started here.
Also note that you could probably add checkboxes to this custom legend linked to the series you wish.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply