BoxplotSeries.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 zrUtil = require("zrender/lib/core/util");
  20. var SeriesModel = require("../../model/Series");
  21. var _whiskerBoxCommon = require("../helper/whiskerBoxCommon");
  22. var seriesModelMixin = _whiskerBoxCommon.seriesModelMixin;
  23. /*
  24. * Licensed to the Apache Software Foundation (ASF) under one
  25. * or more contributor license agreements. See the NOTICE file
  26. * distributed with this work for additional information
  27. * regarding copyright ownership. The ASF licenses this file
  28. * to you under the Apache License, Version 2.0 (the
  29. * "License"); you may not use this file except in compliance
  30. * with the License. You may obtain a copy of the License at
  31. *
  32. * http://www.apache.org/licenses/LICENSE-2.0
  33. *
  34. * Unless required by applicable law or agreed to in writing,
  35. * software distributed under the License is distributed on an
  36. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  37. * KIND, either express or implied. See the License for the
  38. * specific language governing permissions and limitations
  39. * under the License.
  40. */
  41. var BoxplotSeries = SeriesModel.extend({
  42. type: 'series.boxplot',
  43. dependencies: ['xAxis', 'yAxis', 'grid'],
  44. // TODO
  45. // box width represents group size, so dimension should have 'size'.
  46. /**
  47. * @see <https://en.wikipedia.org/wiki/Box_plot>
  48. * The meanings of 'min' and 'max' depend on user,
  49. * and echarts do not need to know it.
  50. * @readOnly
  51. */
  52. defaultValueDimensions: [{
  53. name: 'min',
  54. defaultTooltip: true
  55. }, {
  56. name: 'Q1',
  57. defaultTooltip: true
  58. }, {
  59. name: 'median',
  60. defaultTooltip: true
  61. }, {
  62. name: 'Q3',
  63. defaultTooltip: true
  64. }, {
  65. name: 'max',
  66. defaultTooltip: true
  67. }],
  68. /**
  69. * @type {Array.<string>}
  70. * @readOnly
  71. */
  72. dimensions: null,
  73. /**
  74. * @override
  75. */
  76. defaultOption: {
  77. zlevel: 0,
  78. // 一级层叠
  79. z: 2,
  80. // 二级层叠
  81. coordinateSystem: 'cartesian2d',
  82. legendHoverLink: true,
  83. hoverAnimation: true,
  84. // xAxisIndex: 0,
  85. // yAxisIndex: 0,
  86. layout: null,
  87. // 'horizontal' or 'vertical'
  88. boxWidth: [7, 50],
  89. // [min, max] can be percent of band width.
  90. itemStyle: {
  91. color: '#fff',
  92. borderWidth: 1
  93. },
  94. emphasis: {
  95. itemStyle: {
  96. borderWidth: 2,
  97. shadowBlur: 5,
  98. shadowOffsetX: 2,
  99. shadowOffsetY: 2,
  100. shadowColor: 'rgba(0,0,0,0.4)'
  101. }
  102. },
  103. animationEasing: 'elasticOut',
  104. animationDuration: 800
  105. }
  106. });
  107. zrUtil.mixin(BoxplotSeries, seriesModelMixin, true);
  108. var _default = BoxplotSeries;
  109. module.exports = _default;