JFreechart,与填充的区域的线形图 [英] JFreechart, Line Chart with filled Areas
问题描述
我正在尝试创建如下图表:
I am trying to create chart like below:
虽然我几乎通过简单地创建一个折线图和为Renderer自定义形状/油漆实现了一切,我似乎找不到一种填充系列线下方区域的方法。
While I've almost achieved everything by simply creating a line chart and customizing shape/paint for Renderer, I can't seem to find a way to fill the areas under the series line.
任何线索,我该如何做?
Any clues, how can I do this?
推荐答案
可以使用 <$ c创建图表$ c> StackedXYAreaRenderer 。在构造函数中指定 AREA_AND_SHAPES
并启用轮廓。请参阅 ChartFactory 代码.html#line.1846rel =nofollow> createStackedXYAreaChart()
为例。
You could create your chart with a StackedXYAreaRenderer
. Specify AREA_AND_SHAPES
in the constructor and enable outlines. See the ChartFactory
code for createStackedXYAreaChart()
as an example.
StackedXYAreaRenderer r = new StackedXYAreaRenderer(XYAreaRenderer.AREA_AND_SHAPES);
r.setOutline(true);
给定渲染器,您可以根据需要设置大纲绘制和描边。
Given a renderer, you can set the outline paint and stroke as desired.
这篇关于JFreechart,与填充的区域的线形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!