AxisPointerModel.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. var echarts = require("../../echarts");
  20. /*
  21. * Licensed to the Apache Software Foundation (ASF) under one
  22. * or more contributor license agreements. See the NOTICE file
  23. * distributed with this work for additional information
  24. * regarding copyright ownership. The ASF licenses this file
  25. * to you under the Apache License, Version 2.0 (the
  26. * "License"); you may not use this file except in compliance
  27. * with the License. You may obtain a copy of the License at
  28. *
  29. * http://www.apache.org/licenses/LICENSE-2.0
  30. *
  31. * Unless required by applicable law or agreed to in writing,
  32. * software distributed under the License is distributed on an
  33. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  34. * KIND, either express or implied. See the License for the
  35. * specific language governing permissions and limitations
  36. * under the License.
  37. */
  38. var AxisPointerModel = echarts.extendComponentModel({
  39. type: 'axisPointer',
  40. coordSysAxesInfo: null,
  41. defaultOption: {
  42. // 'auto' means that show when triggered by tooltip or handle.
  43. show: 'auto',
  44. // 'click' | 'mousemove' | 'none'
  45. triggerOn: null,
  46. // set default in AxisPonterView.js
  47. zlevel: 0,
  48. z: 50,
  49. type: 'line',
  50. // 'line' 'shadow' 'cross' 'none'.
  51. // axispointer triggered by tootip determine snap automatically,
  52. // see `modelHelper`.
  53. snap: false,
  54. triggerTooltip: true,
  55. value: null,
  56. status: null,
  57. // Init value depends on whether handle is used.
  58. // [group0, group1, ...]
  59. // Each group can be: {
  60. // mapper: function () {},
  61. // singleTooltip: 'multiple', // 'multiple' or 'single'
  62. // xAxisId: ...,
  63. // yAxisName: ...,
  64. // angleAxisIndex: ...
  65. // }
  66. // mapper: can be ignored.
  67. // input: {axisInfo, value}
  68. // output: {axisInfo, value}
  69. link: [],
  70. // Do not set 'auto' here, otherwise global animation: false
  71. // will not effect at this axispointer.
  72. animation: null,
  73. animationDurationUpdate: 200,
  74. lineStyle: {
  75. color: '#aaa',
  76. width: 1,
  77. type: 'solid'
  78. },
  79. shadowStyle: {
  80. color: 'rgba(150,150,150,0.3)'
  81. },
  82. label: {
  83. show: true,
  84. formatter: null,
  85. // string | Function
  86. precision: 'auto',
  87. // Or a number like 0, 1, 2 ...
  88. margin: 3,
  89. color: '#fff',
  90. padding: [5, 7, 5, 7],
  91. backgroundColor: 'auto',
  92. // default: axis line color
  93. borderColor: null,
  94. borderWidth: 0,
  95. shadowBlur: 3,
  96. shadowColor: '#aaa' // Considering applicability, common style should
  97. // better not have shadowOffset.
  98. // shadowOffsetX: 0,
  99. // shadowOffsetY: 2
  100. },
  101. handle: {
  102. show: false,
  103. /* eslint-disable */
  104. 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',
  105. // jshint ignore:line
  106. /* eslint-enable */
  107. size: 45,
  108. // handle margin is from symbol center to axis, which is stable when circular move.
  109. margin: 50,
  110. // color: '#1b8bbd'
  111. // color: '#2f4554'
  112. color: '#333',
  113. shadowBlur: 3,
  114. shadowColor: '#aaa',
  115. shadowOffsetX: 0,
  116. shadowOffsetY: 2,
  117. // For mobile performance
  118. throttle: 40
  119. }
  120. }
  121. });
  122. var _default = AxisPointerModel;
  123. module.exports = _default;