【发布时间】:2014-10-17 22:24:12
【问题描述】:
我正在尝试用 .json 文件中的数据填充许多图表。我让图表按要求使用一些虚拟/硬编码值(在 plunker 中注释掉),但是当我尝试从 .json 文件/模型中添加值时它不起作用。
html模板:
<highchart config="chartConfig"></highchart>
控制器:
series:[
{
data: ['part.before_hp','part.before_torque'], //this doesn't work
//data: [2,3], //this works
dataLabels: {
enabled: true,
color: '#FFFFFF',
y: 40,
style: {
fontSize: '24px',
fontFamily: 'tg, sans-serif',
textShadow: '0 0 3px black'
}
},
borderColor: 'transparent',
pointPadding: 0.03
},
{
data: ['part.after_hp','part.after_torque'], //this doesn't work
//data: [5,6], //this works
dataLabels: {
enabled: true,
color: '#FFFFFF',
y: 40,
style: {
fontSize: '24px',
fontFamily: 'tg, sans-serif',
textShadow: '0 0 3px black'
}
},
borderColor: 'transparent',
pointPadding: 0.03
}
],
我真的被困在这个问题上,已经尝试了几天来修复它,如果有人可以提供帮助,我将不胜感激。
我创建了这个plunker 来展示我在做什么。
【问题讨论】:
标签: angularjs highcharts angular-ui highcharts-ng