sea-chart 0.0.29 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/view/wrapper/bar.js
CHANGED
|
@@ -82,7 +82,14 @@ class Bar extends ChartComponent {
|
|
|
82
82
|
stroke: '#fff',
|
|
83
83
|
lineWidth: 1
|
|
84
84
|
}
|
|
85
|
-
}).position('name*value').size(singleBarWidth).
|
|
85
|
+
}).position('name*value').size(singleBarWidth).color('value', value => {
|
|
86
|
+
const color = getLabelColor({
|
|
87
|
+
chart: chart.config,
|
|
88
|
+
colorRules,
|
|
89
|
+
value
|
|
90
|
+
});
|
|
91
|
+
return color || chartBarColor;
|
|
92
|
+
}).tooltip('name*value', (name, value) => {
|
|
86
93
|
return {
|
|
87
94
|
title: y_axis_summary_type === CHART_SUMMARY_TYPE.COUNT ? intl.get('Amount') : intl.get(CHART_SUMMARY_SHOW[y_axis_summary_method]),
|
|
88
95
|
value: BaseUtils.getSummaryValueDisplayString(summaryColumn, value, y_axis_summary_method),
|
|
@@ -95,16 +102,11 @@ class Bar extends ChartComponent {
|
|
|
95
102
|
}
|
|
96
103
|
}
|
|
97
104
|
}).style('value', value => {
|
|
98
|
-
const color = getLabelColor({
|
|
99
|
-
chart: chart.config,
|
|
100
|
-
colorRules,
|
|
101
|
-
value
|
|
102
|
-
});
|
|
103
105
|
return {
|
|
104
|
-
fill: color || chartBarColor,
|
|
105
106
|
radius: [singleBarRadius, singleBarRadius, 0, 0]
|
|
106
107
|
};
|
|
107
108
|
});
|
|
109
|
+
this.chart.legend(false);
|
|
108
110
|
this.setToolTip();
|
|
109
111
|
isFunction(customRender) && customRender(this.chart);
|
|
110
112
|
this.setNameLabelAndTooltip(theme, this.labelCount);
|
|
@@ -444,7 +444,7 @@ export default class ChartComponent extends Component {
|
|
|
444
444
|
domStyles: {
|
|
445
445
|
'g2-tooltip': {
|
|
446
446
|
boxSizing: 'border-box',
|
|
447
|
-
|
|
447
|
+
minWidth: '178px',
|
|
448
448
|
borderRadius: '3px',
|
|
449
449
|
border: '1px solid #e2e2e2',
|
|
450
450
|
backgroundColor: '#fff',
|
|
@@ -465,7 +465,8 @@ export default class ChartComponent extends Component {
|
|
|
465
465
|
textOverflow: 'ellipsis'
|
|
466
466
|
},
|
|
467
467
|
'g2-tooltip-list-item': {
|
|
468
|
-
marginBottom: '8px'
|
|
468
|
+
marginBottom: '8px',
|
|
469
|
+
display: 'flex'
|
|
469
470
|
},
|
|
470
471
|
'g2-tooltip-marker': {
|
|
471
472
|
width: '12px',
|
|
@@ -476,7 +477,7 @@ export default class ChartComponent extends Component {
|
|
|
476
477
|
'g2-tooltip-name': {
|
|
477
478
|
display: 'inline-block',
|
|
478
479
|
fontSize: '12px',
|
|
479
|
-
|
|
480
|
+
minWidth: '80px',
|
|
480
481
|
whiteSpace: 'nowrap',
|
|
481
482
|
overflow: 'hidden',
|
|
482
483
|
lineHeight: '12px',
|
|
@@ -80,9 +80,14 @@ class HorizontalBar extends HorizontalComponent {
|
|
|
80
80
|
stroke: '#fff',
|
|
81
81
|
lineWidth: 1
|
|
82
82
|
}
|
|
83
|
-
}).position('name*value')
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
}).position('name*value').color('value', value => {
|
|
84
|
+
const color = getLabelColor({
|
|
85
|
+
chart: chart.config,
|
|
86
|
+
colorRules,
|
|
87
|
+
value
|
|
88
|
+
});
|
|
89
|
+
return color || chartBarColor;
|
|
90
|
+
}).size(singleBarWidth).tooltip('name*value', (name, value) => {
|
|
86
91
|
return {
|
|
87
92
|
title: horizontal_axis_summary_type === CHART_SUMMARY_TYPE.COUNT ? intl.get('Amount') : intl.get(CHART_SUMMARY_SHOW[horizontal_axis_summary_method]),
|
|
88
93
|
value: BaseUtils.getSummaryValueDisplayString(summaryColumn, value, horizontal_axis_summary_method),
|
|
@@ -95,16 +100,11 @@ class HorizontalBar extends HorizontalComponent {
|
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
102
|
}).style('value', value => {
|
|
98
|
-
const color = getLabelColor({
|
|
99
|
-
chart: chart.config,
|
|
100
|
-
colorRules,
|
|
101
|
-
value
|
|
102
|
-
});
|
|
103
103
|
return {
|
|
104
|
-
fill: color || chartBarColor,
|
|
105
104
|
radius: [singleBarRadius, singleBarRadius, 0, 0]
|
|
106
105
|
};
|
|
107
106
|
});
|
|
107
|
+
this.chart.legend(false);
|
|
108
108
|
this.setToolTip();
|
|
109
109
|
this.setNameLabelAndTooltip(theme, this.labelCount);
|
|
110
110
|
this.setValueLabel(theme);
|