Page 1 of 1

Dont want to show Series title

Posted: Tue Apr 06, 2010 8:09 am
by 13045482
Hi
I have 3 series in a stacked bar chart and i have assigned them titles. Also i have this piece of code-

Dim MarksTip1 As Steema.TeeChart.Tools.MarksTip
MarksTip1 = New Steema.TeeChart.Tools.MarksTip

MarksTip1.Style = Steema.TeeChart.Styles.MarksStyles.SeriesTitle

Now because of above when i hover mouse over the bars i can see the titles of the series. This is fine for series1 and series2 but i dont want to show it for series3. I want when user hover the mouse over series3 nothing should be displayed. But for this i dont want to remove the title of the seies3 as i want to show the same in legend. Is there any way to accomplish the same. Many thanks in advance.

Re: Dont want to show Series title

Posted: Tue Apr 06, 2010 10:57 am
by narcis
Hi shikha,

Yes, you can use MarksTip's GetText event to set to an empty string the hints you don't want to display, for example:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private void InitializeChart()
		{
			for (int i = 0; i < 3; i++)
			{
				tChart1.Series.Add(new Steema.TeeChart.Styles.Bar());
				tChart1[i].Title = "Bar " + (i + 1).ToString();
				tChart1[i].FillSampleValues();
			}

			Steema.TeeChart.Tools.MarksTip marksTip1 = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart);
			marksTip1.Style = Steema.TeeChart.Styles.MarksStyles.SeriesTitle;
			marksTip1.GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(marksTip1_GetText);
		}

		void marksTip1_GetText(Steema.TeeChart.Tools.MarksTip sender, Steema.TeeChart.Tools.MarksTipGetTextEventArgs e)
		{
			if (e.Text == tChart1[tChart1.Series.Count - 1].Title)
			{
				e.Text = "";
			}
		}

Re: Dont want to show Series title

Posted: Fri Apr 09, 2010 1:25 pm
by 13045482
Great.. it worked perfectly.. Thanks so much... :D