Heatmap.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * @Author: your name
  3. * @Date: 2024-11-20 09:13:21
  4. * @LastEditTime: 2024-11-27 17:39:46
  5. * @LastEditors: bogon
  6. * @Description: In User Settings Edit
  7. * @FilePath: /performance-test/src/assets/js/constants/echarts-config/Heatmap.js
  8. */
  9. //Heatmap-热力图
  10. // 风速随时间和风向的分布
  11. import { colorPalette } from "../color";
  12. export const option = {
  13. color: colorPalette, // 使用 colorPalette 作为颜色设置
  14. title: {
  15. text: "风速随时间和风向的分布",
  16. },
  17. tooltip: {
  18. position: "top",
  19. },
  20. legend: {
  21. top: "bottom",
  22. },
  23. toolbox: {
  24. feature: {
  25. dataView: { show: true, readOnly: false },
  26. restore: { show: true },
  27. saveAsImage: { show: true },
  28. },
  29. },
  30. xAxis: {
  31. type: "category",
  32. data: ["00:00", "01:00", "02:00", "03:00"], // 时间
  33. name: "时间",
  34. },
  35. yAxis: {
  36. data: ["0°", "90°", "180°", "270°"], // 风向
  37. name: "风向",
  38. },
  39. visualMap: {
  40. calculable: true,
  41. realtime: false,
  42. orient: "vertical",
  43. right: 20,
  44. top: "center",
  45. color: ["#0d59b7", "#bee8ff"],
  46. },
  47. series: [
  48. {
  49. // name: "风速",
  50. type: "heatmap",
  51. data: [
  52. [0, 0, 5],
  53. [1, 0, 10],
  54. [2, 0, 15],
  55. [0, 1, 7],
  56. [1, 1, 8],
  57. [2, 1, 12],
  58. ], // [x, y, 风速值]
  59. emphasis: {
  60. itemStyle: {
  61. shadowBlur: 10,
  62. shadowColor: "rgba(0, 0, 0, 0.5)",
  63. },
  64. },
  65. },
  66. ],
  67. };