@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
|
@@ -725,25 +725,35 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
725
725
|
var _this_1 = this;
|
|
726
726
|
var _a = this.props, legendProps = _a.legendProps, _b = _a.allowMultipleShapesForPoints, allowMultipleShapesForPoints = _b === void 0 ? false : _b;
|
|
727
727
|
var isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);
|
|
728
|
-
var
|
|
729
|
-
|
|
728
|
+
var mapLegendToPoints = {};
|
|
729
|
+
data.forEach(function (point) {
|
|
730
|
+
if (point.legend) {
|
|
731
|
+
if (!mapLegendToPoints[point.legend]) {
|
|
732
|
+
mapLegendToPoints[point.legend] = [];
|
|
733
|
+
}
|
|
734
|
+
mapLegendToPoints[point.legend].push(point);
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
var legendDataItems = Object.entries(mapLegendToPoints).map(function (_a) {
|
|
738
|
+
var legendTitle = _a[0], points = _a[1];
|
|
739
|
+
var representativePoint = points[0];
|
|
730
740
|
// mapping data to the format Legends component needs
|
|
731
|
-
var legend = __assign(__assign({ title:
|
|
741
|
+
var legend = __assign(__assign({ title: legendTitle, color: representativePoint.color, action: function () {
|
|
732
742
|
if (isLegendMultiSelectEnabled) {
|
|
733
|
-
_this_1._handleMultipleLineLegendSelectionAction(
|
|
743
|
+
points.forEach(function (p) { return _this_1._handleMultipleLineLegendSelectionAction(p); });
|
|
734
744
|
}
|
|
735
745
|
else {
|
|
736
|
-
_this_1._handleSingleLegendSelectionAction(
|
|
746
|
+
points.forEach(function (p) { return _this_1._handleSingleLegendSelectionAction(p); });
|
|
737
747
|
}
|
|
738
748
|
}, onMouseOutAction: function () {
|
|
739
749
|
_this_1.setState({ activeLegend: '' });
|
|
740
750
|
}, hoverAction: function () {
|
|
741
751
|
_this_1._handleChartMouseLeave();
|
|
742
|
-
_this_1.setState({ activeLegend:
|
|
743
|
-
} }, (
|
|
744
|
-
shape:
|
|
752
|
+
_this_1.setState({ activeLegend: legendTitle });
|
|
753
|
+
} }, (representativePoint.legendShape && {
|
|
754
|
+
shape: representativePoint.legendShape,
|
|
745
755
|
})), (allowMultipleShapesForPoints && {
|
|
746
|
-
shape: Points[
|
|
756
|
+
shape: Points[representativePoint.index % Object.keys(pointTypes).length],
|
|
747
757
|
}));
|
|
748
758
|
return legend;
|
|
749
759
|
});
|