Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Showing Markers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bechbd

15 Posts

Posted - 04 Oct 2005 :  17:44:26  Show Profile  Reply with Quote
I am having problems showing markers on a simple line graph. I am using the RT control and when a person clicks the graph a vetical line is put into the graph where the user clicked. After they are done with the realtime graph I display a standard graph(not using the RT engine just using the Chart2D engine) of the same data. My problem is that when I try to put the markers I saved from the real time graph into the standards graph nothing appears. This is the code I am using:

For i = 0 To ds.Tables("GSRMarker").Rows.Count - 1
Dim dr As DataRow = ds.Tables("GSRMarker").Rows(i)
Dim dt As Date = CDate(dr.Item("marker_time"))
Dim amarker As New Marker(thePlot1.GetChartObjScale(), DataCursor.MARKER_VLINE, dr.Item("marker_x"), dr.Item("marker_y"), 10.0, DataCursor.PHYS_POS)
amarker.SetColor(Color.Black)
amarker.SetLineWidth(10)
chartVu.AddChartObject(amarker)
'Add a text label to the line
pointLabel = New StringLabel(thePlot1.GetChartObjScale(), New Font("Microsoft Sans Serif", 8, FontStyle.Regular), dr.Item("marker_text"), dr.Item("marker_x"), dr.Item("marker_y"), DataCursor.PHYS_POS, DataCursor.JUSTIFY_CENTER, DataCursor.JUSTIFY_CENTER, 0)

' Nudge text to the right and up so that it does not write over marker
pointLabel.SetTextNudge(5, -5)
chartVu.AddChartObject(pointLabel)
Next

The data in the data set looks likt this:

marker_key marker_x marker_y
65 38629.651684768498 5.0862068965517205E-4
marker_text marker_time
Test 2005-10-04 03:38:26.483

Shouldnt this print out the markers the same as before? Also is there any way to specify a date for the marker instead of a double?

quinncurtis

1164 Posts

Posted - 04 Oct 2005 :  18:13:52  Show Profile  Reply with Quote
The value you are using for the time data looks wrong. Most of the date values have a double value the order of magnitude 10^14, representing milliseconds.

If want to convert a ChartCalendar value to the proper double value, just use the GetCalendarMSecs method.

ChartCalendar xValue = new ChartCalendar();
double xxx = xValue.GetCalendarMsecs();

You should be working with strictly ChartCalendar objects until you can get the chart to work. Then work on converting your table values to ChartCalendar values.

Go to Top of Page

bechbd

15 Posts

Posted - 04 Oct 2005 :  18:23:09  Show Profile  Reply with Quote
Thanks. Once I used the GetCalendarMsecs it worked fine.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07