0

I am attempting to make uniform my barchart which ranges in a wide number of values. I have attempted to adjust the tick and other ranges. Essentially, I would like to increase the increments on the yAxis to fit all the bars proportionately. Any ideas?

Also, I should note that instead of NumberAxis, I get ValueAxis.

Thanks in advance.enter image description here

ClickerTweeker
  • 189
  • 3
  • 8
  • 1
    Not entirely clear what you are asking - are you looking to make the y-axis [log scale](http://stackoverflow.com/questions/10347674/logarithmic-axis-labels-ticks-customization)? – copeg Jul 25 '16 at 19:57
  • Never use 3-d bars. They are useless decorations and make it difficult to see what the actual value is. – FredK Jul 25 '16 at 20:17
  • Thank you for the quick response @copeg. Yes, I would like to make the graph log scale but unfortunately I do not have access to NumberAxis. – ClickerTweeker Jul 25 '16 at 20:28
  • 1
    Your image shows a `NumberAxis`; used `LogAxis` instead; for additional guidance, edit your question to include a [mcve] that shows your current approach. – trashgod Jul 26 '16 at 03:22

1 Answers1

0

So this is how I ended up getting the values to square up including setting the RangeAxis range dynamically. I also removed the 3d elements on suggestion of @FredK. I am using a DefaultCategoryDataSet (plot is a CategoryPlot), so the code below is appropriate for these conditions...

  LogAxis yAxis = new LogAxis("Transaction Time (ms)");

        yAxis.setBase(10);
        plot.setRangeAxis(yAxis);
        yAxis.setTickUnit(new NumberTickUnit(1));
        yAxis.setMinorTickMarksVisible(true);
        yAxis.setAutoRange(true);
        plot.setRangeAxis(yAxis);
        plot.getRangeAxis().setLabelFont(new Font("SansSerif", Font.BOLD, 14));
        plot.getRangeAxis().setTickLabelFont(new Font("SansSerif", Font.BOLD, 12));

        Double maximum = (Double) DatasetUtilities.findMaximumRangeValue(dataset);

        plot.getRangeAxis().setLowerBound(10);
        plot.getRangeAxis().setUpperBound(maximum * 1.6);
ClickerTweeker
  • 189
  • 3
  • 8