is it possible to show the latest value of a serie next to the legend?, my timechart updates every 30 seconds, what I'm trying to do is put the legend name at the bottom with the latest value..thanks
Hi,
You may want to change 'nameLegend' parameter for the series upon data change (and use updateSettings api call to change it)
https://zoomcharts.com/developers/en/time-chart/api-reference/settings/seriesDefault.html#doc_nameLegend
Code snippet:
let last = null; ... onChartUpdate: function(e,a){ if (a.origin == "data"){ d = a.chart.exportVisibleData(); let current_last = d.pop(); if (current_last[1] != last){ last = current_last[1]; a.chart.updateSettings({series:[{id:"line", nameLegend:"foo "+last}]}); } } }
Here is a working example: http://jsfiddle.net/m0gbwonq/1/
Support Team