Skip to content

Instantly share code, notes, and snippets.

@makoto
Created October 3, 2017 17:44
Show Gist options
  • Save makoto/e03ba9644680dd9f36838af45892ed74 to your computer and use it in GitHub Desktop.
Save makoto/e03ba9644680dd9f36838af45892ed74 to your computer and use it in GitHub Desktop.
chart = c3.generate({
data: {
x: 'x',
xFormat: '%Y-%m-%d %H:%M:%S UTC',
url:'http://localhost:3000/api/v1/usages',
mimeType: 'json',
keys: {
x: 'date',
value: [ "data1"]
},
},
axis: {
x: {
type: "timeseries",
tick: {
format: '%H:%M:%S'
}
}
}
});
setTimeout(function () {
chart.load({
url: 'http://localhost:3000/api/v1/usages',
mimeType: 'json',
axis: {
x: {
type: "timeseries",
tick: {
format: '%H:%M:%S'
}
}
}
});
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment