charts
charts copied to clipboard
Observations with AxisBuilder / Axis?
When trying to build the following axis:
xAxisElev = AxisBuilder.create(Orientation.HORIZONTAL, Position.BOTTOM)
.autoScale(false)
.type(AxisType.LINEAR)
.minorTickMarksVisible(false)
.mediumTickMarksVisible(false)
.minorTickSpace(5)
.majorTickSpace(5)
.tickLabelFontSize(16)
.title("")
.build();
I run into various points that I would like to check before trying to change code :-)
- No matter what I pass as
majorTickSpaceits always overwritten duringredraw()since bothcalcAutoScale()andcalcScale()set minor / major tick space (in my case its always set to 20 after build() and can't be changed afterwards sincesetMajorTickSpace()is protected). - The variables of Axis are not independent of each other, e.g. what happens during
redraw()(used in most setXXX methods) depends on autoScale. So I would need to set autoScale first, but AxisBuilder uses a HashMap and not a LinkedHashMap - so I can't influence the order of setting of Axis variables. - The above
build()triggersredraw()6 times. Especially for the builder it would be nice to have some "transactional" bracket to callredraw()after all the setXXX have been done?
Next observation: After setting ticks & labels properly I have the issue that the available canvas range for the pane of XYChart doesn't seem to take axis dimensions into account properly:

Unfortunately, I didn't tight away find the place where the sizing of the pane is done. Playing around with padding of the XYChart didn't help.
See pull request #75