Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter goderzy

    (@goderzy)

    Hello Martynasma.
    Here is what I tried to get to work, but unfortunately did not get the result.
    xy multiaxis chart:
    html
    <div id=”$CHART$” style=”width: 100%; height: 500px;”></div>

    <script src=”/resources/dataloader/dataloader.min.js”></script>
    js
    var chart = AmCharts.makeChart(“$CHART$”, {
    “type”: “xy”,
    },

    “dataLoader”: {
    “url”: “data/data1.json”,
    “showErrors”: true,
    “complete”: function ( chart ) {
    console.log( “Loading complete” );
    },
    “load”: function ( options, chart ) {
    console.log( “File loaded: “, options.url );
    },
    “error”: function ( options, chart ) {
    console.log( “Error occured loading file: “, options.url );
    },
    “reload”: 120,
    “async”: true
    },

    });

    function reloadData() {
    chart.dataLoader.loadData();
    chart.validateData();
    }
    serial chart:
    html
    <div id=”chartdiv” style=”width: 100%; height: 500px;”></div>

    <script src=”/resources/dataloader/dataloader.min.js”></script>

    <input type=”button” value=”New Data” onclick=”reloadData();” />
    js
    var chart = AmCharts.makeChart(“chartdiv”, {
    “type”: “serial”,

    “dateFormat”: “DD-MM-YYYY HH:NN”,

    “dataLoader”: {
    … as first chart …
    },

    });

    function reloadData() {
    chart.dataLoader.loadData();
    chart.validateData();
    };

    chart.addListener(“dataUpdated”, zoomChart);
    zoomChart();
    function zoomChart(){
    chart.zoomToIndexes(chart.dataProvider.length – 20, chart.dataProvider.length – 1);
    }
    pie 3d chart
    html
    <div id=”$CHART$” style=”width: 100%; height: 500px;”></div>

    <script src=”/resources/dataloader/dataloader.min.js”></script>
    js
    var chart = AmCharts.makeChart(“$CHART$”, {
    “type”: “pie”,
    “theme”: “light”,

    “dataLoader”: {
    … as before …
    },

    “valueField”: “value”,
    “titleField”: “country”,
    “pulledField”: “pulled”,
    “outlineAlpha”: 0.4,
    “depth3D”: 15,
    “balloonText”: “title<br><span style=’font-size:14px’><b>value</b> (percents%)</span>”,
    “angle”: 45,
    “export”: {
    “enabled”: true
    }
    } );
    function reloadData() {
    chart.dataLoader.loadData();
    chart.validateData();
    };
    The last thing used for upload charts is this function
    function reloadData() {
    var NewChartData = [];
    NewChartData = chart.dataLoader.loadData();
    NewChartData.push(JSON.parse());
    chart.dataProvider = NewChartData;
    chart.validateData();
    };
    Is also loaded from the. json file and from the. php file (more precisely from the buffer), but only once when opened from the WordPress Admin panel.
    Automatically and when you click on the button they still do not update, ie shudder, but do not change. The data differs only by values, even the file size is identical.
    I need another type of chart to do, which in the examples are not, but since these are not updated, did not go further.
    Thank you for responding to my problem and offering help.

    Thread Starter goderzy

    (@goderzy)

    At this point, using the graphics function
    function reloadData() {
    var NewChartData = [];
    NewChartData = chart.dataLoader.loadData();
    NewChartData.push(JSON.parse());
    chart.dataProvider = NewChartData;
    chart.validateData();
    };
    is also loaded from the. json file and from the. php file, but only once when opened from the WordPress Admin panel.
    Automatically and when you click on the button they still do not update, ie shudder, but do not change. The data differs only by values, even the file size is identical. May be in the plugin the ability to update data is blocked. Sorry, but probably have to give up the plugin Amcharts.
    Good luck friends.

Viewing 2 replies - 1 through 2 (of 2 total)