I’ve created a chart using pygwalker in a Jupyter Notebook:
...
visuals = pyg.walk(df, spec='pygwalker_spec_123456789.json')
visuals.chart_list
Output: ['Chart 1']
What I would like to do is save this predefined "Chart 1" as a PNG file in a Spyder script. Something like this:
visuals = pyg.walk(df, spec='pygwalker_spec_123456789.json')
visuals.save_chart_to_file('Chart 1', "chart_1.png")
But I get the following error:
ValueError: chart_name: Chart 1 not found, please confirm whether to save
When I check visuals.chart_list
, it returns an empty list []
, even though the 'pygwalker_spec_123456789.json'
file contains "Chart 1".
The reason I want to save the PNG via Spyder is to automate the entire process in a script so that my stakeholders receive all the PNG files automatically, without needing me to run the Jupyter notebook first.
Can anyone help me identify the error? Thank you!
pygwalker version 0.4.9.13