scriptable.js 868 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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: [4, 5, 10, null, -10, -5],
  10. borderDash: function(ctx) {
  11. return ctx.datasetIndex === 0 ? [5] : [10];
  12. }
  13. },
  14. {
  15. // option in element (fallback)
  16. data: [-4, -5, -10, null, 10, 5]
  17. }
  18. ]
  19. },
  20. options: {
  21. legend: false,
  22. title: false,
  23. elements: {
  24. line: {
  25. borderColor: '#00ff00',
  26. borderDash: function(ctx) {
  27. return ctx.datasetIndex === 0 ? [5] : [10];
  28. }
  29. },
  30. point: {
  31. radius: 10,
  32. }
  33. },
  34. layout: {
  35. padding: 32
  36. },
  37. scales: {
  38. xAxes: [{display: false}],
  39. yAxes: [
  40. {
  41. display: false,
  42. ticks: {
  43. beginAtZero: true
  44. }
  45. }
  46. ]
  47. }
  48. }
  49. },
  50. options: {
  51. canvas: {
  52. height: 256,
  53. width: 512
  54. }
  55. }
  56. };