Page 1 of 1

problem with not showing point in line series

Posted: Fri Mar 13, 2009 10:04 am
by 9637396
Hi there

I am using teechart net 2.0.2306.26232 and VB net 2005

I have a problem with the line series, which I hope you can help me with

The problem is a bit special.
If I add a line series that has exactly two points and those points both have the same value (eg. x=3 and Y=10 and X=3 and Y=10) the point is not displayed on the graph. This means that the graph is completely wrong and the end user will not know it.

Is there some kind of work-around?

See code example below.

Thanks in advance
Lars Iversen


Private Sub CreateGraph()

Dim myLineSeries As Steema.TeeChart.Styles.Line
TChart1.Chart.Aspect.View3D = False

'This creates a fine looking line series with 3 points
myLineSeries = New Steema.TeeChart.Styles.Line
myLineSeries.Pointer.Visible = True
myLineSeries.Add(1, 1)
myLineSeries.Add(2, 2)
myLineSeries.Add(3, 5)
TChart1.Series.Add(myLineSeries)

'This creates a line series where one point is added and the line series is displayed fine as one point
myLineSeries = New Steema.TeeChart.Styles.Line
myLineSeries.Pointer.Visible = True
myLineSeries.Add(1, 7)
myLineSeries.Add(3, 9)
TChart1.Series.Add(myLineSeries)

'This creates a line series where I add two points with the exact same values(duplicate)
'The point 3,10 is NOT displayed in the graph at all
myLineSeries = New Steema.TeeChart.Styles.Line
myLineSeries.Pointer.Visible = True
myLineSeries.Add(3, 10)
myLineSeries.Add(3, 10)
TChart1.Series.Add(myLineSeries)

End Sub

Posted: Fri Mar 13, 2009 11:28 am
by 10050769
Hello Lars Iversen,


I think, that your problem is here:

Code: Select all

This creates a line series where I add two points with the exact same values(duplicate)
'The point 3,10 is NOT displayed in the graph at all
myLineSeries = New Steema.TeeChart.Styles.Line
myLineSeries.Pointer.Visible = True
myLineSeries.Add(3, 10)
myLineSeries.Add(3, 10)
TChart1.Series.Add(myLineSeries) 
When you add two points equal to LineSeries, the line is not visible therefore the pointer nor is visible, because the line don't exist. For the reason that, you can not draw a line with two points equal, you needs two differents points for draw a line.

Code: Select all

I recomen that use the next code:
        Dim myPointSeries = New Steema.TeeChart.Styles.Points
        myPointSeries.Add(3, 10)
        myPointSeries.Add(3, 10)
        TChart1.Series.Add(myPointSeries)
Thanks,

Posted: Fri Mar 13, 2009 1:47 pm
by 9637396
Hi Sandra

Thanks for your answer. Although it was not really what I was hoping for.
I still mean that if I have a line series and I add one and only one point to it it is displayed correctly as one point. If I add two points they are still displayed correctly with a line between them If I add two identical points nothing is shown at all. I mean the I am entitled to expect that there would be a point visible.

Anyway I have gone ahead and solved it by looping through all my series in the graph. If any series has two identical values as the two last items I delete the last item and now my graph is shown ok. Also including the single points that where "secret" before.

Br
Lars Iversen

Posted: Fri Mar 13, 2009 5:11 pm
by narcis
Hi Lars,

Ok, I've added your request to the wish-list to be considered for inclusion in future releases.

Posted: Fri Mar 13, 2009 5:20 pm
by narcis
Hi Lars,

As an update, I've checked this works fine using latest TeeChart for .NET v3 maintenance release available with your code. You may want to check the fully functional evaluation version here:

http://www.steema.com/downloads/form_tch_net.html