Hi,
I’m working on a project where I need to uncheck / check all series checkboxes with a button.
Is there a way to achieve this through scripting?
Thanks!
Hi,
I’m working on a project where I need to uncheck / check all series checkboxes with a button.
Is there a way to achieve this through scripting?
Thanks!
Hi Roldan,
You can accomplish this by toggling the Active property of all the series as below:
Firstly, in your graphic form script make sure you add the following references:
Add the following namespace to the top of your script:
using Steema.TeeChart.Styles;
Expose you chart to the graphic form script by setting the ExposeToScript property of the chart to true.
The following button event handlers shows hows to check/uncheck all series:
// Check all series
private void btnCheckAll_Click(System.Object sender, System.EventArgs e)
{
// iterate through all the series
foreach (Series series in lineChart._chart.Series)
{
series.Active = true; // show/check the series
}
}
// Uncheck all series
private void btnUncheckAll_Click(System.Object sender, System.EventArgs e)
{
// iterate through all the series
foreach (Series series in lineChart._chart.Series)
{
series.Active = false; // hide/uncheck the series
}
}
I have included a sample graphic form to show this:
CheckOrUncheckAllSeriesExample.viz (44.7 KB)
Nicee!
Thank you, Diego!