Hi,
Is there an example code of how to use chart groups? While easy enough to create from within the chart editor, getting them to display at runtime seems elusive.
nsm
Example code using groups
Example code using groups
To be or not to be. This is not the question. Rather it is a choice.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi nile,
You can use series groups like this:
You can use series groups like this:
Code: Select all
Chart1.SeriesGroups.Add;
Chart1.SeriesGroups.Items[0].Add(point1);
Chart1.SeriesGroups.Clear;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcis,
Thanks for your reply. However, this isn't quite what i had in mind. The interface I'm designing is zero code based, as all data is processed via dbchart from a virtual table. As such, using the charteditor, lets say i've got 3 groups. All, Std, Financial. Let's now add a combo box with these choices. Then ideally, if the user chooses Std, I would like my ChartListBox to display only the charts contained by the Financial group (and in order).
For this i was expecting something like:
ChartListBox->SeriesGroup = Chart->SeriesGroups->Items[0];
But when i do this, my ChartListBox is empty.
Cheers, Nile.
Thanks for your reply. However, this isn't quite what i had in mind. The interface I'm designing is zero code based, as all data is processed via dbchart from a virtual table. As such, using the charteditor, lets say i've got 3 groups. All, Std, Financial. Let's now add a combo box with these choices. Then ideally, if the user chooses Std, I would like my ChartListBox to display only the charts contained by the Financial group (and in order).
For this i was expecting something like:
ChartListBox->SeriesGroup = Chart->SeriesGroups->Items[0];
But when i do this, my ChartListBox is empty.
Cheers, Nile.
To be or not to be. This is not the question. Rather it is a choice.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Nile,
Currently TChartListBox component doesn't support series groups. I added your request to the wish-list. In the meantime, you'll have to add all series in a group to TChartListBox.
Currently TChartListBox component doesn't support series groups. I added your request to the wish-list. In the meantime, you'll have to add all series in a group to TChartListBox.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Ah, okay. Would have thought this to be a natural extension of having groups with the listbox. Meanwhile is there an alternative you can suggest?
If I can cycle through the list of series available in a specific group, then I should be able to turn off the visibility that are not in the all group - or something similar?
Thanks, nile.
If I can cycle through the list of series available in a specific group, then I should be able to turn off the visibility that are not in the all group - or something similar?
Thanks, nile.
To be or not to be. This is not the question. Rather it is a choice.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi nile,
Yes, you can do something like this:
Hope this helps!
Yes, you can do something like this:
Code: Select all
void __fastcall TForm4::FormCreate(TObject *Sender)
{
Chart1->SeriesGroups->Add();
Chart1->SeriesGroups->Items[0]->Add(Series1);
Chart1->SeriesGroups->Items[0]->Add(Series2);
Chart1->SeriesGroups->Add();
Chart1->SeriesGroups->Items[1]->Add(Series3);
Chart1->SeriesGroups->Items[1]->Add(Series4);
for (int i = 0; i < Chart1->SeriesGroups->Items[0]->Series->Count; i++) {
ChartListBox1->AddItem(Chart1->SeriesGroups->Items[0]->Series->Items[i]->Name,
Chart1->SeriesGroups->Items[0]->Series->Items[i]);
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |