角度2 Highcharts股票图表差异 [英] angular 2 Highcharts Stock Chart differences
问题描述
我正在实施HighCharts以显示股票数据,但是我的图表没有像他们在
注意区别...
$ b
- 无法在图形上更改时间
- 日期不是管道
li>
- 底部没有拖动条
在比较我的代码后,唯一的区别是我可以看到在html中。
在运动员有这条线
< chart type =StockChart[options] =options><<< ; / chart>
没有 type =StockChart
上面的图像输出,当我添加该行时,我得到一个错误。 StockChart不是一种可接受的类型选项。
以下是我的所有代码:
loadChart(){
this.jsonp.request('https://www.highcharts.com/samples/data/jsonp.php?filename='+ this.values +'-c.json& callback = {
this.options = {
title:{text:this.values +'Stock Price'},
series:[{$ b ='JSONP_CALLBACK')。subscribe(res => $ b name:this.values,
data:res.json(),
tooltip:{
valueDecimals:2
}
}]
} ;
});
$ / code>
值得注意的是:我使用的是角度cli,是的,我运行了npm install命令为高图,并将其添加到我的app.module。感谢您的任何帮助!!
我遇到同样的问题,结果我不得不排序我的日期'Asencdingly' p>
I am implementing HighCharts to display stock data, However I am not getting as many options on my chart as they do on their
Notice the differences...
- No option for changing time on graph
- Date isn't piped
- No drag bar on bottom
after comparing my code, the only difference that I can see is in the html. In the plunker there is this line
<chart type="StockChart" [options]="options"></chart>
Without the type="StockChart"
my code works with the above image output, when I add in that line I get an error. StockChart isnt an acceptable option for type.
Here is all my code
loadChart(){
this.jsonp.request('https://www.highcharts.com/samples/data/jsonp.php?filename=' + this.values + '-c.json&callback=JSONP_CALLBACK').subscribe(res => {
this.options = {
title : { text : this.values + ' Stock Price' },
series : [{
name : this.values,
data : res.json(),
tooltip: {
valueDecimals: 2
}
}]
};
});
}
Worth noting: I am using angular cli, and yes I ran the npm install command for highcharts, as well as added it to my app.module. Thanks for any help!!
I had the same problems, Turns out I had to sort my date 'Asencdingly'
这篇关于角度2 Highcharts股票图表差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!