How show less values in the X-axis in line chart (JFreechart)?

孤人 提交于 2019-12-11 23:10:12

问题


How can I do in order to show less values ​​on the X axis, to get the data organized?

However I want the values ​​are all shown. One idea I had was to use the zoom so you can see all the records, but do not know if it was a good idea, or rather do not even know it.

As you can see in the picture my idea is that data more legible, in order to realize the best of everything.

Does anyone can help me please?

//Code with result from query and chart create

String query="select (CONCAT(`date`, ' ', hour)),  temperature from records where idTermomether like 'T1' and date between '2014-06-01' and '2014-06-03'";
            JDBCCategoryDataset dataset = new JDBCCategoryDataset (CriaConexao.getConexao(),query);
            JFreeChart chart = ChartFactory.createLineChart(" - Temperature", "Date", "Temperature", dataset, PlotOrientation.VERTICAL, false, true, true);
            BarRenderer renderer = null;
            CategoryPlot plot= chart.getCategoryPlot();
            CategoryAxis xAxis=(CategoryAxis)plot.getDomainAxis();
            xAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90);
            renderer=new BarRenderer();
            ChartFrame frame = new ChartFrame("Temperature", chart);
            frame.setVisible(true);
            frame.setSize(400,650);

来源:https://stackoverflow.com/questions/24329963/how-show-less-values-in-the-x-axis-in-line-chart-jfreechart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!