ScatterSeries.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 createListFromArray = require("../helper/createListFromArray");
  20. var SeriesModel = require("../../model/Series");
  21. /*
  22. * Licensed to the Apache Software Foundation (ASF) under one
  23. * or more contributor license agreements. See the NOTICE file
  24. * distributed with this work for additional information
  25. * regarding copyright ownership. The ASF licenses this file
  26. * to you under the Apache License, Version 2.0 (the
  27. * "License"); you may not use this file except in compliance
  28. * with the License. You may obtain a copy of the License at
  29. *
  30. * http://www.apache.org/licenses/LICENSE-2.0
  31. *
  32. * Unless required by applicable law or agreed to in writing,
  33. * software distributed under the License is distributed on an
  34. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  35. * KIND, either express or implied. See the License for the
  36. * specific language governing permissions and limitations
  37. * under the License.
  38. */
  39. var _default = SeriesModel.extend({
  40. type: 'series.scatter',
  41. dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'],
  42. getInitialData: function (option, ecModel) {
  43. return createListFromArray(this.getSource(), this, {
  44. useEncodeDefaulter: true
  45. });
  46. },
  47. brushSelector: 'point',
  48. getProgressive: function () {
  49. var progressive = this.option.progressive;
  50. if (progressive == null) {
  51. // PENDING
  52. return this.option.large ? 5e3 : this.get('progressive');
  53. }
  54. return progressive;
  55. },
  56. getProgressiveThreshold: function () {
  57. var progressiveThreshold = this.option.progressiveThreshold;
  58. if (progressiveThreshold == null) {
  59. // PENDING
  60. return this.option.large ? 1e4 : this.get('progressiveThreshold');
  61. }
  62. return progressiveThreshold;
  63. },
  64. defaultOption: {
  65. coordinateSystem: 'cartesian2d',
  66. zlevel: 0,
  67. z: 2,
  68. legendHoverLink: true,
  69. hoverAnimation: true,
  70. // Cartesian coordinate system
  71. // xAxisIndex: 0,
  72. // yAxisIndex: 0,
  73. // Polar coordinate system
  74. // polarIndex: 0,
  75. // Geo coordinate system
  76. // geoIndex: 0,
  77. // symbol: null, // 图形类型
  78. symbolSize: 10,
  79. // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
  80. // symbolRotate: null, // 图形旋转控制
  81. large: false,
  82. // Available when large is true
  83. largeThreshold: 2000,
  84. // cursor: null,
  85. // label: {
  86. // show: false
  87. // distance: 5,
  88. // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
  89. // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
  90. // 'inside'|'left'|'right'|'top'|'bottom'
  91. // 默认使用全局文本样式,详见TEXTSTYLE
  92. // },
  93. itemStyle: {
  94. opacity: 0.8 // color: 各异
  95. },
  96. // If clip the overflow graphics
  97. // Works on cartesian / polar series
  98. clip: true // progressive: null
  99. }
  100. });
  101. module.exports = _default;