我一直在使用的角度component..but它不工作試圖在我的應用程序的角度計JS ...Angularjs計JS如何把對角分量
該指數焦炭是https://www.amcharts.com/demos/animated-gauge/
我的代碼如下:
(function(app) {
'use strict';
SpeedometerController.$inject = ['$scope', '$timeout','$http', 'apiurl'];
function SpeedometerController($scope, $timeout,$http, apiurl) {
var initChart = function() {
$scope.amChartOptions = {
"type": "gauge",
// "theme": "none",
"axes": [ {
"axisThickness": 0,
"axisAlpha": 0.2,
"tickAlpha": 0.2,
"valueInterval": 500,
"inside": false,
"fontSize": 11,
// "labelOffset": -50,
"gridInside": true,
"startAngle": -90,
"endAngle": 90,
"bands": [ {
"color": "#91c039",
"endValue": 500,
"innerRadius": "78%",
"startValue": 0
}, {
"color": "#f0cf1b",
"endValue": 1000,
"innerRadius": "88%",
"startValue": 500
},{
"color": "#de7c13",
"endValue": 1500,
"innerRadius": "88%",
"startValue": 1000
}, {
"color": "#c53020",
"endValue": 2000,
"innerRadius": "88%",
"startValue": 1500
} ],
"topText": "497",
"topTextYOffset": 105,
"topTextColor": "#555555",
"topTextFontSize": 50,
"bottomText": "Watts",
"bottomTextYOffset": -10,
"bottomTextColor": "#909090",
"bottomTextFontSize": 18,
"endValue": 2000
} ],
"arrows": [
{
"startWidth" : 15,
"nailBorderThickness" : 1,
"nailRadius" : 8 ,
"color" : "#5b5b5b",
}
],
"export": {
"enabled": true
}
};
};
initChart();
AmCharts.ready(function() {
initChart();
});
}
app.module('app').component('speedometer', {
templateUrl: '../resources/views/component/speedometer.html',
controller: SpeedometerController
});
})(window.angular);
<div id="speeda_meter"></div>
這是什麼問題?
您是否使用https://github.com/GrantMStevens/amCharts-Angular中的angular1指令?它似乎不支持角度測量圖。我建議聯繫作者或提交補丁。 – xorspark