DiscreteHeatMapLayer *addDiscreteHeatMapLayer(DoubleArray zData, int xCount);
Adds a discrete heat map layer to the XYChart by specifying the cell values and the cell count in the x direction.
The zData array contains the cell values. xCount is the cell count in the x direction. The cell count in the y direction will be computed as the total cell count (the size of the zData array) divided by xCount.
The boundary of the cells will be at integer axis coordinates 0, 1, 2, ..... In the x direction, the first column of cells will occupy the space between x = 0 and x = 1, the second column between x = 1 and x = 2, and so on. The same applies to the y direction. The first row of cells will be between y = 0 and y = 1, the second row between y = 1 and y = 2, and so on.
This method is often used with
Axis.setLabels and
Axis.setLabelOffset for axis labelling. The Axis.setLabels put labels at coordinates 0, 1, 2, ... along the axis. The Axis.setLabelOffset can offset the labels by 0.5 units, so the labels will be at 0.5, 1.5, 2.5 ... which corresponds to the center of the cells.
A similar method
XYChart.addDiscreteHeatMapLayer2 allows you to specify the exact x and y coordinates for the cells.
A
DiscreteHeatMapLayer object representing the discrete heat map layer created.
© 2023 Advanced Software Engineering Limited. All rights reserved.