为此,您可以在config对象中设置toImageButtonOptions属性,正如我们在下面的代码片段中演示的:var config = { toImageButtonOptions: { format: 'jpeg', // one of png, svg, jpeg, webp filename: 'my_image', // the name of the file height: 600, width: 700, } } 最后,在下一节中,我们将演示...
);//use the dataUrlPlotly.toImage(graphDiv, { format:"png", width:800, height:600}).then(function(dataUrl) { document.getElementById("graphImg").setAttribute("src", dataUrl); });//下载图表Plotly.downloadImage(graphDiv, { format:"png", width:800, height:600, filename:"newplot"})...
Added only two configs to the ModeBar config={{ displayModeBar: true, toImageButtonOptions: { filename: "something", }, }} It doesn't always happen but time to time, by clicking one of the options from the ModeBar, it still does the job without crashing the app but in console, it ...
I haven't modified much on this ModeBar (image below) Added only two configs to the ModeBar config={{ displayModeBar: true, toImageButtonOptions: { filename: "something", }, }} It doesn't always happen but time to time, by clicking one of the options from the ModeBar, it still does...
https://plot.ly/javascript/configuration-options https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L22-L86 但是,对于“toImage”按钮(标记为“下载 png 格式的绘图”),我似乎无法配置图像文件的名称。它总是被称为“newplot.png”,但我想给它一个不同的名称。有什么选择吗?
- toImageButtonOptions (dict; optional): Modifications to how the toImage modebar button works. toImageButtonOptions has the following type: dict containing keys 'format', 'filename', 'width', 'height', 'scale'. Those keys have the following types: ...
Add clustering options to scattermapbox [#5827], with thanks to @elben10 for the contribution! Add bounds to mapbox suplots [6339] [2.15.1] -- 2022-10-11 Fixed Fix latest version of plotly.js main module on npm [2.15.0] -- 2022-10-06 Added Add angle, angleref and standoff ...
plotly/plotly.jsPublic Sponsor NotificationsYou must be signed in to change notification settings Fork1.9k Star17.5k Code Issues651 Pull requests46 Actions Security Insights Additional navigation options