scriptable.js 780 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module.exports = {
  2. config: {
  3. type: 'line',
  4. data: {
  5. labels: [0, 1, 2, 3, 4, 5],
  6. datasets: [
  7. {
  8. // option in dataset
  9. data: [-2, -6, -4, -8, -6, -10],
  10. backgroundColor: '#ff0000',
  11. fill: function(ctx) {
  12. return ctx.datasetIndex === 0 ? true : false;
  13. }
  14. },
  15. {
  16. // option in element (fallback)
  17. data: [0, 4, 2, 6, 4, 8],
  18. }
  19. ]
  20. },
  21. options: {
  22. legend: false,
  23. title: false,
  24. elements: {
  25. line: {
  26. backgroundColor: '#00ff00',
  27. fill: function(ctx) {
  28. return ctx.datasetIndex === 0 ? true : false;
  29. }
  30. }
  31. },
  32. layout: {
  33. padding: 32
  34. },
  35. scales: {
  36. xAxes: [{display: false}],
  37. yAxes: [{display: false}]
  38. }
  39. }
  40. },
  41. options: {
  42. canvas: {
  43. height: 256,
  44. width: 512
  45. }
  46. }
  47. };