Suggestion T5311
Visible to All Users

Analytics | Angular | download plot as a PNG with user given filename

created 4 years ago

Hi Team,

I need to put filename before saving the chart.
Can I get the event on "download plot as a PNG" icon click?

Thanks!

Comments (1)

    Hello,

    We're using 3rd party library for charting (Plotly - https://plotly.com/javascript/)..) If this library provide this functionality we can do it also on our side. We'll check it and update this thread.

    Thanks, Serge
    SurveyJS Team

    Answers approved by surveyjs Support

    created 4 years ago

    Hello,

    I've implemented this functionality via the https://github.com/surveyjs/survey-analytics/commit/7c65068eb115cd301da3497e5b55c17edb0be23f commit.

    Now one can use the following event to set export parameters:

    JavaScript
    SurveyAnalytics.PlotlySetup.onImageSaving.add(function(selectBaseVisualizer, options) { options.filename = "Exported " + selectBaseVisualizer.question.name; });

    Available options are described here - https://plotly.com/javascript/plotlyjs-function-reference/#plotlydownloadimage

    Thanks, Serge
    SurveyJS Team