Skip to content
Snippets Groups Projects
Commit 329f626b authored by Tim Molter's avatar Tim Molter
Browse files

enhancement for short charts - more ticks on y axis

parent 40fe91c7
Branches
No related tags found
No related merge requests found
......@@ -122,7 +122,7 @@ public class XChartDemo extends JPanel implements TreeSelectionListener {
category = new DefaultMutableTreeNode("Line Charts");
top.add(category);
chart = new DefaultMutableTreeNode(new ChartInfo("Example10 - Scientific notation formatting", new Example10().getChart()));
chart = new DefaultMutableTreeNode(new ChartInfo("Example10 - Manual Data", new Example10().getChart()));
category.add(chart);
chart = new DefaultMutableTreeNode(new ChartInfo("Example2 - Customized series style", new Example2().getChart()));
......
......@@ -188,6 +188,10 @@ public class AxisTick implements IChartPart, IHideable {
// System.out.println(axis.min);
// System.out.println(length);
int tickMarkSpaceHint = (axis.direction == Direction.X ? DEFAULT_TICK_MARK_STEP_HINT_X : DEFAULT_TICK_MARK_STEP_HINT_Y);
// for very short plots, squeeze some more ticks in than normal
if (axis.direction == Direction.Y && tickSpace < 160) {
tickMarkSpaceHint = 25;
}
double gridStepHint = length / tickSpace * tickMarkSpaceHint;
// gridStepHint --> mantissa * 10 ** exponent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment