sea-chart 2.0.20 → 2.0.21
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.
|
@@ -614,8 +614,10 @@ class ChartComponent extends _react.Component {
|
|
|
614
614
|
const legendData = _utils.BaseUtils.sortDataByGroupName((0, _lodashEs.cloneDeep)(data), legendName, groupColumn, chart);
|
|
615
615
|
const {
|
|
616
616
|
width: chartWidth,
|
|
617
|
+
height: chartHeight,
|
|
617
618
|
insertPadding,
|
|
618
|
-
rightLegendSpace
|
|
619
|
+
rightLegendSpace,
|
|
620
|
+
bottomLegendSpace
|
|
619
621
|
} = this.chartBoundingClientRect;
|
|
620
622
|
const groupsData = this.getLegendDataGroups(legendData);
|
|
621
623
|
const legendWrapper = this.chart.append('g').attr('class', 'legend-wrapper');
|
|
@@ -688,7 +690,8 @@ class ChartComponent extends _react.Component {
|
|
|
688
690
|
} = g.node().parentNode.getBoundingClientRect();
|
|
689
691
|
groupTranslateY = groupTranslateY + height + legendItemMargin;
|
|
690
692
|
}
|
|
691
|
-
|
|
693
|
+
const curTranslateY = bottomLegendSpace ? chartHeight - bottomLegendSpace : groupTranslateY; // pageNavigator offset bottom
|
|
694
|
+
g.attr('transform', "translate(".concat(groupTranslateX, ", ").concat(curTranslateY, ")"));
|
|
692
695
|
});
|
|
693
696
|
}
|
|
694
697
|
};
|
|
@@ -53,16 +53,18 @@ class Scatter extends _chartComponent.default {
|
|
|
53
53
|
} = this.props;
|
|
54
54
|
data = _utils.BaseUtils.formatEmptyName(data, '', _intl.default.get('Empty'));
|
|
55
55
|
if (!Array.isArray(data)) return;
|
|
56
|
-
this.transformStringToNumber(data);
|
|
56
|
+
data = this.transformStringToNumber(data);
|
|
57
57
|
this.draw(data);
|
|
58
58
|
this.renderAxisLabel(this.props.chart, this.props.tables, this.container);
|
|
59
59
|
(0, _utils.isFunction)(customRender) && customRender(this.chart);
|
|
60
60
|
};
|
|
61
61
|
this.transformStringToNumber = data => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
item.
|
|
62
|
+
const newData = (0, _lodashEs.cloneDeep)(data);
|
|
63
|
+
newData.forEach(item => {
|
|
64
|
+
item.name = item.original_value.name;
|
|
65
|
+
item.value = item.original_value.value;
|
|
65
66
|
});
|
|
67
|
+
return newData;
|
|
66
68
|
};
|
|
67
69
|
this.getFillColor = data => {
|
|
68
70
|
const {
|
package/package.json
CHANGED