Histogram
Posted: Thu Mar 19, 2009 10:07 pm
When I create a histogram, the axis is set to the bottom of the smallest bar by default. This makes one of the bins look like it has a zero count. What am I doing wrong?
Code: Select all
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.steema.teechart.TChart;
import com.steema.teechart.styles.Histogram;
public class ChartTest {
public static void main(String[] args) {
JFrame frame = new JFrame();
ChartTest c = new ChartTest();
JPanel panel = new JPanel();
TChart chart = new TChart();
panel.add(chart);
frame.add(panel);
Histogram h = new Histogram();
h.add(1,10);
h.add(2,20);
h.add(3,5);
h.add(4,25);
h.add(5,15);
h.setChart(chart.getChart());
chart.getAspect().setView3D(false);
chart.getAspect().setSmoothingMode(false);
frame.pack();
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}