|
Chart question |
Posted by Luis on Aug-23-2015 03:29 |
|
Hello! If someone can help me, I have a multi axis chart, and I receive a real time data on it, when the lines fill the chart it moves the "x" axis and I can see all the data moving the scroll object, is there a way that I can only add data and the Maxvalue of the "x" axis increase without move the start value of the "x" axis???
I just want to add time at the "x" axis so I can see al the data in the chart on the screen and when I want to save the chart to a image file I can save the complete chart and not only the part of the chart that I'm seeing on the screen
Thanks for your help |
Re: Chart question |
Posted by Peter Kwan on Aug-25-2015 00:14 |
|
Hi Luis,
If the chart scroll when the lines fill the chart, it is probably because the charting code
remove the old data. It may be because your existing charting code is based on the sample
code, which removes the old data. As the sample code is only an example, you can freely
modify the sample code to fit you needs. For example, you can modify the sample code to
not removing the old data, but to extend the array to allow for more data, and to set the
axis range accordingly.
If you need further help, please kindly inform me your programming language and the type of
application you are writing (eg. is it a web or desktop application?), and the sample code
which your code is based on.
Regards
Peter Kwan |
Re: Chart question |
Posted by Luis on Aug-25-2015 01:27 |
|
Hello Peter
First at all thanks for your help
I'm programming a field software to monitor some variable sensors like pressure, density and rate, it's for an oilfield company, and it's a Ethernet real time data acquisition, I'm using visual basic.net (visual studio 2013), I attach the code for the chart form.
I'm going to modify the removing old data maybe I'm not going to use it, I extend my data array to 260000 positions so I can store a large amount of data, now the part I can't understand yet is how I can make the chart only by adding time to the max or to the end of the "x" axis so I can always see the full data chart without using the scroll control....
Thanks a lot for your support
Regards
|
Re: Chart question |
Posted by Peter Kwan on Aug-25-2015 03:26 |
|
Hi Luis,
In your case, the original sample code is the "Realtime Chart with Zooming and Scrolling".
In this sample code, the scrolling is controlled by the follow lines:
' Update the full range to reflect the actual duration of the data. In this case,
' if the view port is viewing the latest data, we will scroll the view port as new
' data are added. If the view port is viewing historical data, we would keep the
' axis scale unchanged to keep the chart stable.
Dim updateType As Integer = Chart.ScrollWithMax
If viewer.ViewPortLeft + viewer.ViewPortWidth < 0.999 Then
updateType = Chart.KeepVisibleRange
End If
Dim axisScaleHasChanged As Boolean = viewer.updateFullRangeH("x", startDate,
endDate, updateType)
If you always want to show the full range, you can just hard coded the viewport to show
the full range.
viewer.ViewPortLeft = 0
viewer.ViewPortWidth = 1
Note that since the chart always display the full range, it means there would be no
zooming or scrolling, and the zooming and scrolling code in this example is not necessary.
So it may simpler if the code is based on the "Realtime Chart with Track Line" instead.
Hope this can help.
Regards
Peter Kwan |
Re: Chart question |
Posted by Luis on Aug-25-2015 03:40 |
|
Thanks Peter
I would try the option you told me and test again
regards |
Re: Chart question |
Posted by Luis on Aug-25-2015 23:28 |
|
Hello Peter
Just to report that the chart works like I want it with the changes you suggest
Thanks |
|