Closed centa-furqan closed 9 months ago
@victordibia can you have a look into this :)
Hi @centa-furqan ,
The ChartExecutor response is a text based representation to make serialization straightforward (send results over a web api). The raster field is a base64 encoded string.
You can convert it to an image and save as follows:
import base64
with open("chartn.png", "wb") as fh:
fh.write(base64.decodebytes(charts[0].raster.encode()))
Overall, thanks for pointing this out. I'll add a savefig method to the ChartExecutor object.
Hi,
I want to convert the graph into the matplotlib graph format or save the graph into the image, How can I achieve this because the current visualization function is not returning enough information to do so. Getting error while accessing the graph via rasterio. i.e. TypeError: Image data of dtype <U44560 cannot be converted to float
Another error that I got while plotting charts[0] is :- AttributeError: 'ChartExecutorResponse' object has no attribute 'savefig'![image](https://github.com/microsoft/lida/assets/141156624/48e70461-78d4-4317-bc30-07600e19849d)