Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onRefresh(chart) {
- $.ajax({
- url: 'api/measurement/?format=json',
- data: {
- 'datetime': Date.now()
- },
- dataType: 'json',
- success: function(data){
- data.forEach(function(d) {
- chart.config.data.datasets.forEach(function(dataset) {
- dataset.data.push({
- x: Date.parse(d.datetime),
- y: d.i_max
- });
- })
- })
- }
- })
- }
- var color = Chart.helpers.color;
- var config = {
- type: 'line',
- data: {
- datasets: [{
- label: 'Streaming Impedance chart',
- backgroundColor: color(chartColors.red).alpha(0.5).rgbString(),
- borderColor: chartColors.red,
- fill: false,
- lineTension: 0,
- borderDash: [8, 4],
- data: []
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement