line.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // 风速-功率曲线图
  2. // 用途:展示风速与风机输出功率之间的关系。
  3. // 适用场景:风机性能评估、功率曲线优化。
  4. // 实现建议:
  5. // 使用 ECharts 的折线图。
  6. // xAxis 为风速,yAxis 为功率。
  7. export const option = {
  8. title: {
  9. text: "风速-功率曲线图",
  10. },
  11. tooltip: {
  12. trigger: "axis",
  13. },
  14. legend: {
  15. top: "bottom",
  16. // data: ["Email", "Union Ads", "Video Ads", "Direct", "Search Engine"],
  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. xAxis: {
  27. type: "category",
  28. name: "风速 (m/s)",
  29. // boundaryGap: false,
  30. data: [5, 20, 35, 25, 10, 5],
  31. },
  32. yAxis: {
  33. name: "功率 (kW)",
  34. type: "value",
  35. nameLocation: "middle", // 设置名称位置,可以是 'start', 'middle' 或 'end'
  36. nameTextStyle: {
  37. fontSize: 14, // 文字大小
  38. color: "#333", // 文字颜色
  39. padding: [0, 0, 30, 0], // 文字与轴线的距离
  40. },
  41. },
  42. grid: {
  43. top: "20%",
  44. right: "20%",
  45. bottom: "10%",
  46. containLabel: true, // 包含标签在内
  47. },
  48. series: [
  49. {
  50. name: "功率曲线",
  51. type: "line",
  52. data: [300, 22, 249, 345, 234, 56, 73], // 风速与功率对应数据
  53. },
  54. ],
  55. };