在條形圖中,數據在運行時是動態的。我的問題是 -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