Hi
I have a teechart which has 3 different type of series. Like the first one is in shape of line the second in shape of circle, third is triangle. Now line series has many data that is i have 5 lines in my chart, 5 circles and 5 triangles. Now i want marktips to be shown for each series like this
for line series-> seriestitle
for circle series-> X,y points
for triangle series-> X,y points
I tried something like ->
MarksTip1.Series.Add(tchlinVPECurve)
MarksTip1.Style = Steema.TeeChart.Styles.MarksStyles.SeriesTitle
MarksTip2.Series.Add(ActualMarker)
MarksTip2.Style = Steema.TeeChart.Styles.MarksStyles.XY
MarksTip3.Series.Add(ProposedMarker)
MarksTip3.Style = Steema.TeeChart.Styles.MarksStyles.XY
But it throws error-> object reference not set .. though i have created marktips in design mode and then using them in code. Also error is at these lines->
MarksTip1.Series.Add(tchlinVPECurve)
MarksTip2.Series.Add(ActualMarker)
MarksTip3.Series.Add(ProposedMarker)
Marktips with multiple series
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi shikha,
You should try using this code instead:
If the "object reference not set" error persists please send us a simple example project we can run "as-is" to reproduce the problem here. You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
You should try using this code instead:
Code: Select all
MarksTip1.Series=tchlinVPECurve
MarksTip2.Series=ActualMarker
MarksTip3.Series=ProposedMarker
Thanks in advance.
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 |
Thanks but this will add only the first series. That is it will show tooltip for only one line, one triangle and one circle where as i am adding multiple series for each series in chart. That is i have many lines many circles and many rectangles in chart.
I am using
procedure x()
tcStraAssessRC.Series.Add(tchlinVPECurve)
tcStraAssessRC.Series.Add(ActualMarker)
tcStraAssessRC.Series.Add(ProposedMarker)
.........
end sub
and calling this procedure many times. So if i use wht u suggested then it will only display last series data.
I am using
procedure x()
tcStraAssessRC.Series.Add(tchlinVPECurve)
tcStraAssessRC.Series.Add(ActualMarker)
tcStraAssessRC.Series.Add(ProposedMarker)
.........
end sub
and calling this procedure many times. So if i use wht u suggested then it will only display last series data.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi shikha,
Sorry but after looking at this thoroughly I've found that you should use MarksTip.Series.Add, this is called when a new value is added to the series as it adds all points in source Series.
To achieve what you request you should use a MarksTip tool for each series, for example:
Sorry but after looking at this thoroughly I've found that you should use MarksTip.Series.Add, this is called when a new value is added to the series as it adds all points in source Series.
To achieve what you request you should use a MarksTip tool for each series, for example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
for (int i = 0; i < 5; i++)
{
tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
tChart1.Series.Add(new Steema.TeeChart.Styles.Points());
tChart1.Series.Add(new Steema.TeeChart.Styles.Points());
}
for (int i = 0; i < tChart1.Series.Count; i++)
{
tChart1[i].FillSampleValues();
Steema.TeeChart.Tools.MarksTip marksTip = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart);
marksTip.Series = tChart1[i];
int tmp = i % 3;
switch (tmp)
{
case 0:
marksTip.Style = Steema.TeeChart.Styles.MarksStyles.SeriesTitle;
break;
case 1:
marksTip.Style = Steema.TeeChart.Styles.MarksStyles.XY;
((Steema.TeeChart.Styles.Points)tChart1[i]).Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
break;
case 2:
marksTip.Style = Steema.TeeChart.Styles.MarksStyles.XY;
((Steema.TeeChart.Styles.Points)tChart1[i]).Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Triangle;
break;
}
}
}
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 |