Line series and connecting line BUG?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Line series and connecting line BUG?

Post by norman » Wed Jul 29, 2009 2:32 pm

BUGHi,

Please could someone advise how I might go about the following.

I have a line series to which I add points like so:

Dim series As New Steema.TeeChart.Styles.Line
series.Add(DateTime, Value, Colour)

The result is as shown in image1 below.
image1.gif
image1
image1.gif (2.02 KiB) Viewed 9248 times
What I'd like to do is not paint a line between points if the time interval between subsequent points is greater than a certain value. See image2 (which was created using an image editor).
image2.gif
image2
image2.gif (1.97 KiB) Viewed 9249 times
Note that a line is not drawn between the 7th and 8th points because the time difference is greater than x no. of minutes (Note however that both points are visible).

I've had a look at some examples that deal with null values but its not quite the same? The time interval between points can vary and aren't as regular as I've shown in my examples.

I know how to work out the time difference between points as I loop through them and add them to the chart - I'm just not sure on how to customize the connecting line.

Thanks,

Norman
Last edited by norman on Wed Aug 05, 2009 9:09 am, edited 1 time in total.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Line series and connecting line

Post by Sandra » Thu Jul 30, 2009 9:16 am

Hello Norman,

I will suggest 3 possible solutions, for solve your issue.

1.- You could add a new series for each grap that you have.

2.- Added points regularly, and there are some points haven't value, put the point trasparent or null.

3.- Once added data, search where there are graps in series and added one point null in the middle of grap, because to be as you would like.

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Re: Line series and connecting line

Post by norman » Tue Aug 04, 2009 8:42 am

Hi Sandra,

Thanks for the reply and the suggestions - much appreciated. The first two possibilities aren't really options really because I foresee a lot of problems with introducing additional series (e.g. with legend etc. I also have functionality that is linked to series - like clicking on points etc. and keeping track of all these mini-series would get complicated I'm sure). I can't add points regularly either - as I mentioned there isn't a predeterminable pattern to the points. I may be able to do something with option 3, however, I'm wondering would changing from a line series to some other series (e.g. point?) provide me with other options?

Thanks again,

Norman

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Re: Line series and connecting line (BUG?)

Post by norman » Tue Aug 04, 2009 3:26 pm

Hi,

I've noticed something when attempting to do as you describe. The code below will result in a gap between the 3rd and 4th point in the series (where there is a gap of 2 days) as desired. However, if you position the mouse over the points a tooltip will not appear over the 3rd point. Is this a bug or is it by design (althought can't see why as there is 10 non-null points on the chart).

Code: Select all

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

   Dim ch As Steema.TeeChart.Chart = WebChart1.Chart
   ch.Aspect.View3D = False

   Dim seriesHotspotTool As New Steema.TeeChart.Tools.SeriesHotspot(ch)
   seriesHotspotTool.HelperScript = Steema.TeeChart.Tools.HotspotHelperScripts.Annotation
   seriesHotspotTool.HotspotCanvasIndex = 499
   seriesHotspotTool.MapAction = Steema.TeeChart.Styles.MapAction.Script
   seriesHotspotTool.MapElements = ""
   AddHandler seriesHotspotTool.GetHTMLMap, AddressOf hotspot_GetHTMLMap

   Dim lineSeries As New Steema.TeeChart.Styles.Line
   lineSeries.Color = Drawing.Color.Black
   lineSeries.ColorEachLine = False
   lineSeries.Pointer.Visible = True
   lineSeries.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle
   lineSeries.Pointer.HorizSize = 2
   lineSeries.Pointer.VertSize = 2

   lineSeries.Add(Now.AddDays(-1), 1)
   lineSeries.Add(Now.AddDays(-2), 2)
   lineSeries.Add(Now.AddDays(-3), 3) ' tooltip will not appear for this point
   lineSeries.Add(Now.AddDays(-5), 5)
   lineSeries.Add(Now.AddDays(-5), vbNull, Drawing.Color.Transparent)
   lineSeries.Add(Now.AddDays(-6), 6)
   lineSeries.Add(Now.AddDays(-7), 7)
   lineSeries.Add(Now.AddDays(-8), 8)
   lineSeries.Add(Now.AddDays(-9), 9)
   lineSeries.Add(Now.AddDays(-10), 10)
   ch.Series.Add(lineSeries)

End Sub

Private Sub hotspot_GetHTMLMap(ByVal sender As Steema.TeeChart.Tools.SeriesHotspot, ByVal e As Steema.TeeChart.Tools.SeriesHotspotEventArgs)

   Dim XVal As String = e.PointPolygon.Title
   XVal = Date.FromOADate(e.Series.XValues.Value(e.PointPolygon.ValueIndex)).ToString("MM/dd/yyyy HH:mm:ss")

   e.PointPolygon.Title = "Date/Time: " & XVal & vbCrLf & _
   "Value: " & e.Series.YValues.Value(e.PointPolygon.ValueIndex).ToString()

End Sub
Thanks,

Norman

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Line series and connecting line BUG?

Post by Sandra » Wed Aug 05, 2009 11:09 am

Hello norman,
Is this a bug or is it by design (althought can't see why as there is 10 non-null points on the chart).
I could reproduce your issue, and I think that is a bug for TeeChartFor .Net with WebForms, because in WinForms this not occurs using Mark Tips Tool . I added this, in Bug Report list with numer [TW77014337 ]. We will try to fix it for next versions of TeeChart .NET.


Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Re: Line series and connecting line BUG?

Post by norman » Wed Aug 05, 2009 11:14 am

Many thanks - I look foward to the fix.

Post Reply