---
title: "jfreechart在柱子上面显示数据"
author: "xiajava2011"
date: "2011-08-31T09:56:08Z"
tags: []
categories: ["开源软件"]
slug: "jfreechart"
draft: false
lastmod: "2011-08-31T09:56:08Z"
id: 1162085
url: "https://xiajava2011.iteye.com/blog/1162085"
---

JFreeChart chart = ChartFactory.createBarChart3D("物业报修统计123","","",dataset,PlotOrientation.VERTICAL,true,true,    false);  
chart.setTitle(new TextTitle(title, new Font("宋体", Font.ITALIC, 22)));  
                 
CategoryPlot plot = chart.getCategoryPlot();//设置图的高级属性  
BarRenderer3D renderer = new BarRenderer3D();//3D属性修改  
                 
//最后还得将renderer 放到plot 中  
                 
renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());  
renderer.setItemLabelFont(new Font( "黑体 ",Font.PLAIN,12));  
renderer.setItemLabelsVisible(true);

renderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.CENTER\_LEFT));

plot.setRenderer(renderer);//渲染