Welcome Guest Search | Active Topics |

Export various charts
nelsonbn
#1 Posted : Tuesday, March 31, 2015 4:23:07 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/4/2014(UTC)
Posts: 6

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Good afternoon... I'm trying to export 2 charts at the same time llike in the code below but I'm only getting the one from the last call made. How can I export several charts at the same time?

obrigado
Code:

$(document).ready(function () {
                $('#jqChart1').jqChart({
                    axes: [
                                            {
                                                type: 'category',
                                                location: 'bottom',
                                            },
                                            {
                                                type: 'linear',
                                                location: 'left',
                                            }
                    ],
                    series: [
                                            {
                                                type: 'line',
                                                strokeStyle: '#f00',
                                                data: [["1", 62], ["B", 60], ["C", 68], ["D", 58], ["E", 52], ["F", 60], ["G", 48]],
                                            }
                    ]
                });
                                $('#jqChart2').jqChart({
                    axes: [
                                            {
                                                type: 'category',
                                                location: 'bottom',
                                            },
                                            {
                                                type: 'linear',
                                                location: 'left',
                                            }
                    ],
                    series: [
                                            {
                                                type: 'line',
                                                strokeStyle: '#0f0',
                                                data: [["1", 62], ["B", 60], ["C", 68], ["D", 58], ["E", 52], ["F", 60], ["G", 48]],
                                            }
                    ]
                });
                
                                $("#btnExport").click(function (){
                                    $('#jqChart1').jqChart('exportToImage', {
                                        fileName: "chart1.png",
                                        type: 'image/png'
                                    });

                                    $('#jqChart2').jqChart('exportToImage', {
                                        fileName: "chart2.png",
                                        type: 'image/png'
                                    });
                                });


Code:

<div id="jqChart1" style="width: 500px; height: 300px;"></div>
        <div id="jqChart2" style="width: 500px; height: 300px;"></div>
        <button id="btnExport">Export</button>
Dragan
#2 Posted : Thursday, April 02, 2015 5:18:00 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Hi,

We're able to reproduce this issue, but unfortunately we're not sure why this is happening. We'll write here if we can answer.
Best Regards,
Dragan Matek
jqChart Inc.
AwakenDeveloper
#3 Posted : Tuesday, September 29, 2015 12:19:18 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/29/2015(UTC)
Posts: 1

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
I am somewhat trying to do the same thing. I have a page that is loading multiple jqChart objects (so it shows multiple charts), and I have 1 export button that, when clicked, I would prefer all those jqChart objects loaded in a single PDF. Is this possible with this plugin? If so, can you post example code please?

Thank you.
Dragan
#4 Posted : Friday, October 02, 2015 9:11:01 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Hi,

Unfortunately, currently you can export only one chart.
Best Regards,
Dragan Matek
jqChart Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.294 seconds.