MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Generate Bitmap without rendering a chart view

Open adrianwg23 opened this issue 7 years ago • 1 comments

Is there anyway I can generate a Bitmap from a LineChart without the LineChart actually being rendered onto the UI? I'm trying to instantiate a new LineChart object programatically in a background service and generate a Bitmap from that LineChart. However, since the LineChart isn't actually being rendered or added to any Activity/Fragment, calling getChartBitmap() fails since it requires the LineChart to have a height and width, which is only determined once the view is rendered.

Basically, I don't need the Chart to be rendered onto the screen or anything. I just need a Bitmap object of the chart. Is this possible?

adrianwg23 avatar Nov 28 '18 20:11 adrianwg23

Has anyone figured out how to do this?

EvanKardos42 avatar Sep 14 '23 00:09 EvanKardos42