Skip to content

Commit

Permalink
Merge pull request #266 from antvis/fix-default-theme
Browse files Browse the repository at this point in the history
fix: 默认主题中axis label调整 & tooltip 样式 & column widthRation调整
  • Loading branch information
paleface001 committed Nov 19, 2019
2 parents 90ac31b + e38ff9c commit 37c7e9a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/geoms/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class ElementParser {
},
widthRatio: {
// 宽度所占的分类的比例
column: 2 / 3, // g2plot定制为2/3
column: 3 / 5, // g2plot定制
rose: 0.9999999, // 玫瑰图柱状占比 1
multiplePie: 1 / 1.3, // 多层的饼图、环图
},
Expand Down
3 changes: 3 additions & 0 deletions src/plots/bar/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export default class BaseBarLayer<T extends BarLayerConfig = BarLayerConfig> ext
},
label: {
visible: true,
style: {
fill: 'rgba(0, 0, 0, 0.65)',
},
},
title: {
visible: false,
Expand Down
4 changes: 2 additions & 2 deletions src/theme/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ export const DEFAULT_DARK_THEME = {
label: {
offset: 12,
style: {
fill: 'rgba(255, 255, 255, 0.95)',
fill: 'rgba(255, 255, 255, 0.65)',
lineWidth: 1,
},
},
tooltip: {
'g2-tooltip': {
backgroundColor: 'rgba(33,33,33, 0.95)',
boxShadow: '0px 0px 10px rgba(0,0,0,0.65)',
boxShadow: '0px 0px 8px rgba(0,0,0,0.65)',
color: 'rgba(255, 255, 255, 0.65)',
},
},
Expand Down
15 changes: 10 additions & 5 deletions src/theme/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const DEFAULT_GLOBAL_THEME = {
visible: true,
offset: 8,
style: {
fill: '#a0a4aa',
fill: 'rgba(0,0,0,0.45)',
fontSize: 12,
},
},
Expand All @@ -112,30 +112,30 @@ export const DEFAULT_GLOBAL_THEME = {
grid: {
visible: false,
style: {
stroke: '#e3e8ec',
stroke: 'rgba(0, 0, 0, 0.15)',
lineWidth: 1,
lineDash: [0, 0],
},
},
line: {
visible: false,
style: {
stroke: '#BFBFBF',
stroke: 'rgba(0, 0, 0, 0.45)',
lineWidth: 1,
},
},
tickLine: {
visible: true,
style: {
length: 4,
stroke: '#bdc8d3',
stroke: 'rgba(0, 0, 0, 0.45)',
lineWidth: 0.5,
},
},
label: {
visible: true,
style: {
fill: '#a0a4aa',
fill: 'rgba(0,0,0,0.45)',
fontSize: 12,
},
offset: 16,
Expand Down Expand Up @@ -199,4 +199,9 @@ export const DEFAULT_GLOBAL_THEME = {
lineWidth: 2,
},
},
tooltip: {
'g2-tooltip': {
boxShadow: '0px 0px 8px rgba(0,0,0,0.15)',
},
},
};

0 comments on commit 37c7e9a

Please sign in to comment.