I have basically created a FIDDLE and made a sample chart.
This is the code for the chart
var chart = c3.generate({
data: {
json: [{
date: '2014-01-01',
upload: 200,
download: 200,
total: 400
}, {
date: '2014-01-02',
upload: 100,
download: 300,
total: 400
}, {
date: '2014-02-01',
upload: 300,
download: 200,
total: 500
}, {
date: '2014-02-02',
upload: 400,
download: 100,
total: 500
}],
keys: {
x: 'date',
value: ['upload', 'download']
}
},
axis: {
x: {
type: 'timeseries',
tick: {
format: function (x) {
if (x.getDate() === 1) {
return x.toLocaleDateString();
}
}
}
}
}
});
I am attempting to convert this chart in to a datauri which i can use to draw an image. I was wondering what is the best way to do this?
I did research and found the following approach but I am not able to successfully implement it. Any help on this matter would be appreciated.