region_timeseries.js 567 B

12345678910111213141516171819
  1. var chart = c3.generate({
  2. data: {
  3. x: 'date',
  4. columns: [
  5. ['date', '2014-01-01', '2014-01-10', '2014-01-20', '2014-01-30', '2014-02-01'],
  6. ['sample', 30, 200, 100, 400, 150, 250]
  7. ]
  8. },
  9. axis: {
  10. x: {
  11. type: 'timeseries'
  12. }
  13. },
  14. regions: [
  15. {start: '2014-01-05', end: '2014-01-10'},
  16. {start: new Date('2014/01/15'), end: new Date('20 Jan 2014')},
  17. {start: 1390575600000, end: 1391007600000} // start => 2014-01-25 00:00:00, end => 2014-01-30 00:00:00
  18. ]
  19. });