Open
Description
openedon Nov 16, 2021
The current value formatting logic is a bit tricky and can be described as a set of fallback options with the following orders and priorities:
Formatter for X axis labels (used for non-multilayer axis):
- current axis
axisSpec.labelFormat
- current axis
axisSpec.tickFormat
toString
Formatter for the Y axis labels:
- current axis
axisSpec.labelFormat
- current axis
axisSpec.tickFormat
- the first
seriesSpec.tickFormat
for the relativegroupId
toString
Formatters for the tooltip header:
Settings.tooltip.headerFormatter
- the last X axisSpec
axisSpec.tickFormat
<--- to fix toString
Formatters for the tooltip value:
- current series
seriesSpec.tickFormat
- the last Y axisSpec
axisSpec.tickFormat
<--- to fix toString
Formatters for the legend value:
- current series
seriesSpec.tickFormat
- the last Y axisSpec
axisSpec.tickFormat
<--- to fix toString
Formatters for the bar data values:
- the last Y axisSpec
axisSpec.tickFormat
<--- to fix - the first seriesSpec
seriesSpec.tickFormat
<--- to fix toString
This brings in a lot of instability and lack of clarity when defining formatters for the various label in the chart.
I'd like to propose the following:
- better naming for the various formatters: something along the following lines
labelTickFormatter
to format axis tick labels,barValueLabelFormatter
for bar data values,legendExtraValueLabelFormatters
,tooltipValueLabelFormatter
andtooltipHeaderValueLabelFormatter
- create a clear and logical fallback when not specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment