Page 1 of 1

How to highlight selected line when clicked item in legend box

Posted: Mon Nov 26, 2018 8:46 am
by 16082909
Hola

Please explain how to highlight the one line among More than one series.

Is there an option like when I clicked a item in legend, the others become blurred at tee chart?
chart.png
chart.png (28.31 KiB) Viewed 8289 times
Thank you for tee-chart

Re: How to highlight selected line when clicked item in legend box

Posted: Tue Nov 27, 2018 8:10 am
by Christopher
Hello,

one option would be to highlight the series clicked in the legend by making the other series more transparent, e.g.

Code: Select all

		private void InitializeChart()
		{
			for (int i = 0; i < 4; i++)
			{
				tChart1.Series.Add(typeof(Line)).FillSampleValues();
			}

			tChart1.ClickLegend += TChart1_ClickLegend;
		}

		private void TChart1_ClickLegend(object sender, MouseEventArgs e)
		{
			int index = tChart1.Legend.Clicked(e.X, e.Y);

			if(index > -1)
			{
				for (int i = 0; i < tChart1.Series.Count; i++)
				{
					tChart1[i].Transparency = 0;

					if (i != index)
					{
						tChart1[i].Transparency = 70;
					}
				}
			}
		}
Thank you for tee-chart
You're very welcome :)