scriptable.js 1019 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. module.exports = {
  2. config: {
  3. type: 'radar',
  4. data: {
  5. labels: [0, 1, 2, 3, 4, 5],
  6. datasets: [
  7. {
  8. // option in dataset
  9. data: [0, 5, 10, null, -10, -5],
  10. borderColor: '#0000ff',
  11. borderWidth: function(ctx) {
  12. var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
  13. return index % 2 ? 10 : 20;
  14. },
  15. pointBorderColor: '#00ff00'
  16. },
  17. {
  18. // option in element (fallback)
  19. data: [4, -5, -10, null, 10, 5]
  20. }
  21. ]
  22. },
  23. options: {
  24. legend: false,
  25. title: false,
  26. elements: {
  27. line: {
  28. borderColor: '#ff0000',
  29. borderWidth: function(ctx) {
  30. var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
  31. return index % 2 ? 10 : 20;
  32. },
  33. fill: false
  34. },
  35. point: {
  36. borderColor: '#00ff00',
  37. borderWidth: 5,
  38. radius: 10
  39. }
  40. },
  41. scale: {
  42. display: false,
  43. ticks: {
  44. min: -15
  45. }
  46. }
  47. }
  48. },
  49. options: {
  50. canvas: {
  51. height: 512,
  52. width: 512
  53. }
  54. }
  55. };