You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "jdgme (via GitHub)" <gi...@apache.org> on 2024/07/25 18:08:59 UTC
[I] saveAsImage.formatter [echarts]
jdgme opened a new issue, #20200:
URL: https://github.com/apache/echarts/issues/20200
### What problem does this feature solve?
I have a use case where I need to add elements (text, banners, etc.) to charts when they are downloaded, but these additional elements should not be included in the display of the charts in the browser. I prefer to still have the ability to utilize toolbox's saveAsImage to trigger this enhanced chart downloading, especially since taking getDataURL() or getConnectedDataURL() from the rendered chart in the page does not implement _saveAsImage.excludeComponents_. Towards this end, I recomment creating a saveAsImage function parameter (similar to tooltip.formatter) which the developer can set to further manipulate the saveAsImage prior to it being sent to the browser for download. "formatter" may not be the best name for this parameter as it might be misleading for those who think only of formatting text, but I leave that to the developers/community. Implementation should be rather straight forward as it just requires passing the current saveAsImage result to saveAsImage.formatter and
exporting the result of that formatter instead of the current saveAsImage if the formatter is defined.
Additionally, I recommend/request implementation of #18121 so saveImageAs can be triggered outside of the echart itself.
### What does the proposed API look like?
## Setting in Options
```
option = {
toolbox: {
feature: {
saveAsImage: {
formatter: function (params) {
return this.myChartFormatFunction(params);
},
},
}
}
};
```
## Documentation
### saveAsImage.formatter
Function
The optional formatter of the saveAsImage output which supports a callback function.
#### Callback function
```
(params: any) => HTMLCanvasElement
```
The first parameter _params_ is the data that the formatter needs. Its format is shown as follows:
```
{
// Canvas image generated by saveAsImage
canvas: HTMLCanvasElement,
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Feature] saveAsImage.formatter [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #20200:
URL: https://github.com/apache/echarts/issues/20200#issuecomment-5136438521
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Feature] saveAsImage.formatter [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #20200: [Feature] saveAsImage.formatter
URL: https://github.com/apache/echarts/issues/20200
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Feature] saveAsImage.formatter [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #20200:
URL: https://github.com/apache/echarts/issues/20200#issuecomment-5209857719
This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org