scriptable.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. module.exports = {
  2. config: {
  3. type: 'line',
  4. data: {
  5. labels: [0, 1, 2],
  6. datasets: [
  7. {
  8. // option in dataset
  9. data: [6, 18, 6],
  10. borderColor: '#ff0000',
  11. borderJoinStyle: function(ctx) {
  12. var index = ctx.datasetIndex % 3;
  13. return index === 0 ? 'round'
  14. : index === 1 ? 'miter'
  15. : 'bevel';
  16. }
  17. },
  18. {
  19. // option in element (fallback)
  20. data: [2, 14, 2],
  21. borderColor: '#0000ff',
  22. },
  23. {
  24. // option in element (fallback)
  25. data: [-2, 10, -2]
  26. }
  27. ]
  28. },
  29. options: {
  30. legend: false,
  31. title: false,
  32. elements: {
  33. line: {
  34. borderColor: '#00ff00',
  35. borderJoinStyle: function(ctx) {
  36. var index = (ctx.datasetIndex % 3);
  37. return index === 0 ? 'round'
  38. : index === 1 ? 'miter'
  39. : 'bevel';
  40. },
  41. borderWidth: 25,
  42. fill: false,
  43. tension: 0
  44. }
  45. },
  46. layout: {
  47. padding: 32
  48. },
  49. scales: {
  50. xAxes: [{display: false}],
  51. yAxes: [{display: false}]
  52. }
  53. }
  54. },
  55. options: {
  56. canvas: {
  57. height: 256,
  58. width: 512
  59. }
  60. }
  61. };