Open jagarell opened 4 years ago
I am also getting this error. Did you ever find a fix?
same problem here!
You need to measure it by yourself:
chart.measure (View.MeasureSpec.makeMeasureSpec (300, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec (500, View.MeasureSpec.EXACTLY));
chart.layout (0, 0, chart.getMeasuredWidth (), chart.getMeasuredHeight ());
Bitmap chartBitmap = chart.getChartBitmap ();
same problem here!
I have this error: java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:1039) at android.graphics.Bitmap.createBitmap(Bitmap.java:1006) at android.graphics.Bitmap.createBitmap(Bitmap.java:956) at android.graphics.Bitmap.createBitmap(Bitmap.java:917) at com.github.mikephil.charting.charts.Chart.getChartBitmap(Chart.java:1477)