chart-fx icon indicating copy to clipboard operation
chart-fx copied to clipboard

Feature Request: allow explicit setting of axis' tick marks

Open wolfig opened this issue 1 year ago • 1 comments

Current Situation With the current implementation of an Axis, there is no user-friendly method to explicitly pass ticks to the axis which shall be shown. There are methods

  • xAxis.getNewTickMark(double, double, String)
  • new TickMark(Side, double, double, double)

But they are difficult to use and require a high level of understanding of the JavaFX canvas, etc.

Furthermore, it is not possible (to my knowledge) to set tick mark style options such, that only selected ticks are shown, independent of major/minor tick mark settings.

Desired Functionality I propose a new method in the DefaultNumericAxis implementation which allows to pass an array of tick mark values in the user coordinate space. The method shall be able to convert the user-space coordinates automatically into canvas space coordinates.

Furthermore, I propose to provide a functionality on the DefaultNumericAxis that ONLY the user tick values are displayed in to plot. This functionality could be implemented by passing an array of tick mark values to display.

Note This feature request is related to my other issue about ContourChart coordinate alignment.

Environment:

  • FAIR CS environment
  • ChartFx version: 11.2.7

wolfig avatar Jun 26 '23 15:06 wolfig

Hi @wolfig, we are trying to keep and optimise ChartFx to be a flexible library.

This is a valid feature, but I would strongly recommend not to overload the DefaultNumericAxis further. It is already complex enough as it is and I'd recommend writing a new axis implementation. There are several implementations that should be able to guide you-

We are looking forward to your pull-request! :+1:

RalphSteinhagen avatar Jun 27 '23 17:06 RalphSteinhagen