Posted 15 December 2017, 1:49 am EST
Hello,
I am new to using the C1Chart component and was hoping for a little getting started help, sample links, examples… End goal, I need to create a trend line with time points on the X axis and numeric values on the Y Axis. These are simply data points collected with a time stamp from machines running that we want to show the values over a time period.
I am translating the time stamp/time values into ‘seconds’ , from an offset, as a numeric value for use in the x axis. Ideally, I want to show the actual string/time stamp at that point on the x axis. I started with sample code from this site, noted below. I have it now, with the code below, with all the labels writing at the 0,0 location. I had labels working in this sample code.
Thanks much for any help!
Dim i As Integer = 0 ' add data to the chart Dim points As PointF() = CType(Array.CreateInstance(GetType(PointF), NumberOfDCItems), PointF()) For i = 0 To NumberOfDCItems - 1
’ DC History Seconds offset are the number of seconds calculated for a time stamp
’ written to this array
points(i).X = DCHistorySecondsOffset(i)
points(i).Y = DCHistoryValue(i) ’ The actual numberic value
Next
C1Chart2.ChartGroups(0).ChartData.SeriesList(CurrentTrendLine).PointData.CopyDataIn(points)
Dim TempString As String ' add X time stamp labels to the chart With C1Chart2.ChartArea.AxisX .ValueLabels.Clear() For i = 0 To (NumberOfDCItems - 1)
’ The time stamp below, would be for example, “12:15:00 AM”, the ‘time’ part of
’ a date data type
TempString = DCHistoryTimeStamp(i).ToString()
.ValueLabels.Add(i, TempString)
Next
.AnnoMethod = C1.Win.C1Chart.AnnotationMethodEnum.ValueLabels
End With