1

I want to zoom into a BarChart in JavaFX. I found this project that does that this way:

private final ValueAxis<?> xAxis;
private final ValueAxis<?> yAxis;

lastY = event.getY();
yAxis.setAutoRanging(false);
yAxis.setLowerBound(yAxis.getLowerBound() + dY);
yAxis.setUpperBound(yAxis.getUpperBound() + dY);

However, I am using CategoryAxis for xAxis and not a ValueAxis. So the getLowerBound function doesn't exist.

How can I adapt that to be able to zoom into a BarChart using a CategoryAxis as an xAxis?

AbdelKh
  • 499
  • 7
  • 19
  • No time to test, but does `xAxis.getCategories().setAll(someSubsetOfCategories);` work (where `someSubsetOfCategories` is a list containing only some of the categories)? – James_D Jun 13 '17 at 16:04
  • https://stackoverflow.com/questions/16680295/javafx-correct-scaling-> You may be able to try this approach. – SedJ601 Jun 13 '17 at 16:33

0 Answers0