在条形图中,数据在运行时是动态的。我的问题是 -JFree条形图 - 条宽?
- 如果数据集是大图得到缩小,它不清晰可见。
如果数据集的数据数量少(记录集数量少),那么图表的条宽很大。我如何控制它?
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; }
是否有办法来调整在BARCHART条的宽度。
解决 Width of the bar in Jfreechart
我们现在知道,您正在一个不可访问的MySQL数据库中从名为'test'的未知关系中选择两个(可能是)数字属性。第一条评论中的要求仍不清楚? – trashgod 2012-01-17 15:51:17
如果此查询返回大量记录,则图表不能清楚地显示或返回少量记录,图表会显示大号栏。 – Mukthi 2012-01-18 04:03:47