chartSeting.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. import * as echarts from "echarts";
  2. export const galleryLine = {
  3. tooltip: {
  4. trigger: "axis",
  5. },
  6. grid: {
  7. top: 28,
  8. left: 10,
  9. right: 26,
  10. bottom: 0,
  11. containLabel: true,
  12. },
  13. xAxis: {
  14. name: "时间",
  15. nameLocation: "end",
  16. nameGap: 4,
  17. nameTextStyle: {
  18. fontSize: 10,
  19. color: "#9F9F9F"
  20. },
  21. type: 'category',
  22. // 分割线
  23. axisTick: {
  24. show: false,
  25. },
  26. splitLine: {
  27. show: false,
  28. },
  29. axisLabel: {
  30. // interval: 0,
  31. rotate: 15,
  32. margin: 14,
  33. textStyle: {
  34. color: "rgba(187, 187, 187, 0.36)",
  35. fontSize: 10
  36. },
  37. },
  38. data: ['9/1', '9/7', '9/13', '9/19', '9/25', '10/1', '10/7']
  39. },
  40. yAxis: {
  41. name: "xx指标",
  42. nameLocation: "end",
  43. type: 'value',
  44. nameTextStyle: {
  45. fontSize: 10,
  46. color: "#9F9F9F"
  47. },
  48. axisTick: {
  49. show: false,
  50. },
  51. axisLine: {
  52. show: true,
  53. lineStyle: {
  54. color: "rgba(187, 187, 187, 0.36)",
  55. },
  56. },
  57. axisLabel: {
  58. textStyle: {
  59. color: "#666666",
  60. fontSize: 10
  61. },
  62. },
  63. // 分割线
  64. splitLine: {
  65. show: false,
  66. lineStyle: {
  67. color: "rgba(255, 255, 255, 0.1)",
  68. },
  69. },
  70. },
  71. series: [
  72. {
  73. data: [40, 58, 62, 64, 68, 74, 80],
  74. type: 'line',
  75. symbolSize: 6,
  76. itemStyle: {
  77. color: '#FFD489' // 设置数据点颜色为红色
  78. },
  79. // itemStyle: {
  80. // color: '#CECECE' // 设置数据点颜色
  81. // },
  82. // lineStyle: {
  83. // type: 'dashed', // 设置线条为虚线
  84. // width: 2, // 设置线条宽度
  85. // color: '#CECECE' // 设置线条颜色
  86. // }
  87. }
  88. ],
  89. }
  90. export const galleryIndicatorLine = {
  91. tooltip: {
  92. trigger: "axis",
  93. },
  94. legend: {
  95. icon: 'roundRect',
  96. top: 0,
  97. left: 0,
  98. orient: 'horizontal',
  99. itemWidth: 6,
  100. itemHeight: 2,
  101. itemGap: 4,
  102. textStyle: {
  103. align: 'left',
  104. fontSize: 10,
  105. },
  106. data: [
  107. { name: '褪绿率', textStyle: { color: '#66B9FB' }, itemStyle: {color: "#66B9FB"} },
  108. { name: '花芽率', textStyle: { color: '#1B98FC' }, itemStyle: {color: "#1B98FC"} },
  109. { name: '花蕾率', textStyle: { color: '#036CC0' }, itemStyle: {color: "#036CC0"} },
  110. { name: '生长异常', textStyle: { color: '#F7BE5A' }, itemStyle: {color: "#F7BE5A"} },
  111. { name: '病虫异常', textStyle: { color: '#F99851' }, itemStyle: {color: "#F99851"} }
  112. ]
  113. },
  114. grid: {
  115. top: 30,
  116. left: 8,
  117. right: 18,
  118. bottom: 4,
  119. containLabel: true,
  120. },
  121. xAxis: {
  122. type: 'category',
  123. boundaryGap: false,
  124. // 分割线
  125. axisTick: {
  126. show: false,
  127. },
  128. splitLine: {
  129. show: false,
  130. },
  131. axisLabel: {
  132. // interval: 0,
  133. rotate: 15,
  134. margin: 14,
  135. textStyle: {
  136. color: "#999999",
  137. fontSize: 12
  138. },
  139. },
  140. axisLine: {
  141. lineStyle: {
  142. color: "#333333",
  143. }
  144. },
  145. data: ['9/1', '9/7', '9/13', '9/19', '9/25', '10/1', '10/7']
  146. },
  147. yAxis: [{
  148. type: 'value',
  149. offset: 6,
  150. axisTick: {
  151. show: false,
  152. },
  153. axisLine: {
  154. show: false,
  155. },
  156. axisLabel: {
  157. align: "center",
  158. textStyle: {
  159. color: "#999999",
  160. fontSize: 12
  161. },
  162. },
  163. // 分割线
  164. splitLine: {
  165. lineStyle: {
  166. type: [4, 3],
  167. dashOffset: 5,
  168. color: "#333333",
  169. },
  170. },
  171. min: 0, // 最小值固定为0
  172. max: 100, // 最大值固定为100
  173. splitNumber: 5, // 设置5个分割段
  174. }],
  175. series: [
  176. {
  177. name: "褪绿率",
  178. data: [
  179. ["9/1", 10],
  180. ["9/7", 30],
  181. ["9/13", 80],
  182. ],
  183. type: 'line',
  184. smooth: true,
  185. symbol: "none",
  186. itemStyle: { color: "#66B9FB" },
  187. lineStyle: {
  188. color: "#66B9FB", // 折线颜色为红色
  189. width: 2, // 线条宽度
  190. },
  191. },
  192. {
  193. name: "花芽率",
  194. data: [
  195. ["9/7", 8],
  196. ["9/19", 50],
  197. ["9/25", 80],
  198. ],
  199. type: 'line',
  200. smooth: true,
  201. symbol: "none",
  202. itemStyle: { color: "#1B98FC" },
  203. lineStyle: {
  204. color: "#1B98FC", // 折线颜色为红色
  205. width: 2, // 线条宽度
  206. },
  207. },
  208. {
  209. name: "花蕾率",
  210. data: [
  211. ["9/19", 12],
  212. ["9/25", 30],
  213. ["10/1", 60],
  214. ["10/7", 70],
  215. ],
  216. type: 'line',
  217. smooth: true,
  218. symbol: "none",
  219. itemStyle: { color: "#036CC0" },
  220. lineStyle: {
  221. color: "#036CC0", // 折线颜色为红色
  222. width: 2, // 线条宽度
  223. },
  224. },
  225. {
  226. name: "生长异常",
  227. data: [80, 88, 92, 84, 88, 74, 80],
  228. type: 'line',
  229. symbol: "none",
  230. smooth: true,
  231. itemStyle: { color: "#FFB82E" },
  232. lineStyle: {
  233. color: "#FFB82E", // 折线颜色为红色
  234. width: 2, // 线条宽度
  235. },
  236. },
  237. {
  238. name: "病虫异常",
  239. data: [40, 28, 22, 64, 28, 24, 40],
  240. type: 'line',
  241. smooth: true,
  242. symbol: "none",
  243. itemStyle: { color: "#FF7219" },
  244. lineStyle: {
  245. color: "#FF7219", // 折线颜色为红色
  246. width: 2, // 线条宽度
  247. },
  248. },
  249. ],
  250. }