Below I have an Angular expression {{USA_Visits.maximum.value |number:0 }}
which I would like to use within JavaScript in order to generate a chart. This is my current code:
<!-- Angular expression -->
{{USA_Visits.maximum.value |number:0 }}
<!-- Chart code -->
<script>
var chart = AmCharts.makeChart("chartdiv", {
"theme": "light",
"type": "serial",
"startDuration": 2,
"dataProvider": [{
"country": "USA",
"visits": {{USA_Visits.maximum.value |number:0 }},
"color": "#FF0F00"
}, {
"country": "Taiwan",
"visits": 500,
"color": "#333333"
}],
"valueAxes": [{
"position": "left",
"axisAlpha":0,
"gridAlpha":0
}],
"graphs": [{
"balloonText": "[[category]]: <b>[[value]]</b>",
"colorField": "color",
"fillAlphas": 0.85,
"lineAlpha": 0.1,
"type": "column",
"topRadius":1,
"valueField": "visits"
}],
"depth3D": 40,
"angle": 30,
"chartCursor": {
"categoryBalloonEnabled": false,
"cursorAlpha": 0,
"zoomable": false
},
"categoryField": "country",
"categoryAxis": {
"gridPosition": "start",
"axisAlpha":0,
"gridAlpha":0
},
"export": {
"enabled": true
}
}, 0);
</script>
<!-- HTML -->
<div id="chartdiv"></div>
Clearly assigning "visits": {{USA_Visits.maximum.value |number:0 }}
within the JS code isn't working. How can I do this?
Thank you