See Category chart for an introduction to the charting library.
A scatter plot is very much like a category chart, but uses numerical data on the X axis. By default, these numerical data are mapped linearly on the X axis, but may also be log transformed (This can also be configured for the Y axes). In addition, there is special support for displaying date series, by means of smart heuristics for chosing the labels on the X axis.
In a ScatterPlot, the X series data are interpreted as numbers on a linear scale. The scale for the X axis defaults to a LinearScale, but this may be changed to a DateScale when the X series contains dates (of type WDate) to create a time series chart, or to a LogScale. A ScatterPlot supports the same types of data series as a CategoryChart, but does not support stacking. In a scatter plot, the X series do not need to be ordered in increasing values, and it may be set differently for each dataseries using WDataSeries::setXSeriesColumn(int modelColumn).
The table below shows an extract from historical financial market data. The scatter plot shows the second and the third column as line series.
Below we plot a single sine curve. We use 'curve' data series, which creates a smooth spline curve that interpolates the data points. As is typical when showing mathematical functions, we let the axes cross each other at the origin (0, 0).
Missing data in a model series Y values is interpreted as a break. For curve-like series, this breaks the curve (or line).
WCartesianChart supports some forms of interaction that do not require a server roundtrip. You can zoom in on the chart below using ctrl+scroll, or with a pinch movement, and pan it with the scrollwheel, click and drag, or touch and drag.