Reputation: 11124
I have used aChartEngine This is my code for my lineChart
XYSeriesRenderer xyRenderer = (XYSeriesRenderer) renderer.getSeriesRendererAt(0);
XYSeriesRenderer.FillOutsideLine fill; XYSeriesRenderer.FillOutsideLine(XYSeriesRenderer.FillOutsideLine.Type.BOUNDS_BELOW);
fill.setColor(Color.MAGENTA);
xyRenderer.addFillOutsideLine(fill);
The lineChart should colored in magenta for every area that is below the green line. However, as you can see that aChartengine render only the first area. So what have I missed? I also found that when I move the chart (shown in the figure 2) the chart will render only the first area. The figure 3 the chart render 2 areas. the figure 4 show the result of the code below.
fill = new XYSeriesRenderer.FillOutsideLine(XYSeriesRenderer.FillOutsideLine.Type.BOUNDS_ALL);
fill.setColor(Color.MAGENTA);
xyRenderer.addFillOutsideLine(fill);
fill = new XYSeriesRenderer.FillOutsideLine(XYSeriesRenderer.FillOutsideLine.Type.BOUNDS_ABOVE);
fill.setColor(Color.GREEN);
xyRenderer.addFillOutsideLine(fill);
Upvotes: 0
Views: 1251
Reputation: 32391
You should probably use FillOutsideLine.Type.BOUNDS_ALL
instead of FillOutsideLine.Type.BOUNDS_BELOW
.
Upvotes: 0