Advertisement
Guest User

Untitled

a guest
May 29th, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. // require() some stuff from npm (like you were using browserify)
  2. // and then hit Run Code to run it on the right
  3.  
  4. var d3 = require('d3');
  5. var c3 = require('c3');
  6.  
  7.  
  8. var chart = c3.generate({
  9. data: {
  10. x: 'x',
  11. // xFormat: '%Y%m%d', // 'xFormat' can be used as custom format of 'x'
  12. columns: [
  13. ['x', '2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04', '2013-01-05', '2013-01-06'],
  14. // ['x', '20130101', '20130102', '20130103', '20130104', '20130105', '20130106'],
  15. ['data1', 30, 200, 100, 400, 150, 250],
  16. ['data2', 130, 340, 200, 500, 250, 350]
  17. ]
  18. },
  19. axis: {
  20. x: {
  21. type: 'timeseries',
  22. tick: {
  23. format: '%Y-%m-%d'
  24. }
  25. }
  26. }
  27. });
  28.  
  29. setTimeout(function () {
  30. chart.load({
  31. columns: [
  32. ['data3', 400, 500, 450, 700, 600, 500]
  33. ]
  34. });
  35. }, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement