index.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. import { EChartsOption } from "echarts"
  2. // 颜色预设集合
  3. export const colorPreset = [
  4. {
  5. name: '清新',
  6. color: ['#00a8e1', '#99cc00', '#e30039', '#fcd300', '#800080']
  7. },
  8. {
  9. name: '复古',
  10. color: ['#FFA69E', '#FAE3D9', '#B8F2E6', '#56E39F', '#3A837D']
  11. },
  12. {
  13. name: '商务',
  14. color: ['#194f97', '#555555', '#bd6b08', '#00686b', '#c82d31']
  15. },
  16. {
  17. name: '经典',
  18. color: ['#002c53', '#ffa510', '#0c84c6', '#ffffff', '#f74d4d']
  19. },
  20. {
  21. name: '怀旧',
  22. color: ['#3b6291', '#943c39', '#779043', '#624c7c', '#388498']
  23. }
  24. ]
  25. // 图表默认配置项
  26. export const chartDefaultConfig: EChartsOption = {
  27. // 调色盘-预设颜色
  28. color: colorPreset[0].color,
  29. // 标题
  30. title: {
  31. show: true,
  32. left: "center",
  33. top: 8,
  34. textStyle: {
  35. color: "#FFFFFFFF",
  36. fontSize: 16,
  37. fontWeight: "normal",
  38. },
  39. },
  40. // 图例
  41. legend: {
  42. textStyle: {
  43. color: "#FFFFFFFF",
  44. },
  45. top: 32,
  46. },
  47. // 系列
  48. series: [{
  49. }],
  50. // 布局
  51. grid: {
  52. bottom: 34,
  53. right: 20,
  54. top: 60,
  55. },
  56. // 提示框
  57. tooltip: {},
  58. // x轴
  59. xAxis: {
  60. type: "category",
  61. axisLabel: {
  62. color: "#9fadbf",
  63. },
  64. name: ''
  65. },
  66. // y轴
  67. yAxis: {
  68. axisLabel: {
  69. color: "#9fadbf",
  70. },
  71. splitLine: {
  72. lineStyle: {
  73. type: "dashed",
  74. color: "#36485f",
  75. },
  76. },
  77. },
  78. }
  79. // 组件容器基本设置
  80. export const containerDefaultConfig = {
  81. /* ===================================== 通用容器样式 ============================================ */
  82. style: {
  83. background: {
  84. type: "color", // none, color, image
  85. color: "rgba(0, 0, 0, 0.1)",
  86. image: "",
  87. fillType: "",
  88. },
  89. border: {
  90. type: "none",
  91. color: "#000",
  92. width: 0,
  93. },
  94. borderRadius: {
  95. type: "all", // all, custom
  96. value: 2, // 整体圆角值
  97. unit: "px", // 单位
  98. units: ["px", "%"], // 单位列表
  99. topLeft: 0,
  100. topRight: 0,
  101. bottomLeft: 0,
  102. bottomRight: 0,
  103. },
  104. boxShadow: {
  105. enabled: false,
  106. color: "#000",
  107. offsetX: 0,
  108. offsetY: 0,
  109. blurRadius: 0,
  110. spreadRadius: 0,
  111. inset: false,
  112. },
  113. backdropFilter: {
  114. enabled: false,
  115. blur: 0,
  116. }
  117. },
  118. /* ===================================== 通用容器属性 ============================================ */
  119. props: {
  120. width: 0,
  121. height: 0,
  122. x: 0,
  123. y: 0,
  124. paddingLeft: 0,
  125. paddingRight: 0,
  126. paddingTop: 0,
  127. paddingBottom: 0,
  128. rotateX: 0,
  129. rotateY: 0,
  130. rotateZ: 0,
  131. opacity: 1,
  132. },
  133. };