Highcharts系列未加载

时间:2019-01-08 18:43:07

标签: highcharts

高图图表未显示。
hc.xAxis[0].categories加载正常,但hc.series加载不

r.forEach(x => {
    var hc = Highcharts.chart('chart_div', {
        xAxis: { categories: x.categories },
        series: x.series,    
    });
    console.log(hc.series); // 1st
    console.log(x.series);  // 2nd
});

第1个console.log没有显示任何数据,而第2个显示如下:

  

[{name:'DE Shaw Comp(75; Q)',data:[100,100.5,101.91,103.03,104.37,103.85,103.22,104.77,105.71,105.5,107.08,107.51,106.33,107.18,107.18,108.68 ,109.44,110.87,110.53,111.75,115.21,116.83,117.41,116.82,116.24,118.21,119.99,121.79,121.54,122.88,122.27,123.86,124.6,126.22,128.36,124.77,129.14,],颜色:'#33a ',标签:{enabled:false}},{名称:“ SPX”,数据:[100,94.93,94.53,100.77,101.05,102.59,102.69,106.34,106.21,106.08,104.02,107.58,109.54,111.49,115.64 ,115.6,116.65,118,118.57,120.86,120.93,123.26,125.99,129.53,130.81,138.16,132.77,129.2,129.56,132.36,133,137.79,141.96,142.57,132.67,135.04,122.65,119.76],颜色:'#a33' ,标签:{enabled:false}},{名称:“ HFRI RV:MULTI-STRATEGY”,数据:[100,98.37,97.83,99.53,101.19,102,102.66,103.99,104.87,105.72,106.02,106.54,107.66,109.08 ,109.73,110.07,110.37,110.38,110.58,111.34,111.51,111.95,112.37,112.46,113.29,114.53,114.13,113.48,114.48,115.17,114.97,116.2,116.26,116.68,115.32,114.95 ,,],颜色: '#aa3',标签:{enabled:false}}]

看起来像是正确的输入。

1 个答案:

答案 0 :(得分:0)

ObjectArrayOrSingleDeserializer是解决方案
没有评估的x.series被解释为字符串,而不是我认为的对象数组