config.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. //图模块公共配置
  2. // 图默认配置
  3. export const chartDefaultOpts={
  4. //图表配置
  5. chart: {
  6. spacingTop: 30,
  7. backgroundColor: "rgba(0,0,0,0)",
  8. },
  9. title: {
  10. enabled: false
  11. },
  12. exporting: {
  13. enabled: false,
  14. },
  15. boost: {
  16. useGPUTranslations: true,
  17. },
  18. //默认颜色配置
  19. colors:['#00f','#f00','#999','#000','#7cb5ec', '#90ed7d', '#f7a35c', '#8085e9',
  20. '#f15c80', '#e4d354', '#2b908f', '#f45b5b', '#91e8e1'],
  21. //版权信息
  22. credits: {enabled:false},
  23. //数据列通用配置
  24. plotOptions: {
  25. series: {
  26. turboThreshold: 0, //不限制数据点个数
  27. boostThreshold:0,
  28. animation: {
  29. duration: 1000
  30. }
  31. },
  32. areaspline: {
  33. lineWidth: 1,
  34. stacking: 'normal',
  35. marker: {
  36. enabled: false,
  37. },
  38. // fillOpacity: 0.5,
  39. },
  40. column:{
  41. pointPadding: 0.05,
  42. stacking: 'normal',
  43. },
  44. scatter: {
  45. turboThreshold: 0,
  46. marker: {
  47. symbol: 'circle',
  48. radius: 5,
  49. states: {
  50. hover: {
  51. enabled: true,
  52. }
  53. }
  54. },
  55. states: {
  56. hover: {
  57. marker: {
  58. enabled: true
  59. }
  60. }
  61. }
  62. }
  63. },
  64. //范围选择器
  65. rangeSelector: {
  66. enabled: false,
  67. selected: 2,
  68. },
  69. //悬浮提示框
  70. tooltip: {
  71. split: false,
  72. shared: true,
  73. dateTimeLabelFormats: {
  74. // 时间格式化字符
  75. day: '%Y/%m/%d',
  76. week: "%Y/%m",
  77. month: '%Y/%m',
  78. year: '%Y/%m',
  79. },
  80. xDateFormat:'%Y/%m/%d',
  81. className:'chart-tooltips-box'
  82. // formatter:function(e){
  83. // return `<p>${this.x}</p><p>aaa</p>`
  84. // // return e
  85. // }
  86. // outside: true,
  87. // valueDecimals: 4,
  88. },
  89. //图例
  90. legend: {
  91. enabled: true,
  92. verticalAlign: 'top',
  93. margin:3,
  94. // layout: 'vertical'
  95. },
  96. //滚动条
  97. scrollbar: {
  98. enabled: false,
  99. },
  100. //导航器
  101. navigator: {
  102. enabled: false,
  103. },
  104. //范围选择器
  105. rangeSelector: {
  106. enabled: false,
  107. },
  108. xAxis: {
  109. tickPosition: 'inside',
  110. lineColor: '#bfbfbf',
  111. tickColor: '#bfbfbf',
  112. tickLength:5,
  113. type: 'datetime',
  114. ordinal: false,
  115. dateTimeLabelFormats: {
  116. day: '%y/%m',
  117. week: '%y/%m',
  118. month: '%y/%m',
  119. year: '%y/%m',
  120. }
  121. // gridLineWidth:0
  122. }
  123. }
  124. /* 季节性图配置 */
  125. export const seasonOptions = {
  126. //默认颜色配置
  127. colors:['#4B0082','#7FFFAA','#FF4500','#808000','#EEE8AA','#849EC1','#8A4294','#578B5A','#FDA8C7','#53B3FF','#999999','#000000','#FFDF0C','#FF0000','#0033FF'],
  128. yAxis: {
  129. lineWidth: 1,
  130. lineColor: '#bfbfbf',
  131. tickColor: '#bfbfbf',
  132. offset: 0,
  133. opposite: false,
  134. reversed: false,
  135. visible: true,
  136. gridLineWidth: 0,
  137. tickWidth: 1,
  138. tickLength:5,
  139. tickPosition: 'inside',
  140. endOnTick: false,
  141. startOnTick: false,
  142. showLastLabel: true, //显示最后刻度值
  143. tickPixelInterval: 50
  144. }
  145. }
  146. // 散点x轴
  147. export const scatterXAxis = {
  148. tickPosition: 'inside',
  149. lineColor: '#bfbfbf',
  150. tickColor: '#bfbfbf',
  151. tickLength:5,
  152. ordinal: false,
  153. type: 'linear',
  154. }
  155. // 基础y轴配置
  156. export const basicYAxis = {
  157. tickWidth: 1,
  158. tickLength: 5,
  159. lineWidth: 1,
  160. lineColor: '#bfbfbf',
  161. tickColor: '#bfbfbf',
  162. // offset: 0,
  163. visible: true,
  164. gridLineWidth: 0,
  165. tickPosition: 'inside',
  166. endOnTick: false,
  167. startOnTick: false,
  168. showLastLabel: true,
  169. tickPixelInterval: 50,
  170. }
  171. //基础x轴配置
  172. export const basicXAxis={
  173. tickPosition: 'inside',
  174. lineColor: '#bfbfbf',
  175. tickColor: '#bfbfbf',
  176. tickLength:5,
  177. type: 'datetime',
  178. ordinal: false,
  179. dateTimeLabelFormats: {
  180. day: '%y/%m',
  181. week: '%y/%m',
  182. month: '%y/%m',
  183. year: '%y/%m',
  184. },
  185. xDateFormat:'%Y-%m-%d'
  186. }
  187. //领先频度对应英文
  188. export const leadUnitEnMap={
  189. '年': 'Y',
  190. '季': 'Q',
  191. '月': 'M',
  192. '周': 'W',
  193. '天': 'D',
  194. }
  195. //相关性图表单位英文Map
  196. export const relevanceUnitEnMap={
  197. '年': 'Year',
  198. '季': 'Season',
  199. '月': 'Month',
  200. '周': 'Week',
  201. '天': 'Day',
  202. }
  203. //图表年份筛选项
  204. export const yearSelectOpt = [
  205. {
  206. name: '15年至今',
  207. value: 3,
  208. },
  209. // {
  210. // name: '18年至今',
  211. // value: 7,
  212. // },
  213. // {
  214. // name: '19年至今',
  215. // value: 8,
  216. // },
  217. {
  218. name: '20年至今',
  219. value: 9,
  220. },
  221. {
  222. name: '21年至今',
  223. value: 4,
  224. },
  225. {
  226. name: '22年至今',
  227. value: 11
  228. },
  229. ]
  230. // 拥有相同配置的图表类型集合
  231. export const sameOptionType=[1,3,4,5,6]