Open BhargaviAnnadevara opened 8 months ago
Is there any approach we can use in the interim? And really this can affect many of the charts, from box plots to scatter charts-
I can't think of any easy way for Victory to determine which labels to display. A naive implementation that measures for overlap would bias to the first set of labels and end up skipping labels at uneven intervals.
I think we need to see a mockup of what a solution would look like, along with a set of rules for determining the display logic. Or if there is another charting library that offers a similar implementation we can explore how they do it.
As a start, I think just support for a user supplied naive thinning function (maybe which perhaps could also receive the zoom level so thinning could be turned down or off as well) would at least be something. True overlap detection would take more work 😞
Describe the bug When a large dataset is plotted as a line chart, noticing that the tick labels for the data on the chart are overlapping with each other causing it to become obscure. Is there a way to avoid this issue? Can the library decide which labels to display without overlapping? Or, can we provide a set of labels to be displayed, like
tickValues
maybe?Victory version Which npm version are you using? N/A
Code This issue can be reproduced in the editable source present in VictoryLine chart with the below snippet:
Expected behavior Victory should automatically and selectively render a limited set of labels that helps render the chart neatly, or, should accept it as a prop similar to
tickValues
.Screenshots
Additional context Another observation from this example is that some labels like
0k
are overlapping with the y-axis line, which shouldn't happen. Although the position of the labels can be adjusted manually, I feel this should be taken care of automatically by the library.Any inputs are appreciated!