You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
is there an easy way to export a plotted chart directly from code as PNG or SVG?
I tried it using the ".toChartImage" function from the api but didn't find a working solution yet.
To export charts created with Plotly.NET directly as an image file, you need some kind of headless browser to do the javascript execution to render the chart first. There is a package out there using Pupeteer for that which might work for you, check #21 for that. However, there is an in-house solution by plotly which we still need to wrap for .NET use - It is on the roadmap but not quite here yet.
I'm having problems getting the function to work in C#. SaveJPG seems to be unknown while I'm using Preview 6. But I already made my own workaround with Pupperteer as you mentioned in #21 and #65 .
Thanks for checking it out, i will test this in C# now to see if there's an issue.
Just to be clear, Plotly.NET.ImageExport is a separate nuget package: https://www.nuget.org/packages/Plotly.NET.ImageExport/. Maybe i should add this to the docs. If you want access to .SaveJP you also have to open the GenericChartExtensions namespace.
But if you have an approach that works for you already, thats just as fine.
Thanks for checking it out, i will test this in C# now to see if there's an issue.
Just to be clear, Plotly.NET.ImageExport is a separate nuget package: https://www.nuget.org/packages/Plotly.NET.ImageExport/. Maybe i should add this to the docs. If you want access to .SaveJP you also have to open the GenericChartExtensions namespace.
But if you have an approach that works for you already, thats just as fine.
Thanks for that. I thought it was inside the same package. X)
It's working now. But I have to fix authorization problems with my proxy.
Activity
kMutagene commentedon Jun 24, 2021
To export charts created with Plotly.NET directly as an image file, you need some kind of headless browser to do the javascript execution to render the chart first. There is a package out there using Pupeteer for that which might work for you, check #21 for that. However, there is an in-house solution by plotly which we still need to wrap for .NET use - It is on the roadmap but not quite here yet.
Related/possible duplicates: #21 and #65.
LucasNmn commentedon Jun 24, 2021
Thanks for your advice,
I will test that.
kMutagene commentedon Jul 12, 2021
closed via #94. @LucasNmn if you have time and interest you might check out the docs for the new
Plotly.NET.ImageExportpackage here.LucasNmn commentedon Jul 12, 2021
I'm having problems getting the function to work in C#. SaveJPG seems to be unknown while I'm using Preview 6. But I already made my own workaround with Pupperteer as you mentioned in #21 and #65 .
kMutagene commentedon Jul 12, 2021
Thanks for checking it out, i will test this in C# now to see if there's an issue.
Just to be clear,
Plotly.NET.ImageExportis a separate nuget package: https://www.nuget.org/packages/Plotly.NET.ImageExport/. Maybe i should add this to the docs. If you want access to.SaveJPyou also have to open theGenericChartExtensionsnamespace.But if you have an approach that works for you already, thats just as fine.
LucasNmn commentedon Jul 12, 2021
Thanks for that. I thought it was inside the same package. X)
It's working now. But I have to fix authorization problems with my proxy.