chart.ts 572 B

1234567891011121314151617181920212223242526
  1. import merge from 'lodash/merge'
  2. import pick from 'lodash/pick'
  3. /**
  4. * * ECharts option 统一前置处理
  5. * @param option
  6. */
  7. export const echartOptionProfixHandle = (option: any) => {
  8. option['backgroundColor'] = 'rgba(0,0,0,0)'
  9. return option
  10. }
  11. /**
  12. * * 合并 color 和全局配置项
  13. * @param option 配置
  14. * @param themeSetting 设置
  15. * @param excludes 排除元素
  16. * @returns object
  17. */
  18. export const mergeTheme = <T, U, E extends keyof U> (
  19. option: T,
  20. themeSetting: U,
  21. includes: E[] = []
  22. ) => {
  23. return merge(pick(themeSetting, includes), option)
  24. }