Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving config used on a view chart #59

Closed
jhallam3 opened this issue Oct 14, 2016 · 3 comments
Closed

Saving config used on a view chart #59

jhallam3 opened this issue Oct 14, 2016 · 3 comments
Labels

Comments

@jhallam3
Copy link

jhallam3 commented Oct 14, 2016

Hi.

I have the config now saving to a database. the example string is
"{"chart":{"type":"area"},"xAxis":[{"type":"category"}],"yAxis":[{}],"plotOptions":{"series":{"dataLabels":{"enabled":true},"marker":{"enabled":false}}},"title":{"text":"sdfsdfsd"}}"

When I then use this script it doesn't show the title for example or change it to an area graph.

<!!!!!!!!!script>

var cd ;

document.addEventListener("DOMContentLoaded", function () {

    var configdata = @Html.Raw(@configedchart);


    var chart = new ec({
        element     : document.getElementById('container'),
        dataUrl     : '/chart/?QueryData=@chart2.SQLDataID&Queue=@chart2.QueueID',
       config      : configdata,
        dataTab     : false,
        templatesTab: false,
        customiseTab: false,
        UIMode: 'viewer'

    });
    cd = configdata;
    chart.setConfig(configdata);

});

<!!!!!!!!!/script>

Any suggestions? Thanks

@daemth
Copy link
Owner

daemth commented Oct 14, 2016

configData needs to be in JSON-format, not stringified, so I guess you need to do something like:

var configdata = JSON.parse(@Html.Raw(@configedchart));

and it should work.

It's also better for you to download the latest version of the code as the option UIMode didn't make it to production, its name changed to chartTab (see #57).

@daemth
Copy link
Owner

daemth commented Oct 14, 2016

schermafdruk 2016-10-14 11 16 19

@jhallam3
Copy link
Author

thats fixed it.

Thanks for the help!

Outstanding software. Keep up the good work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants