Javascript error in high chart

0
Hi all,  I’m using javascript and html snippet to display the donut chart. I’m passing dynamic input for the highchart. If the dynamic input value exceeds more than 1000 then I’m facing error like “Error while evaluating javascript input: SyntaxError: Unexpected number” Javascript snippet code: setTimeout(function(){                 var NewRFID= ${NewRFID};               var Replace=${Replace};               var Recharge=${Recharge}; Highcharts.chart('donutChart', { exporting: {     enabled: false        },             chart: {                 type: 'pie',                 height: 200,                 margin: [0, 0, 0, 0],                                  spacingTop: 0,                 spacingBottom: 5,                 spacingLeft: 0,                 spacingRight: 0,                 backgroundColor:'transparent',                 options3d: {                     enabled: true,                     alpha: 45                 }             },             title: {                 text: 'Objectives',                 style: {                     display: 'none'                 }             },             subtitle: {                 text: 'Objectives',                 style: {                     display: 'none'                 }             },             plotOptions: {                 pie: {                     innerSize: 90,                     size:'100%',                     depth: 25,                     showInLegend: true,                     dataLabels: {                         enabled: false                     }                 }             },             legend: {                enabled: true             },               colors: [ '#ff4d94','#0da581','#434544','#eb8e0c','#e35263'],             series: [{                 type: 'pie',                 name: 'Revenue of Period A',                 data: [                    {                         name:'Total amount of new RFID tag',                         y:NewRFID,                         sliced: true,                         selected: true                     },                     ['Total amount of RFID tag replacement', Replace],                     ['Total amount of charging balance', Recharge]                 ]             }]         });                 }, 100); html code:   <div id="donutChart" class="donutChart" style="width: 100%; height:200px"></div> <div class="legend"> <div class="dot green"></div> <div class="legend1">
asked
1 answers
0

This sounds like you have grouping characters in your decimal number. This is probably a comma, e.g. 1,000 or 12,345.

Can you use the formatDecimal function to change how this is output from your Mendix application? A format like ‘0.00’ will probably work but do experiment to see what meets your requirements.

https://docs.mendix.com/refguide/parse-and-format-decimal-function-calls/

Good luck!

 

answered