|
Realtime plot for 3D scatter chart |
Posted by Kevin on Oct-16-2013 14:37 |
|
Dear ASE
Is it possible to plot 3D scatter chart? I've modified realtime chart(xychart) demo code.
But it doesn't operate. After some seconds from start, I just can see plot for full points.
I'm using c# .net language for test. Is there any reference code for this case? |
Re: Realtime plot for 3D scatter chart |
Posted by Peter Kwan on Oct-16-2013 23:49 |
|
Hi Kevin,
You can use the realtime chart for any ChartDirector chart type. Basically, you just need to update the data in realtime and then redraw the chart to reflect the updated data.
I have attached an example modified from the C# Windows Forms "Simple Realtime Chart" sample code. Basically, I just replaced the original line chart drawing code with a 3D scatter chart drawing code. Like the original "Simple Realtime Chart" sample code, the data are random values. In your real application, you may pass in your real data instead of using random values.
Hope this can help.
Regards
Peter Kwan
|
Re: Realtime plot for 3D scatter chart |
Posted by Kevin on Oct-18-2013 20:15 |
|
Dear Peter Kwan
Thank you very much for your help. I could basic chart by attached reference code.
By the way, my application is some different with realtime chart demo.
Is it possible to plot realtime chart without using timer?
Byte data or byte data array transmitted irregularly from FPGA board to my pc by USB.
518400 (960 x 540) data transmitted by 2bytes unit. Therefore, I can't synchronize
timer's tick with transmission from FPGA board. It is difficult for me to synchronize chart
update timer's tick with transmission. My application is display. One frame image
data transmitted to PC by USB (8bit FIFO-FTDI chip). After complete transmission, some
lines or some data block should be drawn frome 1st line to end of lines by some interval
not over 1 minute. I don't know how to apply thread(background worker) in this case.
I think that thread is not suitable for solution. I'm sorry for my poor english. But I would
like to ask one more about solution. I sincerely need your help. |
Re: Realtime plot for 3D scatter chart |
Posted by Peter Kwan on Oct-18-2013 23:25 |
|
Hi Kevin,
You do not need to "synchronize" your data with the chart. Even in the sample code, the data are not synchronized to the chart. In the sample code, the data are created using the dataRateTimer, and the chart is updated using the chartUpdateTimer, and they are not synchronized.
For your case, if you do not want to use dataRateTimer to obtain the data, you can use any other method you like. For example, you can use interrupts or polling or any method you like to read the data from your FPGA board. Suppose each "frame" of your data is 518000 data values. So your code would need to read 518000 data values from your FPGA. After your code have read 518000 data values, it can update the data arrays used for drawing the chart. The chart will then be updated during the next chartUpdateTimer tick. Alternatively, after your code have read 518000 data values, it can copy them to the data arrays and then trigger the ViewPortChanged event ("winChartViewer1.updateViewPort(true, false);"). The chart will then be updated to reflect the updated data array.
Hope this can help.
Regards
Peter Kwan |
|