Fill LineChart sometimes not working
With last version 2.0.8 sometimes the chart is not filled. When I revert back to 2.0.7 it works again.
set1.setDrawFilled(true); set1.setFillColor(getResources().getColor(R.color.red_down)); mChart.setData(data) mChart.invalidate();
regards
Could you describe the situation in more detail? Which setup (which data) causes the chart not to be filled correctly? Could you provide a screenshot of what it looks like?
Data is coming from a financial api so it's changing quite a bit.... some charts are just fine but others are not filled (I haven't been able to find a pattern). I attach a screenshot with v2.0.7 and v2.0.8 on the same chart:


If you have any ideas of how can I help, please let me know.
Okay so the whole area is simply not filled. That is quite weird. How many values are you plotting?
If the issue occurs, could you tell me if you can find the following warning message in your logcat: "Path too large to be rendered into a texture"
Thank you!
Yes I'm getting that error in logcat.
491 values -> not working 515 values -> not working 1545 values -> not working 128 values ->working 261 values ->working 781 values -> working, strange??
may be you can debug the view which can not be working well using your data, and this way may solve this problem fast.
Alright. Does the issue occur instantly, or only when zooming in?
Could you try the latest commit and see if you are still having the issue?
Hi phil, just checked with last commit and it worked fine!
Thanks
Good to know, I thought I might have fixed it!
I am still having this exact issue, it was working in 2.0.7, just updated my gradle build to 2.0.8 today and got the irregular fill behavior:
These are two diff charts with fill working and not working:

LineDataSet priceData = new LineDataSet(yVal, "Price");
priceData.setLineWidth(2f);
priceData.setDrawFilled(true);
priceData.setColor(getResources().getColor(R.color.positive_green_line));
priceData.setFillColor(getResources().getColor(R.color.positive_green_fill));
priceData.setDrawCircles(false);
priceData.setDrawValues(false);
ArrayList<LineDataSet> dataSets = new ArrayList<>();
dataSets.add(priceData);
LineData data = new LineData(xVal, dataSets);
lineChart.getAxisLeft().setStartAtZero(false);
lineChart.setData(data);

LineDataSet sentimentData = new LineDataSet(yVal, "Sentiment");
sentimentData.setLineWidth(0f);
sentimentData.setDrawFilled(true);
sentimentData.setFillColor(getResources().getColor(R.color.stock_up_green));
sentimentData.setColor(getResources().getColor(R.color.stock_up_green));
sentimentData.setDrawCircles(false);
sentimentData.setDrawValues(false);
ArrayList<LineDataSet> dataSets = new ArrayList<>();
dataSets.add(sentimentData);
LineData data = new LineData(xVal, dataSets);
lineChart.getAxisLeft().setAxisMaxValue(100);
lineChart.setData(data);
Have you tried the latest commit? There is no release-version with this fix yet!
This bug is back in the main branch.
Had to change: c.drawPath(cubicPath, mRenderPaint); to: mBitmapCanvas.drawPath(cubicPath, mRenderPaint);
regards
Just upgraded to 2.1.0 and am still experiencing this bug
I am facing this issue too, with version 2.1.0. The chart is correctly filled when first drawn, but when I start to zoom, it is no longer filled and I only have the line.
As asked in a previous comment, I do have the following in my log:
Path too large to be rendered into a texture
Any idea @PhilJay ?
I can see in logs (2.1.0): "Shape too large to be rendered into a texture"
Are you all using cubic lines?
I'm not (I am using the default configuration).
But if I call lineDataSet.setDrawCubic(true), then the chart is filled even when zoomed/dragged.
@PhilJay If I use cubic I agree, that it's working fine.
Okay good then I can narrow down the issue to normal (straight) lines, I will have a look at it.
If the chart dimension is large (200dp x 200dp) then all line charts (normal, straight lines) fail (instantly) to fill the area. If the chart dimension is small (40dp x 100dp) then some will fail and some will work. I got the same result every time.