JQXChart - how to get image binary (e.g. dataURL) of a chart

Multi tool use
Multi tool use












0















I'm having a JQXChart on a page:



$('#chartContainer').jqxChart(settings);


What I'd like to do is the push this chart - as an image - to the server.
The component supports functionality like export to image:



https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/index.htm#demos/jqxchart/javascript_chart_export_jpeg.htm



But I can't see any possibility to just getting the image, without actually downloading it by a web browser. I have to pass this image to the back-end service.



I saw this kind of functionality in another JS framework:



http://www.jqchart.com/jquery/chart/ChartFeatures/ImageDataURL



Is it possible in jqwidgets? Or... somehow achievable through html5...



Thanks in advance










share|improve this question





























    0















    I'm having a JQXChart on a page:



    $('#chartContainer').jqxChart(settings);


    What I'd like to do is the push this chart - as an image - to the server.
    The component supports functionality like export to image:



    https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/index.htm#demos/jqxchart/javascript_chart_export_jpeg.htm



    But I can't see any possibility to just getting the image, without actually downloading it by a web browser. I have to pass this image to the back-end service.



    I saw this kind of functionality in another JS framework:



    http://www.jqchart.com/jquery/chart/ChartFeatures/ImageDataURL



    Is it possible in jqwidgets? Or... somehow achievable through html5...



    Thanks in advance










    share|improve this question



























      0












      0








      0








      I'm having a JQXChart on a page:



      $('#chartContainer').jqxChart(settings);


      What I'd like to do is the push this chart - as an image - to the server.
      The component supports functionality like export to image:



      https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/index.htm#demos/jqxchart/javascript_chart_export_jpeg.htm



      But I can't see any possibility to just getting the image, without actually downloading it by a web browser. I have to pass this image to the back-end service.



      I saw this kind of functionality in another JS framework:



      http://www.jqchart.com/jquery/chart/ChartFeatures/ImageDataURL



      Is it possible in jqwidgets? Or... somehow achievable through html5...



      Thanks in advance










      share|improve this question
















      I'm having a JQXChart on a page:



      $('#chartContainer').jqxChart(settings);


      What I'd like to do is the push this chart - as an image - to the server.
      The component supports functionality like export to image:



      https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/index.htm#demos/jqxchart/javascript_chart_export_jpeg.htm



      But I can't see any possibility to just getting the image, without actually downloading it by a web browser. I have to pass this image to the back-end service.



      I saw this kind of functionality in another JS framework:



      http://www.jqchart.com/jquery/chart/ChartFeatures/ImageDataURL



      Is it possible in jqwidgets? Or... somehow achievable through html5...



      Thanks in advance







      javascript html5-canvas jqxwidgets






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 2 at 16:13









      Matthijs

      1,1951427




      1,1951427










      asked Jan 2 at 15:57









      CzesiekCzesiek

      11




      11
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Looking at the documentation you linked it seems that the methods to export images support two arguments: fileName and exportServer. The documentation further states:




          If you don't setup your own export server the default server is jqwidgets.com.




          This causes the behavior of creating a download link as you described and can be seen on the example page. But there is no reason you shouldn't be able to use your own server. Since you want to push the image to your backend server anyway, just set up a corresponding route and use it in the method like:



          $('#chartContainer').jqxChart('saveAsJPEG', 'myChart.jpeg', 'http://www.yourserver.com/export')



          See what arrives on the server side and go from there.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54009360%2fjqxchart-how-to-get-image-binary-e-g-dataurl-of-a-chart%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Looking at the documentation you linked it seems that the methods to export images support two arguments: fileName and exportServer. The documentation further states:




            If you don't setup your own export server the default server is jqwidgets.com.




            This causes the behavior of creating a download link as you described and can be seen on the example page. But there is no reason you shouldn't be able to use your own server. Since you want to push the image to your backend server anyway, just set up a corresponding route and use it in the method like:



            $('#chartContainer').jqxChart('saveAsJPEG', 'myChart.jpeg', 'http://www.yourserver.com/export')



            See what arrives on the server side and go from there.






            share|improve this answer




























              0














              Looking at the documentation you linked it seems that the methods to export images support two arguments: fileName and exportServer. The documentation further states:




              If you don't setup your own export server the default server is jqwidgets.com.




              This causes the behavior of creating a download link as you described and can be seen on the example page. But there is no reason you shouldn't be able to use your own server. Since you want to push the image to your backend server anyway, just set up a corresponding route and use it in the method like:



              $('#chartContainer').jqxChart('saveAsJPEG', 'myChart.jpeg', 'http://www.yourserver.com/export')



              See what arrives on the server side and go from there.






              share|improve this answer


























                0












                0








                0







                Looking at the documentation you linked it seems that the methods to export images support two arguments: fileName and exportServer. The documentation further states:




                If you don't setup your own export server the default server is jqwidgets.com.




                This causes the behavior of creating a download link as you described and can be seen on the example page. But there is no reason you shouldn't be able to use your own server. Since you want to push the image to your backend server anyway, just set up a corresponding route and use it in the method like:



                $('#chartContainer').jqxChart('saveAsJPEG', 'myChart.jpeg', 'http://www.yourserver.com/export')



                See what arrives on the server side and go from there.






                share|improve this answer













                Looking at the documentation you linked it seems that the methods to export images support two arguments: fileName and exportServer. The documentation further states:




                If you don't setup your own export server the default server is jqwidgets.com.




                This causes the behavior of creating a download link as you described and can be seen on the example page. But there is no reason you shouldn't be able to use your own server. Since you want to push the image to your backend server anyway, just set up a corresponding route and use it in the method like:



                $('#chartContainer').jqxChart('saveAsJPEG', 'myChart.jpeg', 'http://www.yourserver.com/export')



                See what arrives on the server side and go from there.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 6 at 14:41









                luke-codewalkerluke-codewalker

                17910




                17910
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54009360%2fjqxchart-how-to-get-image-binary-e-g-dataurl-of-a-chart%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    BRo eU,qaJsv,PvRR NSSGC4OyUrur9j96IF lmm
                    8KY NxQvI,V97MaMucX,OiAkNT 5rpnT aAOcp,Bs ZjTpvJXR6 9xzu4jcAn k YuCYb,WTOqfcT06kRgcOi,kRj qaTs8FN

                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas