config.js 4.3 KB

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