Page 1 of 1
Visible Series in Chart
Posted: Tue Jan 14, 2014 2:40 am
by JohnCZ
Hi there,
I was wondering if it is possible to hide/visible the series in Chart Object.
I tried it with simple code but still is not working.
Code: Select all
if (Globals.Tags.Visible_Curve1.Value = 1)
{
Chart1.Series["Series"].Visible = true;
}
or
if (Globals.Tags.Visible_Curve1.Value = 1)
{
Chart1.Series["Series"].Enabled = true;
}
Re: Visible Series in Chart
Posted: Tue Jan 14, 2014 9:01 am
by Edmund
Yes, but you access via the Curves not Series.
like
Code: Select all
// with name
Trend1.Curves["Curve 1"].IsVisible = false;
// or index
Trend1.Curves[0].IsVisible = false;
You can toggle them like this
Code: Select all
void Button1_Click(System.Object sender, System.EventArgs e)
{
Trend1.Curves[0].IsVisible = !Trend1.Curves[0].IsVisible;
}
Best Regards
Re: Visible Series in Chart
Posted: Thu Jan 16, 2014 4:12 am
by JohnCZ
Thanks Edmund,
I use this code for trend viewer. What I mean is that I have a chart graf (Chart types= line) not trend. This code is working for Trends.
- Axis parameters.jpg (143.73 KiB) Viewed 13445 times
red arrow is symbol to show only red Series
blue arrow is symbol to show only blue series
If there were possibilty to have trend viewer not with time scale sou it will be possible but
Re: Visible Series in Chart
Posted: Thu Jan 16, 2014 5:58 am
by Edmund
Ahh Sorry JohanCZ, I missread you thread.
I havent realy used the chart tool so donĀ“t know anything about it.
Re: Visible Series in Chart
Posted: Tue Jun 03, 2014 2:21 am
by janerik
old thread but...
Chart.Series["Series"].IsActive = false;
Re: Visible Series in Chart
Posted: Thu Jun 05, 2014 12:48 am
by JohnCZ
Hi there,
Thanks I already used it as no-friendly solution. But customer doesn't wanted because the previous chart stay there. This script only active/inactiv the chart. He wants to have it as in trends, so we did three charts object and used tags to visible them.
Best regards
JohnCZ