I'll have done this topic to the death shortly.
I have 10 charts on a UI page, each with the same code powering them just with a different payload variable gotten from the global context, in the picture below you can see that each is rendering the graph slightly differently.
The top one shows where the zero value is being drawn in red, this is not desirable, the middle one shows how I would like the graphs to render, the positive topic hasn't rendered a zero even though it was passed one. the bottom one shows them kind of sitting inside each other, this is acceptable but less than ideal as it is still noticeable.
Anyone have any suggestions to setting that can maybe nail them all down to do the same.
Code passed to the charts for the curious:
ts = msg.timestamp
pl = global.get("LiveChart.S1Dif")
if (pl < 0){
pl2 = pl
pl1 = null
} else {
pl2 = null
pl1 = pl
}
ui= {
options: {
scales: {
xAxes: [{
stacked: true,
ticks: {
autoSkip: true,
maxTicksLimit: 12
}
}],
yAxes: [{
stacked: true,
ticks: {
max: 60,
min: -140
}
}]
}
}
}
//series 1 #green
msg = {
payload: pl1,
timestamp: ts,
topic: "high",
ui_control: ui
},
//series 2 #red
msg2 = {
payload: pl2,
timestamp: ts,
topic: "low",
ui_control: ui
}
if (pl > 0){
return msg
}
else {
return msg2
}