Does not display VU-meter calibration chart using HighCharts in Durandal

I am trying to add a Vu-Meter Gauge diagram in a Durandal app. I saved the high code Js diagrams in "viewAttacthed". My Js code is as follows:

define(['services/logger'], function (logger, highcharts) { //#region Internal Methods function activate() { logger.log('Reports View Activated', null, 'Resources', true); return true; } //#endregion function viewAttached(view) { $('#ufcGaugeChart', view).highcharts({ chart: { type: 'gauge' }, title: null, pane: [{ startAngle: -90, endAngle: 90, center: ['50%', '67%'], size: 175 }], yAxis: [{ min: 0, max: 100000, minorTickPosition: 'inside', tickPosition: 'inside', labels: { rotation: 'auto', distance: 20 }, plotBands: [{ from: 0, to: 40000, color: '#679b4f', innerRadius: '100%', outerRadius: '105%' }, { from: 40000, to: 70000, color: '#d5995c', innerRadius: '100%', outerRadius: '105%' }, { from: 70000, to: 100000, color: '#ab4641', innerRadius: '100%', outerRadius: '105%' }], pane: 0, title: { // need to change the style. text: 'Gauge', y: 0 } }], plotOptions: { gauge: { dataLabels: { enabled: true }, dial: { radius: '100%' } } }, series: [{ data: [54036], yAxis: 0 }] }, // Let the music play function (chart) { setInterval(function () { alert("hi"); var left = chart.series[0].points[0], right = chart.series[1].points[0], leftVal, inc = (Math.random() - 0.5) * 3; leftVal = left.y + inc; rightVal = leftVal + inc / 3; if (leftVal < -20 || leftVal > 6) { leftVal = left.y - inc; } if (rightVal < -20 || rightVal > 6) { rightVal = leftVal; } left.update(leftVal, false); right.update(rightVal, false); chart.redraw(); }, 500); }); }; var vm = { activate: activate, title: 'Reports View', paymentDate: '06/09/2013', paymentAmount: '$120,098.66', paymentCheck: '235', viewAttached: viewAttached }; return vm; 

});

but I can not see the calibration chart. Please let me know exactly where I am missing something or something is wrong.

script throws

Highcharts Sewage Error # 17

Thanks for the advanced.

+4
source share
2 answers

In the source for demonstrating solid state sensors, they have the following js files:

 <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/highcharts-more.js"></script> <script src="http://code.highcharts.com/modules/solid-gauge.src.js"></script> 

By combining and minimizing, we cleared error 17 for me.

+7
source

Error 17 means "The type of the requested series does not exist", perhaps you do not have an attached file highcharts-more.js.

http://www.highcharts.com/errors/17

0
source

Source: https://habr.com/ru/post/1492637/


All Articles