In bar chart, the data is dynamic from DB at run time. My problem is that-
- If data set is large chart get shrink ed, it's not clearly visible .
If data set having less number of data's(less no. of record sets) then the chart's bars width are big. How can I control it?
chartPanel = new ChartPanel(test()); jPanel1.add(chartPanel, BorderLayout.CENTER); public static JFreeChart test() { String query = "SELECT num1,num2 from test1 ; JFreeChart cha; try { JDBCCategoryDataset dataset = new JDBCCategoryDataset("jdbc:mysql://localhost:3306/db", "com.mysql.jdbc.Driver", "root", ""); dataset.executeQuery(query); cha = ChartFactory.createBarChart3D("xxxx", "xxx", "xxx", dataset, PlotOrientation.VERTICAL, true, true, false); } catch (Exception e) { System.out.println(e); } return cha; }
Is there a way to adjust the width of the bars in a Barchart.