读书人

jfreeChart怎么设置折线图中折点数据的

发布时间: 2012-03-30 17:32:09 作者: rapoo

jfreeChart如何设置折线图中折点数据的格式?
jfreeChart如何设置折线图中折点数据的格式?
例如让它显示百分数

[解决办法]
DefaultCategoryDataset dataset = new DefaultCategoryDataset();

JFreeChart chart = ChartFactory.createLineChart(
CommonDefine.CUSTOMERTRENDGRAM, "时间", "数量", dataset,
PlotOrientation.VERTICAL, true, false, false);

chart.getTitle().setFont(new Font("黑体", Font.BOLD, 22));
CategoryPlot plot = (CategoryPlot) chart.getPlot();
CategoryAxis xaxis = plot.getDomainAxis();
xaxis.setLabelFont(new Font("宋体", Font.PLAIN, 14));
xaxis.setTickLabelFont(new Font("宋体", Font.PLAIN, 12));

读书人网 >J2SE开发

热点推荐