Time-based

Last updated

Last updated
agent.addChart('transactionVolume', async (context, resultBuilder) => {
// [...]
return resultBuilder.timeBased('Month', [
{ date: new Date('2017-02-01'), value: 636 },
{
date: new Date('2017-03-01'),
value: 740,
},
{
date: new Date('2017-04-01'),
value: 648,
},
{
date: new Date('2017-05-01'),
value: 726,
},
// [...]
]);
});agent.addChart('newUsersByProject', async (context, resultBuilder) => {
// [...]
return resultBuilder.multipleTimeBased(
'Month',
[
new Date('2017-02-28'),
new Date('2017-03-28'),
new Date('2017-04-28'),
new Date('2017-05-28'),
],
[
{ label: 'Project 1', values: [636, 740, 648, 726] },
{ label: 'Project 2', values: [100, 200, 300, 400] },
],
);
});