Erros gerados:
gauge.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'Class')
at gauge.js:1:49
at gauge.js:10:507
Uncaught SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at drawAmChart (9c9e58629f8a325604aae0c0ad1da33e.js:61:21)
at HTMLDivElement.<anonymous> (9c9e58629f8a325604aae0c0ad1da33e.js:44:13)
at i.each (vendor?v=kdGjmjDGb-qcRDkNvj9GlWHFWpW0b6Au1ijRGQPKhu01:1:16143)
at i.each (vendor?v=kdGjmjDGb-qcRDkNvj9GlWHFWpW0b6Au1ijRGQPKhu01:1:14609)
at 9c9e58629f8a325604aae0c0ad1da33e.js:43:25
Query:
WITH C1 AS
(
select
TO_CHAR(ROUND((d/c) * 100, 2), 'FM9999990.00') as pct
from (
SELECT
sum(disponibilidade) as d,
count(disponibilidade) as c
FROM
OEE_result
)
)
SELECT
'<div class="drawChart" style="box-sizing:border-box;width:100%;height:250px">
<script src="https://www.amcharts.com/lib/3/gauge.js"></script>
<script type="application/json">
{
"type": "gauge",
"arrows": [
{
"id": "GaugeArrow-1",
"value": '||pct||'
}
],
"axes": [
{
"bottomText": "TESTE",
"bottomTextYOffset": -20,
"endValue": 100,
"id": "GaugeAxis-1",
"valueInterval": 10,
"bands": [
{
"color": "#00CC00",
"endValue": 100,
"id": "GaugeBand-1",
"startValue": 45
},
{
"color": "#ffac29",
"endValue": 45,
"id": "GaugeBand-2",
"startValue": 20
},
{
"color": "#ea3838",
"endValue": 20,
"id": "GaugeBand-3",
"innerRadius": "98%",
"startValue": 0
}
]
}
],
"allLabels": [],
"balloon": {},
"titles": [
{
"id": "Title-1",
"size": 15,
"text": "Speedometer"
}
]
}
</script> </div>
' AS Charts
FROM C1