scatter.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { colorPalette } from "../color";
  2. export const option = {
  3. color: colorPalette,
  4. title: {
  5. text: "风速分布",
  6. },
  7. xAxis: {
  8. name: "风向 (°)",
  9. type: "category",
  10. },
  11. yAxis: {
  12. name: "风速 (m/s)",
  13. type: "value",
  14. },
  15. legend: {
  16. top: "bottom",
  17. },
  18. toolbox: {
  19. feature: {
  20. dataView: { show: true, readOnly: false },
  21. // magicType: { show: true, type: ["line", "bar"] },
  22. restore: { show: true },
  23. saveAsImage: { show: true },
  24. },
  25. },
  26. series: [
  27. {
  28. name: "风速分布",
  29. type: "scatter",
  30. data: [
  31. ["145", "5"],
  32. ["90", "10"],
  33. ["80", "7"],
  34. ["270", "12"],
  35. ], // [风向, 风速, 数据点大小]
  36. // symbolSize: (data) => data[2], // 根据大小调整气泡尺寸
  37. renderMode: "webgl", // 启用 WebGL 渲染
  38. itemStyle: {
  39. shadowBlur: 10,
  40. shadowColor: "rgba(25, 100, 150, 0.5)",
  41. shadowOffsetY: 5,
  42. },
  43. },
  44. ],
  45. tooltip: {
  46. trigger: "item",
  47. },
  48. };