Comments (4)
Hey @markus-renezeder,
My suspicion would be your application not being able to download chromium, which is the default behavior when you do not set a path to a local chromium executable. Chromium is needed for static image export, but not for html export, which further supports this suspicion. See for example #295 on how to point your application to a local chromium executable.
from plotly.net.
Also note that if you just want to display your chart in your webpage, there is no need to convert it to an image. Here is an example on how to embed the chart directly into the page: https://github.com/kMutagene/Plotly.NET.BlazorSample/tree/main/PlotlyBlazorTest
from plotly.net.
Hi @kMutagene ,
thank you for your answer. I've got it running by setting the chromium executable. This works on my local dev machine.
But I'm wondering how to use this function if I host the Blazor application in a docker container or on a web server. In this case mabe I don't have a local chromium installation.
Is there a possibility to use the .SaveJPG method without the need of a local installed application (maybe a rendere which can be installed using nuget)?
The reason why I need to export it to an image is that I want to provide an API which creates the image. This image should be displayed in different documents like HML-Page, PDF ...
from plotly.net.
I think your best bet is shipping the needed binaries bundled with your application. For a docker container that could either involve a custom image that contains the binaries, or using a base image that has chromium pre-installed. If you just deploy the application itself, maybe bundling the necessary binaries into the publish output will work.
However, you will currently not get around needing chromium for this though. Plotly.NET creates chart objects that can be rendered by plotly.js - which needs a JS runtime to work. There are other ways we could do this, see e.g. #393 or #422 . I think playwright-dotnet is packaging the browser binaries in it's nuget package, so it seems to be possible doing it like that - but both these approaches are not implemented. The only reference implementation for static image export currently available in Plotly.NET.ImageExport
uses PuppeteerSharp which either downloads the latest chromium or needs a local installation.
from plotly.net.
Related Issues (20)
- How to create polar plots with Csharp HOT 3
- Suggestion: Documentation / Examples / Extensions for working with DataFrame objects HOT 1
- Exception when using .NET Polyglot Notebook due to strong naming HOT 3
- Add `WithTraceStyle` extension member to Plotly.NET.CSharp
- load a custom font from file (ttf, woff, ...others) HOT 9
- With lastest plotly.net version (4.2), when plotting a Bubble3D chart ( or Scatter3D), x/y axis cannot be renamed HOT 4
- Unable to change the legend font size when global font size is defined in layout HOT 1
- plotly.js v2.28.0 compatibility needs huge rework of core API HOT 1
- Rework docs to use polyglot notebooks HOT 5
- Pie Chart's background doesnt change HOT 7
- No way to add guidelines (plotly.js has them) HOT 3
- Update documentation to dotnet interactive to 4.2.1 HOT 1
- `StyleParam.HoverInfo` is missing enum bindings
- Charts marked as `Responsive = true` are not responsive HOT 9
- Annotation not showing in C# HOT 2
- LinearAxis CategoryOrder not working as expected HOT 3
- Giraffe.ViewEngine.StrongName breaks compatability with Giraffe server HOT 2
- Text "newline" not working (c#) HOT 8
- Legend option missing in Layout.init in release 5.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plotly.net.