如何显示从XML URL到将显示在Highcharts列上的Javascript变量的数据?

时间:2019-02-01 06:12:08

标签: javascript highcharts

我是C#Web编程的新手,我希望将MySQL Server到Javascript变量的数据显示在我的Highchart列中。无论如何,有什么可以将我的结果从Mysql显示到Highchart Column的javascript中?

line 2738-2802

<script type="text/javascript">


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


    document.addEventListener(function () {
        var requestData = $("ORT").val();
        var resultElemet = $('#testin');
        $.ajax({
            url: 'http://localhost:37590/Get_OGSData',
            method: 'get',
            data: { q: requestData },
            dataType: 'json',
            success: function (data) {
                resultElement.html(data.SampleModel[0].main);
            }
        });
    });

    var myChart = Highcharts.chart('testing123', {


chart: {
    type: 'bar',

},
title: {
    text: 'Stacked column chart'
},
xAxis: {
    categories: ['1401-1402', '2015-2016', '2016-2017', '2017-2018', '2018-2019']
},
yAxis: {
    min: 0,
    title: {
        text: 'Total fruit consumption'
    }
},
tooltip: {
    pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>',
    shared: true
},
plotOptions: {
    column: {
        stacking: 'normal'
    }
},
series: [{
    name: 'BCT',
    data: [{
        id: 'testin',
    y:
    }, 3, 4, 7, 2]
}, {
    name: 'SHS',
    data: [2, 2, 3, 2, 1]
}, {
    name: 'PBCT',
    data: [3, 4, 4, 2, 5]
}]
});
})

对于如何在javascript中将XML数据显示为变量,我仍然感到困惑。

XML文件和XML数据也有什么区别吗?

0 个答案:

没有答案