AxisPointerModel.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. var echarts = require("../../echarts");
  2. var AxisPointerModel = echarts.extendComponentModel({
  3. type: 'axisPointer',
  4. coordSysAxesInfo: null,
  5. defaultOption: {
  6. // 'auto' means that show when triggered by tooltip or handle.
  7. show: 'auto',
  8. // 'click' | 'mousemove' | 'none'
  9. triggerOn: null,
  10. // set default in AxisPonterView.js
  11. zlevel: 0,
  12. z: 50,
  13. type: 'line',
  14. // axispointer triggered by tootip determine snap automatically,
  15. // see `modelHelper`.
  16. snap: false,
  17. triggerTooltip: true,
  18. value: null,
  19. status: null,
  20. // Init value depends on whether handle is used.
  21. // [group0, group1, ...]
  22. // Each group can be: {
  23. // mapper: function () {},
  24. // singleTooltip: 'multiple', // 'multiple' or 'single'
  25. // xAxisId: ...,
  26. // yAxisName: ...,
  27. // angleAxisIndex: ...
  28. // }
  29. // mapper: can be ignored.
  30. // input: {axisInfo, value}
  31. // output: {axisInfo, value}
  32. link: [],
  33. // Do not set 'auto' here, otherwise global animation: false
  34. // will not effect at this axispointer.
  35. animation: null,
  36. animationDurationUpdate: 200,
  37. lineStyle: {
  38. color: '#aaa',
  39. width: 1,
  40. type: 'solid'
  41. },
  42. shadowStyle: {
  43. color: 'rgba(150,150,150,0.3)'
  44. },
  45. label: {
  46. show: true,
  47. formatter: null,
  48. // string | Function
  49. precision: 'auto',
  50. // Or a number like 0, 1, 2 ...
  51. margin: 3,
  52. color: '#fff',
  53. padding: [5, 7, 5, 7],
  54. backgroundColor: 'auto',
  55. // default: axis line color
  56. borderColor: null,
  57. borderWidth: 0,
  58. shadowBlur: 3,
  59. shadowColor: '#aaa' // Considering applicability, common style should
  60. // better not have shadowOffset.
  61. // shadowOffsetX: 0,
  62. // shadowOffsetY: 2
  63. },
  64. handle: {
  65. show: false,
  66. icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',
  67. // jshint ignore:line
  68. size: 45,
  69. // handle margin is from symbol center to axis, which is stable when circular move.
  70. margin: 50,
  71. // color: '#1b8bbd'
  72. // color: '#2f4554'
  73. color: '#333',
  74. shadowBlur: 3,
  75. shadowColor: '#aaa',
  76. shadowOffsetX: 0,
  77. shadowOffsetY: 2,
  78. // For mobile performance
  79. throttle: 40
  80. }
  81. }
  82. });
  83. var _default = AxisPointerModel;
  84. module.exports = _default;