@fluentui/react-charting 5.23.76 → 5.23.78
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 +55 -1
- package/CHANGELOG.md +24 -2
- package/dist/react-charting.d.ts +12 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +4 -2
- package/lib/components/AreaChart/AreaChart.base.d.ts +2 -0
- package/lib/components/AreaChart/AreaChart.base.js +20 -6
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +18 -14
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +2 -2
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +52 -92
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +23 -14
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +89 -26
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +4 -3
- package/lib/components/LineChart/LineChart.base.js +50 -37
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +4 -4
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +55 -18
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/types/IDataPoint.d.ts +10 -0
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/utilities/utilities.d.ts +8 -5
- package/lib/utilities/utilities.js +35 -43
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.d.ts +2 -0
- package/lib-amd/components/AreaChart/AreaChart.base.js +20 -6
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +18 -14
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +2 -2
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +52 -92
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +21 -12
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +88 -25
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +4 -3
- package/lib-amd/components/LineChart/LineChart.base.js +50 -37
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js +1 -1
- package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +4 -4
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +55 -18
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/types/IDataPoint.d.ts +10 -0
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +8 -5
- package/lib-amd/utilities/utilities.js +37 -45
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +2 -0
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +20 -6
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +18 -14
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +2 -2
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +52 -92
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +21 -12
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +88 -25
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +4 -3
- package/lib-commonjs/components/LineChart/LineChart.base.js +50 -37
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +4 -4
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +55 -18
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/types/IDataPoint.d.ts +10 -0
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +8 -5
- package/lib-commonjs/utilities/utilities.js +37 -45
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +4 -4
- package/src/components/CommonComponents/CartesianChart.types.ts +2 -1
|
@@ -21,6 +21,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
21
21
|
var _a;
|
|
22
22
|
var _this = _super.call(this, props) || this;
|
|
23
23
|
_this._isRtl = (0, Utilities_1.getRTL)();
|
|
24
|
+
_this.Y_ORIGIN = 0;
|
|
24
25
|
_this.toImage = function (opts) {
|
|
25
26
|
var _a, _b;
|
|
26
27
|
return (0, image_export_utils_1.toImage)((_a = _this._cartesianChartRef.current) === null || _a === void 0 ? void 0 : _a.chartContainer, (_b = _this._legendsRef.current) === null || _b === void 0 ? void 0 : _b.toSVG, _this._isRtl, opts);
|
|
@@ -98,7 +99,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
98
99
|
};
|
|
99
100
|
_this._createLines = function (
|
|
100
101
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101
|
-
xScale,
|
|
102
|
+
xScale, yScalePrimary, containerHeight, containerWidth, yScaleSecondary) {
|
|
102
103
|
var _a;
|
|
103
104
|
var lineObject = _this._getFormattedLineData(_this.props.data);
|
|
104
105
|
var lines = [];
|
|
@@ -114,10 +115,12 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
114
115
|
var shouldHighlight = _this._isLegendHighlighted(item) || _this._noLegendHighlighted(); // item is legend name
|
|
115
116
|
for (var i = 1; i < lineObject[item].length; i++) {
|
|
116
117
|
var x1 = xScale(lineObject[item][i - 1].xItem.xAxisPoint);
|
|
117
|
-
var useSecondaryYScale = lineObject[item][i - 1].useSecondaryYScale && lineObject[item][i].useSecondaryYScale &&
|
|
118
|
-
var y1 = useSecondaryYScale
|
|
118
|
+
var useSecondaryYScale = lineObject[item][i - 1].useSecondaryYScale && lineObject[item][i].useSecondaryYScale && yScaleSecondary;
|
|
119
|
+
var y1 = useSecondaryYScale
|
|
120
|
+
? yScaleSecondary(lineObject[item][i - 1].y)
|
|
121
|
+
: yScalePrimary(lineObject[item][i - 1].y);
|
|
119
122
|
var x2 = xScale(lineObject[item][i].xItem.xAxisPoint);
|
|
120
|
-
var y2 = useSecondaryYScale ?
|
|
123
|
+
var y2 = useSecondaryYScale ? yScaleSecondary(lineObject[item][i].y) : yScalePrimary(lineObject[item][i].y);
|
|
121
124
|
if (lineBorderWidth > 0) {
|
|
122
125
|
borderForLines.push(React.createElement("line", { key: "".concat(index, "-").concat(i, "-BorderLine"), x1: x1, y1: y1, x2: x2, y2: y2, opacity: shouldHighlight ? 1 : 0.1, strokeWidth: 3 + lineBorderWidth * 2, fill: "transparent", strokeLinecap: "round", stroke: theme.semanticColors.bodyBackground, transform: "translate(".concat(xScaleBandwidthTranslate, ", 0)") }));
|
|
123
126
|
}
|
|
@@ -131,7 +134,9 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
131
134
|
lineObject[item].forEach(function (circlePoint, subIndex) {
|
|
132
135
|
// Create an object to store line point ref so that the object can be passed by reference to the focus handler
|
|
133
136
|
var circleRef = { refElement: null };
|
|
134
|
-
dots.push(React.createElement("circle", tslib_1.__assign({ key: "".concat(index, "-").concat(subIndex, "-dot"), cx: xScale(circlePoint.xItem.xAxisPoint), cy: circlePoint.useSecondaryYScale &&
|
|
137
|
+
dots.push(React.createElement("circle", tslib_1.__assign({ key: "".concat(index, "-").concat(subIndex, "-dot"), cx: xScale(circlePoint.xItem.xAxisPoint), cy: circlePoint.useSecondaryYScale && yScaleSecondary
|
|
138
|
+
? yScaleSecondary(circlePoint.y)
|
|
139
|
+
: yScalePrimary(circlePoint.y), onMouseOver: _this._isLegendHighlighted(item)
|
|
135
140
|
? _this._lineHover.bind(_this, circlePoint)
|
|
136
141
|
: _this._onStackHover.bind(_this, circlePoint.xItem) }, (_this._isLegendHighlighted(item) && {
|
|
137
142
|
onMouseLeave: _this._lineHoverOut,
|
|
@@ -225,7 +230,6 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
225
230
|
_this._barWidth = (0, index_3.getBarWidth)(_this.props.barWidth, _this.props.maxBarWidth, xBarScale.bandwidth());
|
|
226
231
|
}
|
|
227
232
|
var bars = _this._points.map(function (singleChartData, indexNumber) {
|
|
228
|
-
var yPoint = containerHeight - _this.margins.bottom;
|
|
229
233
|
var xPoint = xBarScale(_this._xAxisType === index_3.XAxisTypes.NumericAxis
|
|
230
234
|
? singleChartData.xAxisPoint
|
|
231
235
|
: _this._xAxisType === index_3.XAxisTypes.DateAxis
|
|
@@ -234,7 +238,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
234
238
|
var xScaleBandwidthTranslate = _this._xAxisType !== index_3.XAxisTypes.StringAxis ? -_this._barWidth / 2 : (xBarScale.bandwidth() - _this._barWidth) / 2;
|
|
235
239
|
var barTotalValue = 0;
|
|
236
240
|
// Removing datapoints with zero data
|
|
237
|
-
var barsToDisplay = singleChartData.chartData.filter(function (point) { return point.data
|
|
241
|
+
var barsToDisplay = singleChartData.chartData.filter(function (point) { return point.data !== 0; });
|
|
238
242
|
if (!barsToDisplay.length) {
|
|
239
243
|
return undefined;
|
|
240
244
|
}
|
|
@@ -242,6 +246,11 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
242
246
|
if (heightValueScale < 0) {
|
|
243
247
|
return undefined;
|
|
244
248
|
}
|
|
249
|
+
var yBaseline = containerHeight - _this.margins.bottom - yBarScale(_this.Y_ORIGIN);
|
|
250
|
+
var yPositiveStart = yBaseline;
|
|
251
|
+
var yNegativeStart = yBaseline;
|
|
252
|
+
var yPoint = 0;
|
|
253
|
+
var heightOfLastBar = 0;
|
|
245
254
|
var singleBar = barsToDisplay.map(function (point, index) {
|
|
246
255
|
var _a, _b, _c, _d;
|
|
247
256
|
var startColor = point.color ? point.color : _this._colors[index];
|
|
@@ -269,12 +278,22 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
269
278
|
onClick: _this._onClick.bind(_this, point),
|
|
270
279
|
role: 'img',
|
|
271
280
|
};
|
|
272
|
-
var barHeight = heightValueScale * point.data;
|
|
273
|
-
|
|
274
|
-
|
|
281
|
+
var barHeight = Math.abs(heightValueScale * point.data);
|
|
282
|
+
var minHeight = Math.max((heightValueScale * adjustedTotalHeight) / 100.0, barMinimumHeight);
|
|
283
|
+
if (barHeight < minHeight) {
|
|
284
|
+
barHeight = minHeight;
|
|
285
|
+
}
|
|
286
|
+
var gapOffset = index ? gapHeight : 0;
|
|
287
|
+
if (point.data >= _this.Y_ORIGIN) {
|
|
288
|
+
yPositiveStart -= barHeight + gapOffset;
|
|
289
|
+
yPoint = yPositiveStart;
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
yPoint = yNegativeStart + gapOffset;
|
|
293
|
+
yNegativeStart = yPoint + barHeight;
|
|
275
294
|
}
|
|
276
|
-
yPoint = yPoint - barHeight - (index ? gapHeight : 0);
|
|
277
295
|
barTotalValue += point.data;
|
|
296
|
+
heightOfLastBar = index === barsToDisplay.length - 1 ? barHeight : 0;
|
|
278
297
|
var gradientId = (0, Utilities_1.getId)('VSBC_Gradient') + "_".concat(indexNumber, "_").concat(index);
|
|
279
298
|
// If set, apply the corner radius to the top of the final bar
|
|
280
299
|
if (barCornerRadius && barHeight > barCornerRadius && index === barsToDisplay.length - 1) {
|
|
@@ -325,7 +344,9 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
325
344
|
}
|
|
326
345
|
return (React.createElement("g", { key: indexNumber + "".concat(shouldFocusWholeStack) },
|
|
327
346
|
React.createElement("g", tslib_1.__assign({ id: "".concat(indexNumber, "-singleBar"), ref: function (e) { return (groupRef.refElement = e); } }, stackFocusProps), singleBar),
|
|
328
|
-
!_this.props.hideLabels && _this._barWidth >= 16 && showLabel && (React.createElement("text", { x: xPoint + _this._barWidth / 2,
|
|
347
|
+
!_this.props.hideLabels && _this._barWidth >= 16 && showLabel && (React.createElement("text", { x: xPoint + _this._barWidth / 2,
|
|
348
|
+
//if total bar value >=0, show label above top bar, otherwise below bottom bar
|
|
349
|
+
y: barLabel >= _this.Y_ORIGIN ? yPoint - 6 : yPoint + heightOfLastBar + 12, textAnchor: "middle", className: _this._classNames.barLabel, "aria-label": "Total: ".concat(barLabel), role: "img", transform: "translate(".concat(xScaleBandwidthTranslate, ", 0)") }, (0, index_3.formatValueWithSIPrefix)(barLabel)))));
|
|
329
350
|
});
|
|
330
351
|
// Removing un wanted tooltip div from DOM, when prop not provided.
|
|
331
352
|
if (!_this.props.showXAxisLablesTooltip) {
|
|
@@ -353,9 +374,9 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
353
374
|
return bars.filter(function (bar) { return !!bar; });
|
|
354
375
|
};
|
|
355
376
|
_this._getScales = function (containerHeight, containerWidth) {
|
|
356
|
-
var
|
|
377
|
+
var yDomain = [Math.min(_this.Y_ORIGIN, _this._yMin), Math.max(_this.Y_ORIGIN, _this._yMax)];
|
|
357
378
|
var yBarScale = (0, d3_scale_1.scaleLinear)()
|
|
358
|
-
.domain(
|
|
379
|
+
.domain(yDomain)
|
|
359
380
|
.range([0, containerHeight - _this.margins.bottom - _this.margins.top]);
|
|
360
381
|
if (_this._xAxisType === index_3.XAxisTypes.NumericAxis) {
|
|
361
382
|
var xMax = (0, d3_array_1.max)(_this._dataset, function (point) { return point.x; });
|
|
@@ -404,7 +425,8 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
404
425
|
_this._getAxisData = function (yAxisData) {
|
|
405
426
|
if (yAxisData && yAxisData.yAxisDomainValues.length) {
|
|
406
427
|
var domainValue = yAxisData.yAxisDomainValues;
|
|
407
|
-
_this._yMax = Math.max(domainValue[domainValue.length - 1], _this.props.yMaxValue ||
|
|
428
|
+
_this._yMax = Math.max(domainValue[domainValue.length - 1], _this.props.yMaxValue || _this.Y_ORIGIN);
|
|
429
|
+
_this._yMin = Math.min(domainValue[0], _this.props.yMinValue || _this.Y_ORIGIN);
|
|
408
430
|
}
|
|
409
431
|
};
|
|
410
432
|
/**
|
|
@@ -510,6 +532,21 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
510
532
|
(numLines > 0 ? " and ".concat(numLines, " lines") : '') +
|
|
511
533
|
'. ');
|
|
512
534
|
};
|
|
535
|
+
_this._getMinMaxOfYAxis = function (dataset, yAxisType, useSecondaryYScale) {
|
|
536
|
+
if (!useSecondaryYScale) {
|
|
537
|
+
return (0, index_3.findVSBCNumericMinMaxOfY)(dataset);
|
|
538
|
+
}
|
|
539
|
+
var values = [];
|
|
540
|
+
_this.props.data.forEach(function (xPoint) {
|
|
541
|
+
var _a;
|
|
542
|
+
(_a = xPoint.lineData) === null || _a === void 0 ? void 0 : _a.forEach(function (point) {
|
|
543
|
+
if (point.useSecondaryYScale) {
|
|
544
|
+
values.push(point.y);
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
});
|
|
548
|
+
return { startValue: (0, d3_array_1.min)(values), endValue: (0, d3_array_1.max)(values) };
|
|
549
|
+
};
|
|
513
550
|
(0, Utilities_1.initializeComponentRef)(_this);
|
|
514
551
|
_this.state = {
|
|
515
552
|
isCalloutVisible: false,
|
|
@@ -575,7 +612,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
575
612
|
tickValues: this.props.tickValues,
|
|
576
613
|
tickFormat: this.props.tickFormat,
|
|
577
614
|
};
|
|
578
|
-
return (React.createElement(index_2.CartesianChart, tslib_1.__assign({}, this.props, { chartTitle: this._getChartTitle(), points: this._dataset, chartType: index_3.ChartTypes.VerticalStackedBarChart, xAxisType: this._xAxisType, calloutProps: calloutProps, createYAxis: index_3.createNumericYAxis, tickParams: tickParams, legendBars: legendBars, getMinMaxOfYAxis:
|
|
615
|
+
return (React.createElement(index_2.CartesianChart, tslib_1.__assign({}, this.props, { chartTitle: this._getChartTitle(), points: this._dataset, chartType: index_3.ChartTypes.VerticalStackedBarChart, xAxisType: this._xAxisType, calloutProps: calloutProps, createYAxis: index_3.createNumericYAxis, tickParams: tickParams, legendBars: legendBars, getMinMaxOfYAxis: this._getMinMaxOfYAxis, datasetForXAxisDomain: this._xAxisLabels, isCalloutForStack: shouldFocusWholeStack, getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: index_3.createStringYAxis, barwidth: this._barWidth, focusZoneDirection: isCalloutForStack || _isHavingLines_1 ? react_focus_1.FocusZoneDirection.horizontal : react_focus_1.FocusZoneDirection.vertical, getmargins: this._getMargins, getGraphData: this._getGraphData, getAxisData: this._getAxisData, customizedCallout: this._getCustomizedCallout(), onChartMouseLeave: this._handleChartMouseLeave, getDomainMargins: this._getDomainMargins }, (this._xAxisType === index_3.XAxisTypes.StringAxis && {
|
|
579
616
|
xAxisInnerPadding: this._xAxisInnerPadding,
|
|
580
617
|
xAxisOuterPadding: this._xAxisOuterPadding,
|
|
581
618
|
}), { ref: this._cartesianChartRef, showRoundOffXTickValues: !(0, index_3.isScalePaddingDefined)(this.props.xAxisInnerPadding, this.props.xAxisPadding),
|
|
@@ -584,7 +621,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
584
621
|
return (React.createElement(React.Fragment, null,
|
|
585
622
|
React.createElement("g", null, _this._bars),
|
|
586
623
|
React.createElement("g", null, _isHavingLines_1 &&
|
|
587
|
-
_this._createLines(props.xScale, props.
|
|
624
|
+
_this._createLines(props.xScale, props.yScalePrimary, props.containerHeight, props.containerWidth, props.yScaleSecondary))));
|
|
588
625
|
} })));
|
|
589
626
|
}
|
|
590
627
|
return (React.createElement("div", { id: this._emptyChartId, role: 'alert', style: { opacity: '0' }, "aria-label": 'Graph has no data to display' }));
|
|
@@ -789,7 +826,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
789
826
|
// When displaying gaps between the bars, the height of each bar is
|
|
790
827
|
// adjusted so that the total of all bars is not changed by the gaps
|
|
791
828
|
var totalData = bars.reduce(function (iter, value) { return iter + Math.abs(value.data); }, 0);
|
|
792
|
-
var totalHeight = defaultTotalHeight !== null && defaultTotalHeight !== void 0 ? defaultTotalHeight : yBarScale(totalData);
|
|
829
|
+
var totalHeight = defaultTotalHeight !== null && defaultTotalHeight !== void 0 ? defaultTotalHeight : Math.abs(yBarScale(totalData) - yBarScale(this.Y_ORIGIN));
|
|
793
830
|
var sumOfPercent = 0;
|
|
794
831
|
bars.forEach(function (point) {
|
|
795
832
|
var value = (Math.abs(point.data) / totalData) * 100;
|