小编Nin*_*nja的帖子

Highcharts根据值动态更改条形颜色

我正在使用json数据创建列类型图.这是我使用ajax调用获取数据并绘制图表的JS函数.

function getChart(){
    var categorySeries = [];
    var dataSeries = [];            
    var url = "CallToControllerURL";

    $.getJSON(url, function(response) {             
        $.each(response, function(i, item) {
            categorySeries .push(response[i].dateVal);                  
            dataSeries.push(response[i].count);             
        });

        $('#chartDiv').highcharts({
            chart : {type : 'column'},
            title : {text : 'Date vs Count'},
            xAxis : {categories : categorySeries, crosshair : true},
            yAxis : {allowDecimals: false, min : 0, title : { text : 'Count'}},
            plotOptions : { column : {  pointPadding : 0.2, borderWidth : 0,    allowPointSelect: true  } },
            series : [ {name …
Run Code Online (Sandbox Code Playgroud)

json highcharts

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

highcharts ×1

json ×1