boxPlot.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * @Author: your name
  3. * @Date: 2024-11-20 09:14:10
  4. * @LastEditTime: 2024-11-27 17:06:24
  5. * @LastEditors: bogon
  6. * @Description: In User Settings Edit
  7. * @FilePath: /performance-test/src/assets/js/constants/echarts-config/boxPlot.js
  8. */
  9. //箱线图-boxPlot
  10. //不同季节的风速分布
  11. import { colorPalette } from "../color";
  12. export const option = {
  13. color: colorPalette,
  14. title: {
  15. text: "季节的风速分布",
  16. },
  17. tooltip: {
  18. trigger: "item",
  19. },
  20. legend: {
  21. top: "bottom",
  22. },
  23. toolbox: {
  24. feature: {
  25. dataView: { show: true, readOnly: false },
  26. // magicType: { show: true, type: ["line", "bar"] },
  27. restore: { show: true },
  28. saveAsImage: { show: true },
  29. },
  30. },
  31. dataZoom: [
  32. {
  33. type: "inside",
  34. xAxisIndex: [0, 1],
  35. start: 0,
  36. end: 100,
  37. },
  38. {
  39. show: true,
  40. xAxisIndex: [0, 1],
  41. type: "slider",
  42. bottom: 10,
  43. start: 0,
  44. end: 100,
  45. },
  46. ],
  47. xAxis: {
  48. type: "category",
  49. data: ["春季", "夏季", "秋季", "冬季"],
  50. name: "季节",
  51. },
  52. yAxis: {
  53. type: "value",
  54. name: "风速 (m/s)",
  55. },
  56. series: [
  57. {
  58. name: "风速分布",
  59. type: "boxplot",
  60. data: [
  61. [1.5, 5, 7, 12, 20], // 最小值, Q1, 中位数, Q3, 最大值
  62. [2, 6, 8, 14, 22],
  63. [1, 4, 6, 10, 18],
  64. [0.5, 3, 5, 8, 15],
  65. ],
  66. },
  67. ],
  68. };