ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Plotting real time data points on a surface chart
Posted by Fiona on Oct-01-2021 00:50
I have been trying out ChartDirector for a month now and am very impressed with the results. I do however, have a requirement which I don't think is currently possible.

I am particularly interested in the Surface Charts, and would like to know whether it is possible to display a series of real time (moving) data points (one point at a time) on the surface of the chart. I wish to use the chart to display probability density such that I can also show where the data point is on the chart's surface to determine how well it fits the curve.

Is there a way of doing this?

Thanks in advance,

Fiona

  Re: Plotting real time data points on a surface chart
Posted by Peter Kwan on Oct-01-2021 01:58
Hi Fiona,

I am not sure which programming language of ChartDirector you are using, and whether it is a desktop or web application. In any case, there are some real-time charts examples included in ChartDirector. You can try them to see how it works in general. Basically, they simply update the data and redraws the chart periodically. The sample code only includes XYChart in realtime chart examples, but you can apply the same method (updating the data and redraw the chart) to any chart type you like.

For the surface chart, in ChartDirector 7.0, you can draw anything you like on the surface. See:

https://www.advsofteng.com/doc/cdcpp.htm#surfacelinezone.htm
https://www.advsofteng.com/doc/cdcpp.htm#surfacetexture.htm

For your case, you can draw the points using one of the following methods:

(a) Use a loop to draw the points as a sample rectangle or an X shape, like in the
"Surface Lines and Zones" sample code.

or

(b) Draw the points in a XYChart, and then map the XYChart onto the 3D surface, like in the "Surface Texture" sample code.

When you can have an additional data point, you can add that to your data array, and redraws the chart.

Hope this can help.

Regards
Peter Kwan

  Re: Plotting real time data points on a surface chart
Posted by Fiona on Oct-01-2021 05:39
Hi Peter,

Thank you for your help, I am using c# for a desktop application at the moment.
I will have a look at the solutions you have suggested.

Many thanks.

Fiona

  Re: Plotting real time data points on a surface chart
Posted by Fiona on Oct-01-2021 23:08
Thanks Peter,

I went for the Surface Line and Zones option and it looks great.

I don't seem to be able to modify the background colour of the viewer, whatever I try it always displays a white background.

Also, I am currently using 2 charts in a MultiChart, the first chart is displayed on the zero Z plane and I load a smith chart image onto it so that my 2nd surface chart sits on top of a smith chart. Is there a better way to load an image onto this plane?

Many thanks for your support.

Fiona

  Re: Plotting real time data points on a surface chart
Posted by Peter Kwan on Oct-04-2021 15:04
Hi Fiona,

Normally, the background color you see is the background color of the chart, not the background color of the viewer. So setting the background color of the viewer has no visible effect.

When you create the chart, you can specify the background color. If the background color is not specified, the default is white. An example to specify the background color is:

// pale blue as background color
SurfaceChart c = new SurfaceChart(800, 600, 0xddddff);

See:

https://www.advsofteng.com/doc/cdnet.htm#SurfaceChart.SurfaceChart.htm

You mentioned about using 2 charts in a MultiChart. Are you trying to do something like in the "Surface Projection" sample code, except that the projection on the bottom wall is an independent chart?

https://www.advsofteng.com/doc/cdnet.htm#surfaceprojection.htm

The built-in z=0 projection is the projection of the surface itself. If you need the projection to be different, you would need to use 2 charts like what you have mentioned. For the first chart, it contains just the projection (just a flat surface at z = 0 and add an Smith Chart image texture to the surface). The two vertical walls can be set to hidden. For the second chart, it contains just the surface, with the chart background color set to Chart.Transparent and the bottom wall set to hidden.

Regards
Peter Kwan