mysetTheme.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /**
  2. * echart自定义主题
  3. * Author: abner
  4. * Date: 2020-12-25
  5. * 注意:主题的优先级比setOption低
  6. */
  7. let myTheme = {
  8. // 全图默认背景
  9. // backgroundColor: 'rgba(0,0,0,0)',
  10. // 全图文字
  11. "textStyle": {
  12. color: '#fff',
  13. fontFamily: 'Microsoft YaHei UI',
  14. fontSize: 12,
  15. },
  16. // 默认色板
  17. "color": ['#838CFF', '#2AE3FF', '#FA7332', '#D797FF', '#fa2c7b', '#ff38e0', '#ffa235', '#04c5f3', '#0066fe', '#8932a5', '#c90444', '#cb9bff', '#434348', '#90ed7d'],
  18. //标题
  19. "title": {
  20. x: 'center', //位置默认居中
  21. textStyle: {
  22. fontFamily: 'Microsoft YaHei UI',
  23. fontSize: 14,
  24. color: '#fff' // 主标题文字颜色
  25. },
  26. subtextStyle: {
  27. color: '#aaa' // 副标题文字颜色
  28. }
  29. },
  30. // @图例
  31. "legend": {
  32. type: 'plain', //plain:普通图例 'scroll':可滚动翻页的图例。当图例数量较多时可以使用。
  33. orient: 'horizontal', //垂直 vertical | 水平 horizontal
  34. left: 'left', //位置默认左
  35. // bottom: '0',
  36. textStyle: {
  37. color: '#fff' // 图例文字颜色
  38. }
  39. },
  40. // @工具栏 此配置无法起效,必须在option中配置
  41. // "toolbox": {
  42. // show: true, // 默认显示
  43. // feature: {
  44. // dataZoom: {
  45. // yAxisIndex: 'none'
  46. // },
  47. // dataView: { readOnly: false },
  48. // magicType: { type: ['line', 'bar'] },
  49. // restore: {},
  50. // saveAsImage: {}
  51. // }
  52. // },
  53. // @纵轴
  54. "categoryAxis": {
  55. "axisLine": {
  56. "show": true,
  57. "lineStyle": {
  58. "color": "#008acd"
  59. }
  60. },
  61. "axisTick": { // 刻度线
  62. "show": true,
  63. "lineStyle": {
  64. "color": "#fff"
  65. }
  66. },
  67. "axisLabel": { // 刻度值
  68. "show": true,
  69. "textStyle": {
  70. "color": "#fff"
  71. }
  72. },
  73. "splitLine": { // 坐标轴在 grid 区域中的分隔线。默认数值轴(横向)显示,类目轴(纵向)不显示。
  74. "show": false,
  75. "lineStyle": {
  76. "color": [
  77. "#eee"
  78. ]
  79. }
  80. },
  81. "splitArea": { // 坐标轴在 grid 区域中的分隔区域,默认不显示。
  82. "show": false,
  83. "areaStyle": {
  84. "color": [
  85. "rgba(250,250,250,0.3)",
  86. "rgba(200,200,200,0.3)"
  87. ]
  88. }
  89. }
  90. },
  91. // @横轴
  92. "valueAxis": {
  93. "axisLine": {
  94. "show": true,
  95. "lineStyle": {
  96. "color": "#008acd"
  97. }
  98. },
  99. "axisTick": { // 刻度线
  100. "show": true,
  101. "lineStyle": {
  102. "color": "#fff"
  103. }
  104. },
  105. "axisLabel": { // 刻度值
  106. "show": true,
  107. "textStyle": {
  108. "color": "#fff"
  109. }
  110. },
  111. "splitLine": { // 坐标轴在 grid 区域中的分隔线。默认数值轴(横向)显示,类目轴(纵向)不显示。
  112. "show": true,
  113. "lineStyle": { // 分隔线的样式设置。
  114. "color": [
  115. "#ccc"
  116. ]
  117. }
  118. },
  119. "splitArea": { // 坐标轴在 grid 区域中的分隔区域,默认不显示。
  120. "show": false,
  121. "areaStyle": { // 分隔区域的样式设置。
  122. "color": [
  123. "rgba(250,250,250,0.3)",
  124. "rgba(200,200,200,0.3)"
  125. ]
  126. }
  127. }
  128. },
  129. // @数据滑竿
  130. "dataZoom": {
  131. "show": true,
  132. "backgroundColor": "rgba(47,69,84,0)",
  133. "dataBackgroundColor": "rgba(239,239,255,1)",
  134. "fillerColor": "rgba(182,162,222,0.2)",
  135. "handleColor": "#008acd",
  136. "handleSize": "100%",
  137. "textStyle": {
  138. "color": "#333333"
  139. }
  140. },
  141. "markPoint": {
  142. "label": {
  143. "color": "#eeeeee"
  144. },
  145. "emphasis": {
  146. "label": {
  147. "color": "#eeeeee"
  148. }
  149. }
  150. }
  151. }