BoxplotSeries.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. var zrUtil = require("zrender/lib/core/util");
  2. var SeriesModel = require("../../model/Series");
  3. var _whiskerBoxCommon = require("../helper/whiskerBoxCommon");
  4. var seriesModelMixin = _whiskerBoxCommon.seriesModelMixin;
  5. var BoxplotSeries = SeriesModel.extend({
  6. type: 'series.boxplot',
  7. dependencies: ['xAxis', 'yAxis', 'grid'],
  8. // TODO
  9. // box width represents group size, so dimension should have 'size'.
  10. /**
  11. * @see <https://en.wikipedia.org/wiki/Box_plot>
  12. * The meanings of 'min' and 'max' depend on user,
  13. * and echarts do not need to know it.
  14. * @readOnly
  15. */
  16. defaultValueDimensions: ['min', 'Q1', 'median', 'Q3', 'max'],
  17. /**
  18. * @type {Array.<string>}
  19. * @readOnly
  20. */
  21. dimensions: null,
  22. /**
  23. * @override
  24. */
  25. defaultOption: {
  26. zlevel: 0,
  27. // 一级层叠
  28. z: 2,
  29. // 二级层叠
  30. coordinateSystem: 'cartesian2d',
  31. legendHoverLink: true,
  32. hoverAnimation: true,
  33. // xAxisIndex: 0,
  34. // yAxisIndex: 0,
  35. layout: null,
  36. // 'horizontal' or 'vertical'
  37. boxWidth: [7, 50],
  38. // [min, max] can be percent of band width.
  39. itemStyle: {
  40. normal: {
  41. color: '#fff',
  42. borderWidth: 1
  43. },
  44. emphasis: {
  45. borderWidth: 2,
  46. shadowBlur: 5,
  47. shadowOffsetX: 2,
  48. shadowOffsetY: 2,
  49. shadowColor: 'rgba(0,0,0,0.4)'
  50. }
  51. },
  52. animationEasing: 'elasticOut',
  53. animationDuration: 800
  54. }
  55. });
  56. zrUtil.mixin(BoxplotSeries, seriesModelMixin, true);
  57. var _default = BoxplotSeries;
  58. module.exports = _default;