Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
96087349
Commit
96087349
authored
Mar 02, 2023
by
崔佳豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(BasicChart): 开启系列色
parent
7a46e1dd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
default.js
packages/base-components/BasicChart/src/utils/default.js
+8
-2
global.js
packages/base-components/BasicChart/src/utils/global.js
+7
-2
No files found.
packages/base-components/BasicChart/src/utils/default.js
View file @
96087349
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
{
DEF_COLORS
,
DEF_GRAD_COLORS
,
colorOfSeries
,
toGRADColorForLine
}
from
'./color'
;
import
{
DEF_COLORS
,
DEF_GRAD_COLORS
,
colorOfSeries
,
toGRADColorForLine
,
buildDefaultColors
,
}
from
'./color'
;
import
{
isArray
}
from
'./types'
;
import
{
isArray
}
from
'./types'
;
import
{
isAxisChart
,
isLineType
}
from
'./chart'
;
import
{
isAxisChart
,
isLineType
}
from
'./chart'
;
import
{
buildDefaultTooltip
}
from
'./tooltip'
;
import
{
buildDefaultTooltip
}
from
'./tooltip'
;
...
@@ -222,7 +228,7 @@ export const buildDefaultSeries = (option) => {
...
@@ -222,7 +228,7 @@ export const buildDefaultSeries = (option) => {
export
const
buildDefaultOption
=
(
option
)
=>
{
export
const
buildDefaultOption
=
(
option
)
=>
{
const
exports
=
{};
const
exports
=
{};
// exports.color = DEF_COLORS
;
exports
.
color
=
buildDefaultColors
()
;
exports
.
title
=
buildDefaultTitle
(
option
);
exports
.
title
=
buildDefaultTitle
(
option
);
(
option
.
dataZoom
==
undefined
||
option
.
dataZoom
===
null
)
&&
(
option
.
dataZoom
==
undefined
||
option
.
dataZoom
===
null
)
&&
(
exports
.
dataZoom
=
defaultDataZoom
);
(
exports
.
dataZoom
=
defaultDataZoom
);
...
...
packages/base-components/BasicChart/src/utils/global.js
View file @
96087349
...
@@ -2,6 +2,7 @@ import _ from 'lodash';
...
@@ -2,6 +2,7 @@ import _ from 'lodash';
/** 图表全局配置 非echarts配置,自定义的一些全局配置 */
/** 图表全局配置 非echarts配置,自定义的一些全局配置 */
export
const
globalConfig
=
{};
export
const
globalConfig
=
{};
let
unsetPrimaryColor
=
true
;
/**
/**
* 注册全局配置的方法 项目中注册一次即可,在项目入口或者初始化完成之后进行注册 或者有切换全局配置需求时,重新注册覆盖
* 注册全局配置的方法 项目中注册一次即可,在项目入口或者初始化完成之后进行注册 或者有切换全局配置需求时,重新注册覆盖
...
@@ -15,6 +16,8 @@ export const injectGlobalConfig = (config) => {
...
@@ -15,6 +16,8 @@ export const injectGlobalConfig = (config) => {
if
(
Object
.
prototype
.
toString
.
call
(
config
)
!==
'[object Object]'
)
if
(
Object
.
prototype
.
toString
.
call
(
config
)
!==
'[object Object]'
)
throw
new
TypeError
(
'illegal params, config must be an object!'
);
throw
new
TypeError
(
'illegal params, config must be an object!'
);
if
(
globalConfig
.
hasOwnProperty
(
'primaryColor'
))
unsetPrimaryColor
=
false
;
globalConfig
=
_
.
merge
(
globalConfig
,
config
);
globalConfig
=
_
.
merge
(
globalConfig
,
config
);
};
};
...
@@ -25,6 +28,8 @@ export const injectGlobalConfig = (config) => {
...
@@ -25,6 +28,8 @@ export const injectGlobalConfig = (config) => {
*/
*/
export
const
runtimeValidate
=
()
=>
{
export
const
runtimeValidate
=
()
=>
{
// primaryColor 主题色
// primaryColor 主题色
globalConfig
.
primaryColor
||
if
(
!
globalConfig
.
primaryColor
||
unsetPrimaryColor
)
{
(
globalConfig
.
primaryColor
=
window
.
globalConfig
?.
variableTheme
?.
primaryColor
??
'#1685FF'
);
globalConfig
.
primaryColor
=
window
.
globalConfig
?.
variableTheme
?.
primaryColor
??
'#1685FF'
;
unsetPrimaryColor
=
true
;
}
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment