StockChart不显示预览

时间:2012-10-08 11:58:41

标签: highstock

enter image description here

我想在图表的底部显示预览,就像在这个示例中一样:

enter image description here

1 个答案:

答案 0 :(得分:0)

我有类似的问题。初始化图形后设置数据时会发生这种情况。您必须手动更新导航器。 初始化图表时,请确保为导航器指定ID。

navigator = { 
        series: {   
            id: 'navigator'
        }
}

更新数据后,通过它的id获取导航器,并将数据设置为导航器。这将更新“预览”图表。

chart.get("navigator").setData([data that you updated the chart with]);

可悲的是,Highcharts不支持以这种方式更新数据。如果使用数据初始化它最有效。最好销毁图表并在数据准备好后重新创建它。并不总是我所知道的最佳选择。

希望这有帮助