Support #8526
openWidget example code for Constellation plot
0%
Description
Hello Team,
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
thanks--
Somesh
Files
Updated by Korneel Dumon almost 4 years ago
Yes, this is possible, have a look at the documentation for WDataSeries. More specifically
setType()
allows you to plot points without linessetMarker()
/setMarkerSize()
allows you to make big circle markerssetLabelsEnabled()
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 4 years ago
Thanks for your prompt response. I will check out the examples, class and the mentioned routines.
-s
Updated by Someshwar DK almost 4 years ago
- File constellation.gif constellation.gif added
Hello Korneel,
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.
thanks--
Somesh
Updated by Korneel Dumon almost 4 years ago
Hi,
nice to see it's working for you. You can do live updates with server-push. See WApplication::enableUpdates() for some documentation. There is also an example called serverpush.
Updated by Someshwar DK almost 4 years ago
I was able to use the below routines to update the data-set and see the Chart getting updating Live,
itemModel()
setData()
thanks--
Somesh