@fluentui/react-charting 5.23.31 → 5.23.33
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 +73 -1
- package/CHANGELOG.md +27 -2
- package/dist/react-charting.d.ts +8 -0
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +2 -0
- package/lib/components/AreaChart/AreaChart.base.d.ts +5 -2
- package/lib/components/AreaChart/AreaChart.base.js +60 -33
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.d.ts +2 -0
- package/lib/components/CommonComponents/CartesianChart.base.js +17 -10
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +49 -21
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +4 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +81 -21
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/imageExporter.js +1 -1
- package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.base.d.ts +1 -0
- package/lib/components/DonutChart/DonutChart.base.js +11 -2
- package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.base.d.ts +1 -0
- package/lib/components/GaugeChart/GaugeChart.base.js +8 -0
- package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +4 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +35 -24
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.d.ts +3 -0
- package/lib/components/HeatMapChart/HeatMapChart.base.js +13 -2
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.d.ts +4 -0
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +8 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.js +11 -2
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.base.js +1 -15
- package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.d.ts +5 -0
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +4 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +61 -48
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +4 -2
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +53 -42
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/utilities/utilities.d.ts +1 -0
- package/lib/utilities/utilities.js +17 -0
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.d.ts +5 -2
- package/lib-amd/components/AreaChart/AreaChart.base.js +59 -32
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +2 -0
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +17 -10
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +48 -20
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +4 -0
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +85 -21
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/imageExporter.js +1 -1
- package/lib-amd/components/DeclarativeChart/imageExporter.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.base.d.ts +1 -0
- package/lib-amd/components/DonutChart/DonutChart.base.js +10 -1
- package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.base.d.ts +1 -0
- package/lib-amd/components/GaugeChart/GaugeChart.base.js +8 -0
- package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +4 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +34 -23
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.d.ts +3 -0
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +13 -2
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.types.d.ts +4 -0
- package/lib-amd/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +1 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +8 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.js +10 -1
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.base.js +1 -15
- package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +5 -0
- package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +4 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +60 -47
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +4 -2
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +52 -41
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +1 -0
- package/lib-amd/utilities/utilities.js +19 -1
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +5 -2
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +59 -32
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +2 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +17 -10
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +48 -20
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +4 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +85 -21
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -1
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.d.ts +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.base.js +10 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.d.ts +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +8 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +4 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +34 -23
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.d.ts +3 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +13 -2
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.d.ts +4 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +8 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +10 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +1 -15
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +5 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +4 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +60 -47
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +4 -2
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +52 -41
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +1 -0
- package/lib-commonjs/utilities/utilities.js +19 -1
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +3 -3
- package/src/components/HeatMapChart/HeatMapChart.types.ts +5 -0
- package/src/components/SankeyChart/SankeyChart.types.ts +6 -0
|
@@ -22,7 +22,7 @@ var MIN_DOMAIN_MARGIN = 8;
|
|
|
22
22
|
var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
23
23
|
tslib_1.__extends(VerticalBarChartBase, _super);
|
|
24
24
|
function VerticalBarChartBase(props) {
|
|
25
|
-
var _a
|
|
25
|
+
var _a;
|
|
26
26
|
var _this = _super.call(this, props) || this;
|
|
27
27
|
_this._isRtl = (0, Utilities_1.getRTL)();
|
|
28
28
|
_this._getDomainNRangeValues = function (points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
|
|
@@ -95,12 +95,12 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
95
95
|
dots));
|
|
96
96
|
};
|
|
97
97
|
_this._getCircleVisibilityAndRadius = function (xAxisPoint, legend) {
|
|
98
|
-
var
|
|
99
|
-
if (
|
|
100
|
-
if (xAxisPoint === activeXdataPoint &&
|
|
98
|
+
var activeXdataPoint = _this.state.activeXdataPoint;
|
|
99
|
+
if (!_this._noLegendHighlighted()) {
|
|
100
|
+
if (xAxisPoint === activeXdataPoint && _this._legendHighlighted(legend)) {
|
|
101
101
|
return { visibility: CircleVisbility.show, radius: 8 };
|
|
102
102
|
}
|
|
103
|
-
else if (
|
|
103
|
+
else if (_this._legendHighlighted(legend)) {
|
|
104
104
|
// Don't hide the circle to keep it focusable. For more information,
|
|
105
105
|
// see https://fuzzbomb.github.io/accessibility-demos/visually-hidden-focus-test.html
|
|
106
106
|
return { visibility: CircleVisbility.show, radius: 0.3 };
|
|
@@ -173,7 +173,9 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
173
173
|
: _this._createColors()(selectedPoint[0].y)
|
|
174
174
|
: _this._createColors()(1);
|
|
175
175
|
// there might be no y value of the line for the hovered bar. so we need to check this condition
|
|
176
|
-
if (_this._isHavingLine &&
|
|
176
|
+
if (_this._isHavingLine &&
|
|
177
|
+
((_a = selectedPoint[0].lineData) === null || _a === void 0 ? void 0 : _a.y) !== undefined &&
|
|
178
|
+
(_this._legendHighlighted(lineLegendText) || _this._noLegendHighlighted())) {
|
|
177
179
|
// callout data for the line
|
|
178
180
|
YValueHover.push({
|
|
179
181
|
legend: lineLegendText,
|
|
@@ -183,18 +185,20 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
183
185
|
yAxisCalloutData: (_d = selectedPoint[0].lineData) === null || _d === void 0 ? void 0 : _d.yAxisCalloutData,
|
|
184
186
|
});
|
|
185
187
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
?
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
188
|
+
if (_this._legendHighlighted(selectedPoint[0].legend) || _this._noLegendHighlighted()) {
|
|
189
|
+
// callout data for the bar
|
|
190
|
+
YValueHover.push({
|
|
191
|
+
legend: selectedPoint[0].legend,
|
|
192
|
+
y: selectedPoint[0].y,
|
|
193
|
+
color: enableGradient
|
|
194
|
+
? useSingleColor
|
|
195
|
+
? (0, index_2.getNextGradient)(0, 0)[0]
|
|
196
|
+
: ((_e = selectedPoint[0].gradient) === null || _e === void 0 ? void 0 : _e[0]) || (0, index_2.getNextGradient)(pointIndex, 0)[0]
|
|
197
|
+
: calloutColor,
|
|
198
|
+
data: selectedPoint[0].yAxisCalloutData,
|
|
199
|
+
yAxisCalloutData: selectedPoint[0].yAxisCalloutData,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
198
202
|
var hoverXValue = point.x instanceof Date ? (0, index_2.formatDate)(point.x, _this.props.useUTC) : point.x.toString();
|
|
199
203
|
return {
|
|
200
204
|
YValueHover: YValueHover,
|
|
@@ -220,7 +224,7 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
220
224
|
_this.setState({
|
|
221
225
|
refSelected: obj.refElement,
|
|
222
226
|
/** Show the callout if highlighted bar is focused and Hide it if unhighlighted bar is focused */
|
|
223
|
-
isCalloutVisible: _this.
|
|
227
|
+
isCalloutVisible: _this._noLegendHighlighted() || _this._legendHighlighted(point.legend),
|
|
224
228
|
calloutLegend: point.legend,
|
|
225
229
|
dataForHoverCard: point.y,
|
|
226
230
|
color: point.color || color,
|
|
@@ -325,9 +329,6 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
325
329
|
var legend = {
|
|
326
330
|
title: legendTitle,
|
|
327
331
|
color: color,
|
|
328
|
-
action: function () {
|
|
329
|
-
_this._onLegendClick(legendTitle);
|
|
330
|
-
},
|
|
331
332
|
hoverAction: function () {
|
|
332
333
|
_this._handleChartMouseLeave();
|
|
333
334
|
_this._onLegendHover(legendTitle);
|
|
@@ -342,9 +343,6 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
342
343
|
var lineLegend = {
|
|
343
344
|
title: lineLegendText,
|
|
344
345
|
color: lineLegendColor,
|
|
345
|
-
action: function () {
|
|
346
|
-
_this._onLegendClick(lineLegendText);
|
|
347
|
-
},
|
|
348
346
|
hoverAction: function () {
|
|
349
347
|
_this._handleChartMouseLeave();
|
|
350
348
|
_this._onLegendHover(lineLegendText);
|
|
@@ -356,7 +354,7 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
356
354
|
};
|
|
357
355
|
actions.unshift(lineLegend);
|
|
358
356
|
}
|
|
359
|
-
var legends = (React.createElement(index_1.Legends, tslib_1.__assign({ legends: actions, enabledWrapLines: _this.props.enabledLegendsWrapLines, overflowProps: _this.props.legendsOverflowProps, focusZonePropsInHoverCard: _this.props.focusZonePropsForLegendsInHoverCard, overflowText: _this.props.legendsOverflowText }, _this.props.legendProps)));
|
|
357
|
+
var legends = (React.createElement(index_1.Legends, tslib_1.__assign({ legends: actions, enabledWrapLines: _this.props.enabledLegendsWrapLines, overflowProps: _this.props.legendsOverflowProps, focusZonePropsInHoverCard: _this.props.focusZonePropsForLegendsInHoverCard, overflowText: _this.props.legendsOverflowText }, _this.props.legendProps, { onChange: _this._onLegendSelectionChange.bind(_this) })));
|
|
360
358
|
return legends;
|
|
361
359
|
};
|
|
362
360
|
_this._getAxisData = function (yAxisData) {
|
|
@@ -373,14 +371,13 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
373
371
|
* 2. hovering: if there is no selected legend and the user hovers over it
|
|
374
372
|
*/
|
|
375
373
|
_this._legendHighlighted = function (legendTitle) {
|
|
376
|
-
return
|
|
377
|
-
(_this.state.selectedLegend === '' && _this.state.activeLegend === legendTitle));
|
|
374
|
+
return _this._getHighlightedLegend().includes(legendTitle);
|
|
378
375
|
};
|
|
379
376
|
/**
|
|
380
377
|
* This function checks if none of the legends is selected or hovered.
|
|
381
378
|
*/
|
|
382
379
|
_this._noLegendHighlighted = function () {
|
|
383
|
-
return _this.
|
|
380
|
+
return _this._getHighlightedLegend().length === 0;
|
|
384
381
|
};
|
|
385
382
|
_this._getAriaLabel = function (point) {
|
|
386
383
|
var _a, _b, _c;
|
|
@@ -444,8 +441,8 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
444
441
|
dataForHoverCard: 0,
|
|
445
442
|
isCalloutVisible: false,
|
|
446
443
|
refSelected: null,
|
|
447
|
-
|
|
448
|
-
activeLegend:
|
|
444
|
+
selectedLegends: ((_a = props.legendProps) === null || _a === void 0 ? void 0 : _a.selectedLegends) || [],
|
|
445
|
+
activeLegend: undefined,
|
|
449
446
|
xCalloutValue: '',
|
|
450
447
|
yCalloutValue: '',
|
|
451
448
|
activeXdataPoint: null,
|
|
@@ -466,6 +463,14 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
466
463
|
_this._cartesianChartRef = React.createRef();
|
|
467
464
|
return _this;
|
|
468
465
|
}
|
|
466
|
+
VerticalBarChartBase.prototype.componentDidUpdate = function (prevProps) {
|
|
467
|
+
var _a, _b, _c;
|
|
468
|
+
if (!(0, index_2.areArraysEqual)((_a = prevProps.legendProps) === null || _a === void 0 ? void 0 : _a.selectedLegends, (_b = this.props.legendProps) === null || _b === void 0 ? void 0 : _b.selectedLegends)) {
|
|
469
|
+
this.setState({
|
|
470
|
+
selectedLegends: ((_c = this.props.legendProps) === null || _c === void 0 ? void 0 : _c.selectedLegends) || [],
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
};
|
|
469
474
|
VerticalBarChartBase.prototype.render = function () {
|
|
470
475
|
var _this = this;
|
|
471
476
|
this._adjustProps();
|
|
@@ -485,7 +490,8 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
485
490
|
tickValues: this.props.tickValues,
|
|
486
491
|
tickFormat: this.props.tickFormat,
|
|
487
492
|
};
|
|
488
|
-
return !this._isChartEmpty() ? (React.createElement(index_1.CartesianChart, tslib_1.__assign({}, this.props, { chartTitle: this._getChartTitle(), points: this._points, supportNegativeData: this.props.supportNegativeData, chartType: index_2.ChartTypes.VerticalBarChart, xAxisType: this._xAxisType, createYAxis: index_2.createNumericYAxis, calloutProps: calloutProps, tickParams: tickParams }, (this._isHavingLine &&
|
|
493
|
+
return !this._isChartEmpty() ? (React.createElement(index_1.CartesianChart, tslib_1.__assign({}, this.props, { chartTitle: this._getChartTitle(), points: this._points, supportNegativeData: this.props.supportNegativeData, chartType: index_2.ChartTypes.VerticalBarChart, xAxisType: this._xAxisType, createYAxis: index_2.createNumericYAxis, calloutProps: calloutProps, tickParams: tickParams }, (this._isHavingLine &&
|
|
494
|
+
(this._noLegendHighlighted() || this._getHighlightedLegend().length > 1) && { isCalloutForStack: true }), { legendBars: legendBars, datasetForXAxisDomain: this._xAxisLabels, barwidth: this._barWidth, focusZoneDirection: react_focus_1.FocusZoneDirection.horizontal, customizedCallout: this._getCustomizedCallout(), createStringYAxis: index_2.createStringYAxis, getmargins: this._getMargins, getMinMaxOfYAxis: index_2.findVerticalNumericMinMaxOfY, getGraphData: this._getGraphData, getDomainNRangeValues: this._getDomainNRangeValues, getAxisData: this._getAxisData, onChartMouseLeave: this._handleChartMouseLeave, getDomainMargins: this._getDomainMargins }, (this._xAxisType === index_2.XAxisTypes.StringAxis && {
|
|
489
495
|
xAxisInnerPadding: this._xAxisInnerPadding,
|
|
490
496
|
xAxisOuterPadding: this._xAxisOuterPadding,
|
|
491
497
|
}), { ref: this._cartesianChartRef,
|
|
@@ -538,7 +544,7 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
538
544
|
this.setState({
|
|
539
545
|
refSelected: mouseEvent,
|
|
540
546
|
/** Show the callout if highlighted bar is hovered and Hide it if unhighlighted bar is hovered */
|
|
541
|
-
isCalloutVisible: this.
|
|
547
|
+
isCalloutVisible: this._noLegendHighlighted() || this._legendHighlighted(point.legend),
|
|
542
548
|
dataForHoverCard: point.y,
|
|
543
549
|
calloutLegend: point.legend,
|
|
544
550
|
color: point.color || color,
|
|
@@ -548,7 +554,7 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
548
554
|
yCalloutValue: point.yAxisCalloutData,
|
|
549
555
|
dataPointCalloutProps: point,
|
|
550
556
|
// Hovering over a bar should highlight corresponding line points only when no legend is selected
|
|
551
|
-
activeXdataPoint: this._noLegendHighlighted() ? point.x : null,
|
|
557
|
+
activeXdataPoint: this._noLegendHighlighted() || this._legendHighlighted(point.legend) ? point.x : null,
|
|
552
558
|
YValueHover: YValueHover,
|
|
553
559
|
hoverXValue: hoverXValue,
|
|
554
560
|
callOutAccessibilityData: point.callOutAccessibilityData,
|
|
@@ -800,18 +806,6 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
800
806
|
}
|
|
801
807
|
return bars;
|
|
802
808
|
};
|
|
803
|
-
VerticalBarChartBase.prototype._onLegendClick = function (legendTitle) {
|
|
804
|
-
if (this.state.selectedLegend === legendTitle) {
|
|
805
|
-
this.setState({
|
|
806
|
-
selectedLegend: '',
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
else {
|
|
810
|
-
this.setState({
|
|
811
|
-
selectedLegend: legendTitle,
|
|
812
|
-
});
|
|
813
|
-
}
|
|
814
|
-
};
|
|
815
809
|
VerticalBarChartBase.prototype._onLegendHover = function (legendTitle) {
|
|
816
810
|
this.setState({
|
|
817
811
|
activeLegend: legendTitle,
|
|
@@ -819,9 +813,28 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
819
813
|
};
|
|
820
814
|
VerticalBarChartBase.prototype._onLegendLeave = function () {
|
|
821
815
|
this.setState({
|
|
822
|
-
activeLegend:
|
|
816
|
+
activeLegend: undefined,
|
|
823
817
|
});
|
|
824
818
|
};
|
|
819
|
+
VerticalBarChartBase.prototype._onLegendSelectionChange = function (selectedLegends, event, currentLegend) {
|
|
820
|
+
var _a, _b;
|
|
821
|
+
if ((_a = this.props.legendProps) === null || _a === void 0 ? void 0 : _a.canSelectMultipleLegends) {
|
|
822
|
+
this.setState({ selectedLegends: selectedLegends });
|
|
823
|
+
}
|
|
824
|
+
else {
|
|
825
|
+
this.setState({ selectedLegends: selectedLegends.slice(-1) });
|
|
826
|
+
}
|
|
827
|
+
if ((_b = this.props.legendProps) === null || _b === void 0 ? void 0 : _b.onChange) {
|
|
828
|
+
this.props.legendProps.onChange(selectedLegends, event, currentLegend);
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
VerticalBarChartBase.prototype._getHighlightedLegend = function () {
|
|
832
|
+
return this.state.selectedLegends.length > 0
|
|
833
|
+
? this.state.selectedLegends
|
|
834
|
+
: this.state.activeLegend
|
|
835
|
+
? [this.state.activeLegend]
|
|
836
|
+
: [];
|
|
837
|
+
};
|
|
825
838
|
VerticalBarChartBase.prototype._renderBarLabel = function (xPoint, yPoint, barValue, legend, isNegativeBar) {
|
|
826
839
|
if (this.props.hideLabels ||
|
|
827
840
|
this._barWidth < 16 ||
|