knowm / XChart

XChart is a light-weight Java library for plotting data.
http://knowm.org/open-source/xchart
Apache License 2.0
1.5k stars 396 forks source link

allow setting custom tick marks #865

Open flavius-t opened 3 months ago

flavius-t commented 3 months ago

Describe the bug This is not a bug, but a request to improve the custom tick mark functionality. Currently the only methods (that I am aware of) to customize the number of axis tick marks/spacing are chart.getStyler().setXAxisTickMarkSpacingHint(...) and chart.getStyler().setYAxisTickMarkSpacingHint(...). I find these methods generally do not result in the desired spacing. From looking at the code it seems there are many more factors that determine the actual tick marks generated.

It would very helpful if a more flexible approach was taken. Perhaps there could be a method to set custom x-axis tick intervals that overrides all other tick mark logic, or a method to provide a set of tick mark values.

Screenshots N/A

Expected behavior If I define a set of tick marks, or tick mark interval, I would like these exact tick marks to be displayed.