The positions in a chart's data, in the order its categories are drawn.
A category axis with reverse: true is drawn from the far end -- the
last-listed category leftmost on a vertical chart, topmost on a horizontal
one -- while chart.data.labels and every dataset stay in the order they
were written. Nothing in the bar family re-sorts what it is handed:
BarTrace and SegmentedTrace announce layer.data as it arrives, unlike
ScatterTrace, which sorts by ascending x and so cannot be steered from an
adapter at all (#1007). Emitting the written order therefore reads a
reversed chart backwards (#1015).
Exported because the highlight half has to walk the categories the same way.
Chart.js paints to canvas and none of these layers carry selectors, which
looked at first like an absence of the both-halves-must-move hazard of #988
or #1000 -- but the plugin outlines by index, through the table
computeTargetMaps builds, and a table built in the written order names a
different bar from the one a reversed payload announces (#1024). Sharing
this walk is what keeps the two from drifting apart again.
The positions in a chart's data, in the order its categories are drawn.
A category axis with
reverse: trueis drawn from the far end -- the last-listed category leftmost on a vertical chart, topmost on a horizontal one -- whilechart.data.labelsand every dataset stay in the order they were written. Nothing in the bar family re-sorts what it is handed:BarTraceandSegmentedTraceannouncelayer.dataas it arrives, unlikeScatterTrace, which sorts by ascending x and so cannot be steered from an adapter at all (#1007). Emitting the written order therefore reads a reversed chart backwards (#1015).Exported because the highlight half has to walk the categories the same way. Chart.js paints to canvas and none of these layers carry
selectors, which looked at first like an absence of the both-halves-must-move hazard of #988 or #1000 -- but the plugin outlines by index, through the tablecomputeTargetMapsbuilds, and a table built in the written order names a different bar from the one a reversed payload announces (#1024). Sharing this walk is what keeps the two from drifting apart again.