It's working. angular2-seed-ng2highcharts
ref: https://github.com/AngularShowcase/angular2-seed-ng2-highcharts
chart.html:
-------------
<div [ng2-highcharts]="chartGauge" class="graph" ></div>
chart.component.ts:
------------------
Add series option within the chart option.
chartGauge = {
chart: {
type: 'solidgauge'
},
title: {
text: 'ASUP'
},
pane: {
center: ['50%', '70%'],
size: '140%',
startAngle: -90,
endAngle: 90,
background: {
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE',
innerRadius: '60%',
outerRadius: '100%',
shape: 'arc'
}
},
tooltip: {
enabled: true
},
// the value axis
yAxis: {
min: 0,
max: 200,
title: {
text: 'Speed'
}
stops: [
[0.5, '#FF5252'], // red*
[0.9, '#69F0AE'] // green
],
lineWidth: 0,
minorTickInterval: null,
tickAmount: 1,
title: {
y: -40
},
labels: {
y: 15
}
},
plotOptions: {
solidgauge: {
dataLabels: {
y: 25,
borderWidth: 0,
useHTML: true
}
}
}
series: [{
name: 'Speed',
data: [80],
dataLabels: {
format: '<div style="text-align:center"><span style="font-size:25px;color:' +
((Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black') + '">{y}</span><br/>' +
'<span style="font-size:12px;color:silver">km/h</span></div>'
},
tooltip: {
valueSuffix: ' km/h'
}
}]
};
これはクールです。しかし最新のabgular2とangular2-highchartsが壊れているようですが、アップデートを公開できますか? –
@EMa最新のバージョンは、plunkerのデモがどこにあるのか分かりませんが、[angular2-highcharts npmサイトの新しい情報](https://www.npmjs.com/package/angular2-highcharts# highcharts-static-members-and-modulesへのアクセス)、[このデモ](http://plnkr.co/edit/wKWO1HQwX9o23g5v9ozW?p=preview)のように動作させることができます。 –