05.01.2022, 11:07
I still have a little issue explained with this picture:
The display is ok opn load, but at the first change of the knx object value of the script (20/3/200), the display change badly !
Any idea if it possible to fix it and keep auto scale of visualisation ?
The display is ok opn load, but at the first change of the knx object value of the script (20/3/200), the display change badly !
Any idea if it possible to fix it and keep auto scale of visualisation ?
Code:
//instantane pie
$(function(){
grp.listen('20/3/200', function(obj, type) {
var classImage ='pie1';
var idChart ='chart1';
var chart=[];
const variableCourbes = ["20/3/0", "20/3/1", "20/3/2", "20/3/3", "20/3/4"];
const hauteur='300px';
const largeur='300px';
var labelTab = [];
var serieTab = [];
var separateurNom = ' '
for (let i = 0; i < variableCourbes.length; i++) {
var id = Scada.encodeGroupAddress(variableCourbes[i]);
var obj = objectStore.getObject(id);
var nom = obj.name.split(separateurNom)[0]
labelTab.push(nom);
serieTab.push(obj.value);
}
var data = {
labels: labelTab,
series: serieTab
};
var options = {
width: largeur,
height: hauteur,
donut: true,
donutWidth: 50,
donutSolid: true,
startAngle: 270,
showLabel: true
};
if (chart[idChart]) {
chart[idChart].update(data);
}
else {
var plans = $('.' + classImage)[0]
plans.innerHTML = '';
chart[idChart] = new Chartist.Pie('.'+classImage, data, options);
}
}, true);
});
-----------
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION
SE ECO EXPERT
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION
SE ECO EXPERT