JFreeChart

来源:百度文库 编辑:神马文学网 时间:2024/04/29 19:10:51
JFreeChart类:void setAntiAlias(boolean flag)    字体模糊边界void setBackgroundImage(Image image)   背景图片void setBackgroundImageAlignment(int alignment)  背景图片对齐方式(参数常量在org.jfree.ui.Align类中定义)void setBackgroundImageAlpha(float alpha)  背景图片透明度(0.0~1.0)void setBackgroundPaint(Paint paint)   背景色void setBorderPaint(Paint paint)   边界线条颜色void setBorderStroke(Stroke stroke)   边界线条笔触void setBorderVisible(boolean visible)   边界线条是否可见-----------------------------------------------------------------------------------------------------------TextTitle类:void setFont(Font font)     标题字体void setPaint(Paint paint)    标题字体颜色void setText(String text)    标题内容-----------------------------------------------------------------------------------------------------------StandardLegend(Legend)类:void setBackgroundPaint(Paint paint)   图示背景色void setTitle(String title)    图示标题内容void setTitleFont(Font font)    图示标题字体void setBoundingBoxArcWidth(int arcWidth)  图示边界圆角宽void setBoundingBoxArcHeight(int arcHeight)  图示边界圆角高void setOutlinePaint(Paint paint)   图示边界线条颜色void setOutlineStroke(Stroke stroke)   图示边界线条笔触void setDisplaySeriesLines(boolean flag)  图示项是否显示横线(折线图有效)void setDisplaySeriesShapes(boolean flag)  图示项是否显示形状(折线图有效)void setItemFont(Font font)    图示项字体void setItemPaint(Paint paint)    图示项字体颜色void setAnchor(int anchor)    图示在图表中的显示位置(参数常量在Legend类中定义)-----------------------------------------------------------------------------------------------------------Axis类:void setVisible(boolean flag)    坐标轴是否可见void setAxisLinePaint(Paint paint)   坐标轴线条颜色(3D轴无效)void setAxisLineStroke(Stroke stroke)   坐标轴线条笔触(3D轴无效)void setAxisLineVisible(boolean visible)  坐标轴线条是否可见(3D轴无效)void setFixedDimension(double dimension)  (用于复合表中对多坐标轴的设置)void setLabel(String label)    坐标轴标题void setLabelFont(Font font)    坐标轴标题字体void setLabelPaint(Paint paint)    坐标轴标题颜色void setLabelAngle(double angle)`   坐标轴标题旋转角度(纵坐标可以旋转)void setTickLabelFont(Font font)   坐标轴标尺值字体void setTickLabelPaint(Paint paint)   坐标轴标尺值颜色void setTickLabelsVisible(boolean flag)   坐标轴标尺值是否显示void setTickMarkPaint(Paint paint)   坐标轴标尺颜色void setTickMarkStroke(Stroke stroke)   坐标轴标尺笔触void setTickMarksVisible(boolean flag)   坐标轴标尺是否显示ValueAxis(Axis)类:void setAutoRange(boolean auto)    自动设置数据轴数据范围void setAutoRangeMinimumSize(double size)  自动设置数据轴数据范围时数据范围的最小跨度void setAutoTickUnitSelection(boolean flag)  数据轴的数据标签是否自动确定(默认为true)void setFixedAutoRange(double length)   数据轴固定数据范围(设置100的话就是显示MAXVALUE到MAXVALUE-100那段数据范围)void setInverted(boolean flag)    数据轴是否反向(默认为false)void setLowerMargin(double margin)   数据轴下(左)边距void setUpperMargin(double margin)   数据轴上(右)边距void setLowerBound(double min)    数据轴上的显示最小值void setUpperBound(double max)    数据轴上的显示最大值void setPositiveArrowVisible(boolean visible)  是否显示正向箭头(3D轴无效)void setNegativeArrowVisible(boolean visible)  是否显示反向箭头(3D轴无效)void setVerticalTickLabels(boolean flag)  数据轴数据标签是否旋转到垂直void setStandardTickUnits(TickUnitSource source) 数据轴的数据标签(可以只显示整数标签,需要将AutoTickUnitSelection设false)NumberAxis(ValueAxis)类:void setAutoRangeIncludesZero(boolean flag)  是否强制在自动选择的数据范围中包含0void setAutoRangeStickyZero(boolean flag)  是否强制在整个数据轴中包含0,即使0不在数据范围中void setNumberFormatOverride(NumberFormat formatter) 数据轴数据标签的显示格式void setTickUnit(NumberTickUnit unit)   数据轴的数据标签(需要将AutoTickUnitSelection设false)DateAxis(ValueAxis)类:void setMaximumDate(Date maximumDate)   日期轴上的最小日期void setMinimumDate(Date minimumDate)   日期轴上的最大日期void setRange(Date lower,Date upper)   日期轴范围void setDateFormatOverride(DateFormat formatter) 日期轴日期标签的显示格式void setTickUnit(DateTickUnit unit)   日期轴的日期标签(需要将AutoTickUnitSelection设false)void setTickMarkPosition(DateTickMarkPosition position) 日期标签位置(参数常量在org.jfree.chart.axis.DateTickMarkPosition类中定义)CategoryAxis(Axis)类:void setCategoryMargin(double margin)   分类轴边距void setLowerMargin(double margin)   分类轴下(左)边距void setUpperMargin(double margin)   分类轴上(右)边距void setVerticalCategoryLabels(boolean flag)  分类轴标题是否旋转到垂直void setMaxCategoryLabelWidthRatio(float ratio)  分类轴分类标签的最大宽度-----------------------------------------------------------------------------------------------------------Plot类:void setBackgroundImage(Image image)   数据区的背景图片void setBackgroundImageAlignment(int alignment)  数据区的背景图片对齐方式(参数常量在org.jfree.ui.Align类中定义)void setBackgroundPaint(Paint paint)   数据区的背景图片背景色void setBackgroundAlpha(float alpha)   数据区的背景透明度(0.0~1.0)void setForegroundAlpha(float alpha)   数据区的前景透明度(0.0~1.0)void setDataAreaRatio(double ratio)   数据区占整个图表区的百分比void setOutLinePaint(Paint paint)   数据区的边界线条颜色void setOutLineStroke(Stroke stroke)   数据区的边界线条笔触void setNoDataMessage(String message)   没有数据时显示的消息void setNoDataMessageFont(Font font)   没有数据时显示的消息字体void setNoDataMessagePaint(Paint paint)   没有数据时显示的消息颜色CategoryPlot(Plot)类:void setDataset(CategoryDataset dataset)  数据区的2维数据表void setColumnRenderingOrder(SortOrder order)  数据分类的排序方式void setAxisOffset(Spacer offset)   坐标轴到数据区的间距void setOrientation(PlotOrientation orientation) 数据区的方向(PlotOrientation.HORIZONTAL或PlotOrientation.VERTICAL)void setDomainAxis(CategoryAxis axis)   数据区的分类轴void setDomainAxisLocation(AxisLocation location) 分类轴的位置(参数常量在org.jfree.chart.axis.AxisLocation类中定义)void setDomainGridlinesVisible(boolean visible)  分类轴网格是否可见void setDomainGridlinePaint(Paint paint)  分类轴网格线条颜色void setDomainGridlineStroke(Stroke stroke)  分类轴网格线条笔触void setRangeAxis(ValueAxis axis)   数据区的数据轴void setRangeAxisLocation(AxisLocation location) 数据轴的位置(参数常量在org.jfree.chart.axis.AxisLocation类中定义)void setRangeGridlinesVisible(boolean visible)  数据轴网格是否可见void setRangeGridlinePaint(Paint paint)   数据轴网格线条颜色void setRangeGridlineStroke(Stroke stroke)  数据轴网格线条笔触void setRenderer(CategoryItemRenderer renderer)  数据区的表示者(详见Renderer组)void addAnnotation(CategoryAnnotation annotation) 给数据区加一个注释void addRangeMarker(Marker marker,Layer layer)  给数据区加一个数值范围区域PiePlot(Plot)类:void setDataset(PieDataset dataset)   数据区的1维数据表void setIgnoreNullValues(boolean flag)   忽略无值的分类void setCircular(boolean flag)    饼图是否一定是正圆void setStartAngle(double angle)   饼图的初始角度void setDirection(Rotation direction)   饼图的旋转方向void setExplodePercent(int section,double percent) 抽取的那块(1维数据表的分类下标)以及抽取出来的距离(0.0~1.0),3D饼图无效void setLabelBackgroundPaint(Paint paint)  分类标签的底色void setLabelFont(Font font)    分类标签的字体void setLabelPaint(Paint paint)    分类标签的字体颜色void setLabelLinkMargin(double margin)   分类标签与图的连接线边距void setLabelLinkPaint(Paint paint)   分类标签与图的连接线颜色void setLabelLinkStroke(Stroke stroke)   分类标签与图的连接线笔触void setLabelOutlinePaint(Paint paint)   分类标签边框颜色void setLabelOutlineStroke(Paint paint)   分类标签边框笔触void setLabelShadowPaint(Paint paint)   分类标签阴影颜色void setMaximumLabelWidth(double width)   分类标签的最大长度(0.0~1.0)void setPieIndex(int index)    饼图的索引(复合饼图中用到)void setSectionOutlinePaint(int section,Paint paint) 指定分类饼的边框颜色void setSectionOutlineStroke(int section,Stroke stroke) 指定分类饼的边框笔触void setSectionPaint(int section,Paint paint)  指定分类饼的颜色void setShadowPaint(Paint paint)   饼图的阴影颜色void setShadowXOffset(double offset)   饼图的阴影相对图的水平偏移void setShadowYOffset(double offset)   饼图的阴影相对图的垂直偏移void setLabelGenerator(PieSectionLabelGenerator generator) 分类标签的格式,设置成null则整个标签包括连接线都不显示void setToolTipGenerator(PieToolTipGenerator generator)  MAP中鼠标移上的显示格式void setURLGenerator(PieURLGenerator generator)   MAP中钻取链接格式PiePlot3D(PiePlot)类:void setDepthFactor(double factor)   3D饼图的Z轴高度(0.0~1.0)MultiplePiePlot(Plot)类:void setLimit(double limit)    每个饼图之间的数据关联(详细比较复杂)void setPieChart(JFreeChart pieChart)   每个饼图的显示方式(见JFreeChart类个PiePlot类)-----------------------------------------------------------------------------------------------------------AbstractRenderer类:void setItemLabelAnchorOffset(double offset)     数据标签的与数据点的偏移void setItemLabelsVisible(boolean visible)     数据标签是否可见void setItemLabelFont(Font font)      数据标签的字体void setItemLabelPaint(Paint paint)      数据标签的字体颜色void setItemLabelPosition(ItemLabelPosition position)    数据标签位置void setPositiveItemLabelPosition(ItemLabelPosition position)   正数标签位置void setNegativeItemLabelPosition(ItemLabelPosition position)   负数标签位置void setOutLinePaint(Paint paint)      图形边框的线条颜色void setOutLineStroke(Stroke stroke)      图形边框的线条笔触void setPaint(Paint paint)       所有分类图形的颜色void setShape(Shape shape)       所有分类图形的形状(如折线图的点)void setStroke(Stroke stroke)       所有分类图形的笔触(如折线图的线)void setSeriesItemLabelsVisible(int series,boolean visible)   指定分类的数据标签是否可见void setSeriesItemLabelFont(int series,Font font)    指定分类的数据标签的字体void setSeriesItemLabelPaint(int series,Paint paint)    指定分类的数据标签的字体颜色void setSeriesItemLabelPosition(int series,ItemLabelPosition position)  数据标签位置void setSeriesPositiveItemLabelPosition(int series,ItemLabelPosition position) 正数标签位置void setSeriesNegativeItemLabelPosition(int series,ItemLabelPosition position) 负数标签位置void setSeriesOutLinePaint(int series,Paint paint)    指定分类的图形边框的线条颜色void setSeriesOutLineStroke(int series,Stroke stroke)    指定分类的图形边框的线条笔触void setSeriesPaint(int series,Paint paint)     指定分类图形的颜色void setSeriesShape(int series,Shape shape)     指定分类图形的形状(如折线图的点)void setSeriesStroke(int series,Stroke stroke)     指定分类图形的笔触(如折线图的线)AbstractCategoryItemRenderer(AbstractRenderer)类:void setLabelGenerator(CategoryLabelGenerator generator)   数据标签的格式void setToolTipGenerator(CategoryToolTipGenerator generator)   MAP中鼠标移上的显示格式void setItemURLGenerator(CategoryURLGenerator generator)   MAP中钻取链接格式void setSeriesLabelGenerator(int series,CategoryLabelGenerator generator) 指定分类的数据标签的格式void setSeriesToolTipGenerator(int series,CategoryToolTipGenerator generator) 指定分类的MAP中鼠标移上的显示格式void setSeriesItemURLGenerator(int series,CategoryURLGenerator generator) 指定分类的MAP中钻取链接格式BarRenderer(AbstractCategoryItemRenderer)类:void setDrawBarOutline(boolean draw)      是否画图形边框void setItemMargin(double percent)      每个BAR之间的间隔void setMaxBarWidth(double percent)      每个BAR的最大宽度void setMinimumBarLength(double min)      最短的BAR长度,避免数值太小而显示不出void setPositiveItemLabelPositionFallback(ItemLabelPosition position)  无法在BAR中显示的正数标签位置void setNegativeItemLabelPositionFallback(ItemLabelPosition position)  无法在BAR中显示的负数标签位置BarRenderer3D(BarRenderer)类:void setWallPaint(Paint paint)    3D坐标轴的墙体颜色StackedBarRenderer(BarRenderer)类:没有特殊的设置StackedBarRenderer3D(BarRenderer3D)类:没有特殊的设置GroupedStackedBarRenderer(StackedBarRenderer)类:void setSeriesToGroupMap(KeyToGroupMap map)  将分类自由的映射成若干个组(KeyToGroupMap.mapKeyToGroup(series,group))LayeredBarRenderer(BarRenderer)类:void setSeriesBarWidth(int series,double width)  设定每个分类的宽度(注意设置不要使某分类被覆盖)WaterfallBarRenderer(BarRenderer)类:void setFirstBarPaint(Paint paint)   第一个柱图的颜色void setLastBarPaint(Paint paint)   最后一个柱图的颜色void setPositiveBarPaint(Paint paint)   正值柱图的颜色void setNegativeBarPaint(Paint paint)   负值柱图的颜色IntervalBarRenderer(BarRenderer)类:需要传IntervalCategoryDataset作为数据源GanttBarRenderer(IntervalBarRenderer)类:void setCompletePaint(Paint paint)   完成进度颜色void setIncompletePaint(Paint paint)   未完成进度颜色void setStartPercent(double percent)   设置进度条在整条中的起始位置(0.0~1.0)void setEndPercent(double percent)   设置进度条在整条中的结束位置(0.0~1.0)StatisticBarRenderer(BarRenderer)类:需要传StatisticCategoryDataset作为数据源LineAndShapeRenderer(AbstractCategoryItemRenderer)类:void setDrawLines(boolean draw)    是否折线的数据点之间用线连void setDrawShapes(boolean draw)   是否折线的数据点根据分类使用不同的形状void setShapesFilled(boolean filled)   所有分类是否填充数据点图形void setSeriesShapesFilled(int series,boolean filled) 指定分类是否填充数据点图形void setUseFillPaintForShapeOutline(boolean use) 指定是否填充数据点的Paint也被用于画数据点形状的边框LevelRenderer(AbstractCategoryItemRenderer)类:void setItemMargin(double percent)   每个分类之间的间隔void setMaxItemWidth(double percent)   每个分类的最大宽度CategoryStepRenderer(AbstractCategoryItemRenderer)类:void setStagger(boolean shouldStagger)   不同分类的图是否交错MinMaxCategoryRenderer(AbstractCategoryItemRenderer)类:void setDrawLines(boolean drawLines)   是否在每个分类线间画连接线void setGroupPaint(Paint groupPaint)   一组图形连接线的颜色void setGroupStroke(Stroke groupStroke)   一组图形连接线的笔触void setMaxIcon(Icon maxIcon)    最大值的ICONvoid setMinIcon(Icon minIcon)    最小值的ICONvoid setObjectIcon(Icon objectIcon)   所有值的ICONAreaRender(AbstractCategoryItemRenderer)类:没有特殊的设置StackedAreaRender(AreaRender)类:没有特殊的设置