@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
|
@@ -12,7 +12,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
12
12
|
var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
13
13
|
tslib_1.__extends(VerticalBarChartBase, _super);
|
|
14
14
|
function VerticalBarChartBase(props) {
|
|
15
|
-
var _a
|
|
15
|
+
var _a;
|
|
16
16
|
var _this = _super.call(this, props) || this;
|
|
17
17
|
_this._isRtl = (0, Utilities_1.getRTL)();
|
|
18
18
|
_this._getDomainNRangeValues = function (points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
|
|
@@ -85,12 +85,12 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
85
85
|
dots));
|
|
86
86
|
};
|
|
87
87
|
_this._getCircleVisibilityAndRadius = function (xAxisPoint, legend) {
|
|
88
|
-
var
|
|
89
|
-
if (
|
|
90
|
-
if (xAxisPoint === activeXdataPoint &&
|
|
88
|
+
var activeXdataPoint = _this.state.activeXdataPoint;
|
|
89
|
+
if (!_this._noLegendHighlighted()) {
|
|
90
|
+
if (xAxisPoint === activeXdataPoint && _this._legendHighlighted(legend)) {
|
|
91
91
|
return { visibility: CircleVisbility.show, radius: 8 };
|
|
92
92
|
}
|
|
93
|
-
else if (
|
|
93
|
+
else if (_this._legendHighlighted(legend)) {
|
|
94
94
|
// Don't hide the circle to keep it focusable. For more information,
|
|
95
95
|
// see https://fuzzbomb.github.io/accessibility-demos/visually-hidden-focus-test.html
|
|
96
96
|
return { visibility: CircleVisbility.show, radius: 0.3 };
|
|
@@ -163,7 +163,9 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
163
163
|
: _this._createColors()(selectedPoint[0].y)
|
|
164
164
|
: _this._createColors()(1);
|
|
165
165
|
// there might be no y value of the line for the hovered bar. so we need to check this condition
|
|
166
|
-
if (_this._isHavingLine &&
|
|
166
|
+
if (_this._isHavingLine &&
|
|
167
|
+
((_a = selectedPoint[0].lineData) === null || _a === void 0 ? void 0 : _a.y) !== undefined &&
|
|
168
|
+
(_this._legendHighlighted(lineLegendText) || _this._noLegendHighlighted())) {
|
|
167
169
|
// callout data for the line
|
|
168
170
|
YValueHover.push({
|
|
169
171
|
legend: lineLegendText,
|
|
@@ -173,18 +175,20 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
173
175
|
yAxisCalloutData: (_d = selectedPoint[0].lineData) === null || _d === void 0 ? void 0 : _d.yAxisCalloutData,
|
|
174
176
|
});
|
|
175
177
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
?
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
178
|
+
if (_this._legendHighlighted(selectedPoint[0].legend) || _this._noLegendHighlighted()) {
|
|
179
|
+
// callout data for the bar
|
|
180
|
+
YValueHover.push({
|
|
181
|
+
legend: selectedPoint[0].legend,
|
|
182
|
+
y: selectedPoint[0].y,
|
|
183
|
+
color: enableGradient
|
|
184
|
+
? useSingleColor
|
|
185
|
+
? (0, index_2.getNextGradient)(0, 0)[0]
|
|
186
|
+
: ((_e = selectedPoint[0].gradient) === null || _e === void 0 ? void 0 : _e[0]) || (0, index_2.getNextGradient)(pointIndex, 0)[0]
|
|
187
|
+
: calloutColor,
|
|
188
|
+
data: selectedPoint[0].yAxisCalloutData,
|
|
189
|
+
yAxisCalloutData: selectedPoint[0].yAxisCalloutData,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
188
192
|
var hoverXValue = point.x instanceof Date ? (0, index_2.formatDate)(point.x, _this.props.useUTC) : point.x.toString();
|
|
189
193
|
return {
|
|
190
194
|
YValueHover: YValueHover,
|
|
@@ -210,7 +214,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
210
214
|
_this.setState({
|
|
211
215
|
refSelected: obj.refElement,
|
|
212
216
|
/** Show the callout if highlighted bar is focused and Hide it if unhighlighted bar is focused */
|
|
213
|
-
isCalloutVisible: _this.
|
|
217
|
+
isCalloutVisible: _this._noLegendHighlighted() || _this._legendHighlighted(point.legend),
|
|
214
218
|
calloutLegend: point.legend,
|
|
215
219
|
dataForHoverCard: point.y,
|
|
216
220
|
color: point.color || color,
|
|
@@ -315,9 +319,6 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
315
319
|
var legend = {
|
|
316
320
|
title: legendTitle,
|
|
317
321
|
color: color,
|
|
318
|
-
action: function () {
|
|
319
|
-
_this._onLegendClick(legendTitle);
|
|
320
|
-
},
|
|
321
322
|
hoverAction: function () {
|
|
322
323
|
_this._handleChartMouseLeave();
|
|
323
324
|
_this._onLegendHover(legendTitle);
|
|
@@ -332,9 +333,6 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
332
333
|
var lineLegend = {
|
|
333
334
|
title: lineLegendText,
|
|
334
335
|
color: lineLegendColor,
|
|
335
|
-
action: function () {
|
|
336
|
-
_this._onLegendClick(lineLegendText);
|
|
337
|
-
},
|
|
338
336
|
hoverAction: function () {
|
|
339
337
|
_this._handleChartMouseLeave();
|
|
340
338
|
_this._onLegendHover(lineLegendText);
|
|
@@ -346,7 +344,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
346
344
|
};
|
|
347
345
|
actions.unshift(lineLegend);
|
|
348
346
|
}
|
|
349
|
-
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)));
|
|
347
|
+
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) })));
|
|
350
348
|
return legends;
|
|
351
349
|
};
|
|
352
350
|
_this._getAxisData = function (yAxisData) {
|
|
@@ -363,14 +361,13 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
363
361
|
* 2. hovering: if there is no selected legend and the user hovers over it
|
|
364
362
|
*/
|
|
365
363
|
_this._legendHighlighted = function (legendTitle) {
|
|
366
|
-
return
|
|
367
|
-
(_this.state.selectedLegend === '' && _this.state.activeLegend === legendTitle));
|
|
364
|
+
return _this._getHighlightedLegend().includes(legendTitle);
|
|
368
365
|
};
|
|
369
366
|
/**
|
|
370
367
|
* This function checks if none of the legends is selected or hovered.
|
|
371
368
|
*/
|
|
372
369
|
_this._noLegendHighlighted = function () {
|
|
373
|
-
return _this.
|
|
370
|
+
return _this._getHighlightedLegend().length === 0;
|
|
374
371
|
};
|
|
375
372
|
_this._getAriaLabel = function (point) {
|
|
376
373
|
var _a, _b, _c;
|
|
@@ -434,8 +431,8 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
434
431
|
dataForHoverCard: 0,
|
|
435
432
|
isCalloutVisible: false,
|
|
436
433
|
refSelected: null,
|
|
437
|
-
|
|
438
|
-
activeLegend:
|
|
434
|
+
selectedLegends: ((_a = props.legendProps) === null || _a === void 0 ? void 0 : _a.selectedLegends) || [],
|
|
435
|
+
activeLegend: undefined,
|
|
439
436
|
xCalloutValue: '',
|
|
440
437
|
yCalloutValue: '',
|
|
441
438
|
activeXdataPoint: null,
|
|
@@ -456,6 +453,14 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
456
453
|
_this._cartesianChartRef = React.createRef();
|
|
457
454
|
return _this;
|
|
458
455
|
}
|
|
456
|
+
VerticalBarChartBase.prototype.componentDidUpdate = function (prevProps) {
|
|
457
|
+
var _a, _b, _c;
|
|
458
|
+
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)) {
|
|
459
|
+
this.setState({
|
|
460
|
+
selectedLegends: ((_c = this.props.legendProps) === null || _c === void 0 ? void 0 : _c.selectedLegends) || [],
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
};
|
|
459
464
|
VerticalBarChartBase.prototype.render = function () {
|
|
460
465
|
var _this = this;
|
|
461
466
|
this._adjustProps();
|
|
@@ -475,7 +480,8 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
475
480
|
tickValues: this.props.tickValues,
|
|
476
481
|
tickFormat: this.props.tickFormat,
|
|
477
482
|
};
|
|
478
|
-
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 &&
|
|
483
|
+
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 &&
|
|
484
|
+
(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 && {
|
|
479
485
|
xAxisInnerPadding: this._xAxisInnerPadding,
|
|
480
486
|
xAxisOuterPadding: this._xAxisOuterPadding,
|
|
481
487
|
}), { ref: this._cartesianChartRef,
|
|
@@ -528,7 +534,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
528
534
|
this.setState({
|
|
529
535
|
refSelected: mouseEvent,
|
|
530
536
|
/** Show the callout if highlighted bar is hovered and Hide it if unhighlighted bar is hovered */
|
|
531
|
-
isCalloutVisible: this.
|
|
537
|
+
isCalloutVisible: this._noLegendHighlighted() || this._legendHighlighted(point.legend),
|
|
532
538
|
dataForHoverCard: point.y,
|
|
533
539
|
calloutLegend: point.legend,
|
|
534
540
|
color: point.color || color,
|
|
@@ -538,7 +544,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
538
544
|
yCalloutValue: point.yAxisCalloutData,
|
|
539
545
|
dataPointCalloutProps: point,
|
|
540
546
|
// Hovering over a bar should highlight corresponding line points only when no legend is selected
|
|
541
|
-
activeXdataPoint: this._noLegendHighlighted() ? point.x : null,
|
|
547
|
+
activeXdataPoint: this._noLegendHighlighted() || this._legendHighlighted(point.legend) ? point.x : null,
|
|
542
548
|
YValueHover: YValueHover,
|
|
543
549
|
hoverXValue: hoverXValue,
|
|
544
550
|
callOutAccessibilityData: point.callOutAccessibilityData,
|
|
@@ -790,18 +796,6 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
790
796
|
}
|
|
791
797
|
return bars;
|
|
792
798
|
};
|
|
793
|
-
VerticalBarChartBase.prototype._onLegendClick = function (legendTitle) {
|
|
794
|
-
if (this.state.selectedLegend === legendTitle) {
|
|
795
|
-
this.setState({
|
|
796
|
-
selectedLegend: '',
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
else {
|
|
800
|
-
this.setState({
|
|
801
|
-
selectedLegend: legendTitle,
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
799
|
VerticalBarChartBase.prototype._onLegendHover = function (legendTitle) {
|
|
806
800
|
this.setState({
|
|
807
801
|
activeLegend: legendTitle,
|
|
@@ -809,9 +803,28 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-shape", "d3-sele
|
|
|
809
803
|
};
|
|
810
804
|
VerticalBarChartBase.prototype._onLegendLeave = function () {
|
|
811
805
|
this.setState({
|
|
812
|
-
activeLegend:
|
|
806
|
+
activeLegend: undefined,
|
|
813
807
|
});
|
|
814
808
|
};
|
|
809
|
+
VerticalBarChartBase.prototype._onLegendSelectionChange = function (selectedLegends, event, currentLegend) {
|
|
810
|
+
var _a, _b;
|
|
811
|
+
if ((_a = this.props.legendProps) === null || _a === void 0 ? void 0 : _a.canSelectMultipleLegends) {
|
|
812
|
+
this.setState({ selectedLegends: selectedLegends });
|
|
813
|
+
}
|
|
814
|
+
else {
|
|
815
|
+
this.setState({ selectedLegends: selectedLegends.slice(-1) });
|
|
816
|
+
}
|
|
817
|
+
if ((_b = this.props.legendProps) === null || _b === void 0 ? void 0 : _b.onChange) {
|
|
818
|
+
this.props.legendProps.onChange(selectedLegends, event, currentLegend);
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
VerticalBarChartBase.prototype._getHighlightedLegend = function () {
|
|
822
|
+
return this.state.selectedLegends.length > 0
|
|
823
|
+
? this.state.selectedLegends
|
|
824
|
+
: this.state.activeLegend
|
|
825
|
+
? [this.state.activeLegend]
|
|
826
|
+
: [];
|
|
827
|
+
};
|
|
815
828
|
VerticalBarChartBase.prototype._renderBarLabel = function (xPoint, yPoint, barValue, legend, isNegativeBar) {
|
|
816
829
|
if (this.props.hideLabels ||
|
|
817
830
|
this._barWidth < 16 ||
|