The 3D charting API is built on top of JWt's 3D painting API. A chart is represented by a WCartesian3DChart, which derives from WGLWidget.
Based on the sort of data that will be shown, a chart is one of two types (the same as for 2D charts):
All data that can be shown in a 3D chart, has to derive from WAbstractDataSeries3D. Instances of this class include a model containing the actual data and all logic to draw themselves on the chart. This means all graphical features of the data (color, point size ...) are also part of this class.
JWt provides three built-in classes representing data:
Each instance of these data series has a WAbstractItemModel backing them. The model for all these data series has to be provided as a table.
In WGridData, the table must contain one column representing the x-axis values and one row representing the y-axis values. All other values then specify the z-axis value belonging to the corresponding (x, y) pair.
The backing model for WEquidistantGridData is similar, with the difference that no x- and y-axis values are required. These can be specified directly to the class instance using setXAbscis(double XMinimum, double deltaX)
and setYAbscis(double YMinimum, double deltaY)
.
The model for WScatterData must have three columns containing (x, y, z) values for every point.
All grid-based data has the additional feature that the visualization of the data is determined by its Series3DType
, which can be either of three values: