I found a bug on a histogram plot. Whenever the range on bottom axis is changed manually, the entire histogram bars are shifted and misaligned with marks any longer.
In the following run as-is example, I set min and max value for the bottom axis. Then I see two problems/bugs.
1. Bars are shifted to left. eg. The x value for the 1st bar from left to right should be 10, but it looks like 0 on the chart. (BTW, marks are rendered correctly, though) That is, bars should be rendered correctly, aligned with its corresponding marks.
2. Always, the last bar width is way wider than the other bars.
I would appreciate if you can tell me how to fix them or if there is any workaround to resolve these issues.
Code: Select all
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.setSize(600, 600);
TChart chart = new TChart();
panel.add(chart);
Bar b = new Bar(chart.getChart());
b.add(10.0, 10.0);
b.add(20.0, 20.0);
b.add(30.0, 30.0);
b.add(40.0, 40.0);
b.add(50.0, 50.0);
b.setMultiBar(MultiBars.STACKED);
b.setBarWidthPercent(100);
b.getMarks().setVisible(true);
chart.getAxes().getBottom().getLabels().setStyle(AxisLabelStyle.VALUE);
chart.getAxes().getBottom().setAutomatic(false);
chart.getAxes().getBottom().setMinMax(-10, 150);
//set 2D
chart.getAspect().setView3D(false);
frame.add(panel);
frame.setSize(600, 600);
frame.setVisible(true);
}