Widget example code for Constellation plot
I am in process of building a Frontend for displaying statistics from our backend server.
I receive data for plotting constellation on the cartesian plane. With Scatter-Plot, I see that the (x,y) coordinates connect with a line, but with our requirement, we only want the coordinate dots to be plotted.
Attaching an example output to get as Red dots,
Please help me with below,
- Is it possible to plot dots as above?
- Which widget do I use to achieve this? Please point me to some documentation
- Please point me to some example code for plotting the constellation
Updated by Korneel Dumon almost 3 years ago
Yes, this is possible, have a look at the documentation for WDataSeries. More specifically
setType()allows you to plot points without lines
setMarkerSize()allows you to make big circle markers
setLabelsEnabled()for the labels
There is pretty extensive charts example here: https://www.webtoolkit.eu/wt/examples/charts/charts.wt. The source code for this is included in Wt.
Updated by Someshwar DK almost 3 years ago
I was able to get the above plot using the example you pointed out.
I have a few more questions,
- Can the constellation points on the Cartesian plane be updated periodically and be shown as a Live plot?
- The example uses WStandardItemModel class to take in 40 coordinates and plot them. Can we periodically call WCartesian::setModel() routine to show new plotted points in the chart?
Basically, we keep getting new coordinates from the backend 4/5 times in a second and we want the Frontend to keep refreshing/updating whenever new data is loaded. We want to show the latest data and keep refreshing it to show as a Live updating Chart.
Please suggest the right approach.