Jason Schaeffer on 21 Apr 2022 16:02:35
Use case: I am plotting percentages on a line chart. These values shouldn't be below zero, but I want to see them if they do. They shouldn't be above 100% but I definitely want to see them if they do. Because I need the extents of the line chart to float, I can't hard-code min and max values into the axis. But when I let the axis float, it oftentimes chooses weird divisions of the axis so that 100% isn't a label on the axis, which is disorienting to the chart users. I would like to be able to set 0% and 100% as "pinned values", so that they always show as labels on the chart. If the data falls between 0% and 100%, then the chart will plot from 0 to 100% as though these were the set min and max values. If the data happens to swing below 0 or above 100%, then the min and max would be set normally, but the labeling interval would be calculated to ensure that the pinned values always fall on a label.
Two extensions to this idea:
- For charts that have a continuous X axis, allow the same "pinned axis values" feature.
- Allow the pinned axis values to be constants or measures, which would allow us to use our own logic to adjust the value.