更新时出现问题Highcharts对象使用highcharts-ng指令
问题描述:
当我更新一些hightcharts图片时,我正面临着highcharts-ng指令的问题。当我使用这个syntaxe图表就像魅力的更新,但似乎并没有表现出任何我的数据标签:更新时出现问题Highcharts对象使用highcharts-ng指令
$scope.chartRonConfig = {
chart: {
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: 'Browser<br>skjdfhsjdkf<br>2019',
align: 'center',
verticalAlign: 'middle',
y: 40
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -50,
style: {
fontWeight: 'bold',
color: 'white'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%']
}
},
series: [{
type: 'pie',
name: 'Browser share',
innerSize: '50%',
data: [
['Firefox', 10.38],
['IE', 56.33],
['Chrome', 24.03],
['Safari', 4.77],
['Opera', 0.91],
{
name: 'Proprietary or Undetectable',
y: 0.2,
dataLabels: {
enabled: false
}
}
]
}]
};
但使用这种syntaxe时,即时通讯:
$scope.chartRonConfig = Highcharts.chart('RonContainer', { // same config }
没有什么更新。
的观点很简单:
<highchart id="RonContainer" config="chartRonConfig"></highchart>
我不知道我错过了什么我在这里。任何帮助,将不胜感激。
答
感谢您的关注,我确实使用早期的highcharts版本解决了这个问题,而不是使用5.0.12我使用5.0.11,它确实解决了我的问题,我认为这是由于高级代码 - t支持最新版本的highcharts。
谢谢。
问候 Marouan
与highcharts-ng的从内存中,你可以只运行更新$范围变量来编辑标题,你可以有一个功能,当被称为例如更新标题$ scope.chartRonConfig.title.text ='hello world' – Tik
是的,但为什么当我启动图表时没有显示数据标签?! –
您是否可以在jsfiddle.net上复制您的示例作为现场演示?它将允许我们调试它。从图像中很难预测原因。 –