日期:2014-05-20  浏览次数:20932 次

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));