quickplot
|
QuickPlot is a charting library for QML. It has just recently started and is actively under heavy development. Currently, we are not competitive with QtChart, but we hope to reach that point.
This library is based around converting data between two different spaces.
The values of the data points. These are the real world measurements that you want to visualise in the plot. All off the PlotGeometry descendents expect for their data to be given in data space coordinates.
The location in the graph. The chart space goes from -1 to 1 along the X, Y, and Z axes. An Axis (or a subclass there of) is used to convert data from the data space into the chart space. Only developers creating new axes and geometries should ever need to think about chart space.
The simplest chart will need two axes for the X and Y coordinates. A chart can handle any number of axes, but each data plot will require at least two axes to plot. The axis is declared via the AxisModel.
The axis requires a direction (which can be X, Y, or Z) and a thickness. To plot the axis in the chart, wrap it within an AxisModel. It will need a color
(probably black) and a scl
, which represents the size of the canvas. The scale ensures that the graph can be safely resized.
The data can then be plotted with a LineModel
or a ScatterModel
. Just as with the axes, the data will need a thickness
and a scale
. It will also need to be object identifiers of the X and Y axis. Finally, the X and Y coordinates of the data points should be assigned to the xs
and ys
properties.
Every item that should appear in the chart (e.g. LineModel, AxisModel) need to be children of the same Node
element (which we named standAloneScene
in the example below). This node can be the importScene
of a View3D
. The view will also need an OrthographicCamera to prevent perspective distortions. Finally, a mouse area can optionally connect to the nudge
methods on the axes to enable easy scrolling of the plot.