I’m using React to create a custom Netdata dashboard. I have React components that each display a chart using the markup outlined in the Netdata custom dashboard documentation, e.g:
<div data-netdata={targetData}
data-chart-library="dygraph"
data-dygraph-type="sparkline"
data-title=""
data-width="95%"
data-height="260px"
data-after="-300"
data-append-options="match-ids"
data-dygraph-valuerange="[0, null]"
data-dygraph-strokewidth="1.5"
data-dimensions="system_min_cpu_utilisation,system_avg_cpu_utilisation,system_max_cpu_utilisation"
data-colors="#ef5675 #ffa600 #7a5195"
>
I’m now trying to implement a date/time picker to change the data-after
element. If I inspect the page markup in Chrome I can see the data-after=
tags changing correctly but the chart does not change. I’m pretty sure React is re-rendering the component correctly but dashboard.js
doesn’t seem to pick this up.
How do I go about re-rendering a Netdata chart in this way?
Many thanks