@fluentui/react-charting 5.23.89 → 5.23.90
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/CHANGELOG.json +28 -1
- package/CHANGELOG.md +13 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/LineChart/LineChart.base.js +19 -9
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.js +19 -9
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +19 -9
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/package.json +3 -3
|
@@ -728,25 +728,35 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
728
728
|
var _this_1 = this;
|
|
729
729
|
var _a = this.props, legendProps = _a.legendProps, _b = _a.allowMultipleShapesForPoints, allowMultipleShapesForPoints = _b === void 0 ? false : _b;
|
|
730
730
|
var isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);
|
|
731
|
-
var
|
|
732
|
-
|
|
731
|
+
var mapLegendToPoints = {};
|
|
732
|
+
data.forEach(function (point) {
|
|
733
|
+
if (point.legend) {
|
|
734
|
+
if (!mapLegendToPoints[point.legend]) {
|
|
735
|
+
mapLegendToPoints[point.legend] = [];
|
|
736
|
+
}
|
|
737
|
+
mapLegendToPoints[point.legend].push(point);
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
var legendDataItems = Object.entries(mapLegendToPoints).map(function (_a) {
|
|
741
|
+
var legendTitle = _a[0], points = _a[1];
|
|
742
|
+
var representativePoint = points[0];
|
|
733
743
|
// mapping data to the format Legends component needs
|
|
734
|
-
var legend = tslib_1.__assign(tslib_1.__assign({ title:
|
|
744
|
+
var legend = tslib_1.__assign(tslib_1.__assign({ title: legendTitle, color: representativePoint.color, action: function () {
|
|
735
745
|
if (isLegendMultiSelectEnabled) {
|
|
736
|
-
_this_1._handleMultipleLineLegendSelectionAction(
|
|
746
|
+
points.forEach(function (p) { return _this_1._handleMultipleLineLegendSelectionAction(p); });
|
|
737
747
|
}
|
|
738
748
|
else {
|
|
739
|
-
_this_1._handleSingleLegendSelectionAction(
|
|
749
|
+
points.forEach(function (p) { return _this_1._handleSingleLegendSelectionAction(p); });
|
|
740
750
|
}
|
|
741
751
|
}, onMouseOutAction: function () {
|
|
742
752
|
_this_1.setState({ activeLegend: '' });
|
|
743
753
|
}, hoverAction: function () {
|
|
744
754
|
_this_1._handleChartMouseLeave();
|
|
745
|
-
_this_1.setState({ activeLegend:
|
|
746
|
-
} }, (
|
|
747
|
-
shape:
|
|
755
|
+
_this_1.setState({ activeLegend: legendTitle });
|
|
756
|
+
} }, (representativePoint.legendShape && {
|
|
757
|
+
shape: representativePoint.legendShape,
|
|
748
758
|
})), (allowMultipleShapesForPoints && {
|
|
749
|
-
shape: index_3.Points[
|
|
759
|
+
shape: index_3.Points[representativePoint.index % Object.keys(index_3.pointTypes).length],
|
|
750
760
|
}));
|
|
751
761
|
return legend;
|
|
752
762
|
});
|