gifted-charts-core 0.1.59 → 0.1.60

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.
@@ -60,6 +60,7 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
60
60
  noOfSectionsBelowXAxis: number;
61
61
  stepHeight: number;
62
62
  xAxisLabelsVerticalShift: number;
63
+ xAxisLabelsAtBottom: boolean;
63
64
  labelsExtraHeight: number;
64
65
  stripOverPointer: boolean;
65
66
  pointerLabelComponent: Function | null;
@@ -164,6 +165,7 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
164
165
  xAxisTextNumberOfLines: number;
165
166
  xAxisLabelsHeight: number | undefined;
166
167
  xAxisLabelsVerticalShift: number;
168
+ xAxisLabelsAtBottom: boolean;
167
169
  renderTooltip: Function | undefined;
168
170
  renderTooltipConditions: string[];
169
171
  leftShiftForTooltip: number;
@@ -29,13 +29,13 @@ import { useEffect, useMemo, useState } from 'react';
29
29
  import { getArrowPoints, getAxesAndRulesProps, getExtendedContainerHeightWithPadding, getLineConfigForBarChart, getMaxValue, getMostNegativeValue, getNoOfSections, getXForLineInBar, getYForLineInBar, indexOfFirstNonZeroDigit, maxAndMinUtil, svgPath } from '../utils';
30
30
  import { AxesAndRulesDefaults, BarDefaults, chartTypes, defaultLineConfig, defaultPointerConfig } from '../utils/constants';
31
31
  export var useBarChart = function (props) {
32
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63;
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64;
33
33
  var heightValue = props.heightValue, widthValue = props.widthValue, opacityValue = props.opacityValue, yAxisOffset = props.yAxisOffset, adjustToWidth = props.adjustToWidth, parentWidth = props.parentWidth, labelsDistanceFromXaxis = props.labelsDistanceFromXaxis, autoShiftLabelsForNegativeStacks = props.autoShiftLabelsForNegativeStacks, focusedBarIndex = props.focusedBarIndex, negativeStepValue = props.negativeStepValue, autoCenterTooltip = props.autoCenterTooltip;
34
- var _64 = __read(useState(''), 2), points = _64[0], setPoints = _64[1];
35
- var _65 = __read(useState(''), 2), points2 = _65[0], setPoints2 = _65[1];
36
- var _66 = __read(useState(''), 2), arrowPoints = _66[0], setArrowPoints = _66[1];
37
- var _67 = __read(useState(focusedBarIndex !== null && focusedBarIndex !== void 0 ? focusedBarIndex : -1), 2), selectedIndex = _67[0], setSelectedIndex = _67[1];
38
- var _68 = __read(useState((_a = props.highlightedStackIndex) !== null && _a !== void 0 ? _a : -1), 2), selectedStackIndex = _68[0], setSelectedStackIndex = _68[1];
34
+ var _65 = __read(useState(''), 2), points = _65[0], setPoints = _65[1];
35
+ var _66 = __read(useState(''), 2), points2 = _66[0], setPoints2 = _66[1];
36
+ var _67 = __read(useState(''), 2), arrowPoints = _67[0], setArrowPoints = _67[1];
37
+ var _68 = __read(useState(focusedBarIndex !== null && focusedBarIndex !== void 0 ? focusedBarIndex : -1), 2), selectedIndex = _68[0], setSelectedIndex = _68[1];
38
+ var _69 = __read(useState((_a = props.highlightedStackIndex) !== null && _a !== void 0 ? _a : -1), 2), selectedStackIndex = _69[0], setSelectedStackIndex = _69[1];
39
39
  var showLine = (_b = props.showLine) !== null && _b !== void 0 ? _b : BarDefaults.showLine;
40
40
  useEffect(function () {
41
41
  setSelectedIndex(focusedBarIndex !== null && focusedBarIndex !== void 0 ? focusedBarIndex : -1);
@@ -256,68 +256,69 @@ export var useBarChart = function (props) {
256
256
  var xAxisThickness = (_19 = props.xAxisThickness) !== null && _19 !== void 0 ? _19 : AxesAndRulesDefaults.xAxisThickness;
257
257
  var xAxisTextNumberOfLines = (_20 = props.xAxisTextNumberOfLines) !== null && _20 !== void 0 ? _20 : AxesAndRulesDefaults.xAxisTextNumberOfLines;
258
258
  var xAxisLabelsVerticalShift = (_21 = props.xAxisLabelsVerticalShift) !== null && _21 !== void 0 ? _21 : AxesAndRulesDefaults.xAxisLabelsVerticalShift;
259
+ var xAxisLabelsAtBottom = (_22 = props.xAxisLabelsAtBottom) !== null && _22 !== void 0 ? _22 : false;
259
260
  var horizontalRulesStyle = props.horizontalRulesStyle;
260
- var autoShiftLabels = (_22 = props.autoShiftLabels) !== null && _22 !== void 0 ? _22 : false;
261
- var barBorderColor = (_23 = props.barBorderColor) !== null && _23 !== void 0 ? _23 : BarDefaults.barBorderColor;
261
+ var autoShiftLabels = (_23 = props.autoShiftLabels) !== null && _23 !== void 0 ? _23 : false;
262
+ var barBorderColor = (_24 = props.barBorderColor) !== null && _24 !== void 0 ? _24 : BarDefaults.barBorderColor;
262
263
  var extendedContainerHeight = getExtendedContainerHeightWithPadding(containerHeight, 0);
263
264
  var axesAndRulesProps = getAxesAndRulesProps(props, containerHeight, stepHeight, stepValue, noOfSections, roundToDigits, negativeStepValue !== null && negativeStepValue !== void 0 ? negativeStepValue : stepValue, secondaryMaxValue, secondaryMinItem, showSecondaryFractionalValues, secondaryRoundToDigits);
264
- var _69 = axesAndRulesProps.secondaryYAxisConfig, secondaryStepHeight = _69.stepHeight, secondaryStepValue = _69.stepValue, secondaryNegativeStepHeight = _69.negativeStepHeight, secondaryNegativeStepValue = _69.negativeStepValue, secondaryNoOfSectionsBelowXAxis = _69.noOfSectionsBelowXAxis;
265
- var primary4thQuadrantHeight = noOfSectionsBelowXAxis * ((_24 = props.negativeStepHeight) !== null && _24 !== void 0 ? _24 : stepHeight);
265
+ var _70 = axesAndRulesProps.secondaryYAxisConfig, secondaryStepHeight = _70.stepHeight, secondaryStepValue = _70.stepValue, secondaryNegativeStepHeight = _70.negativeStepHeight, secondaryNegativeStepValue = _70.negativeStepValue, secondaryNoOfSectionsBelowXAxis = _70.noOfSectionsBelowXAxis;
266
+ var primary4thQuadrantHeight = noOfSectionsBelowXAxis * ((_25 = props.negativeStepHeight) !== null && _25 !== void 0 ? _25 : stepHeight);
266
267
  var secondary4thQuadrantHeight = secondaryNoOfSectionsBelowXAxis * secondaryNegativeStepHeight;
267
- var containerHeightIncludingBelowXAxis = extendedContainerHeight +
268
- Math.max(primary4thQuadrantHeight, secondary4thQuadrantHeight);
269
- var _70 = __read(useState(-1), 2), pointerIndex = _70[0], setPointerIndex = _70[1];
270
- var _71 = __read(useState(0), 2), pointerX = _71[0], setPointerX = _71[1];
271
- var _72 = __read(useState(0), 2), pointerY = _72[0], setPointerY = _72[1];
272
- var _73 = __read(useState(), 2), pointerItem = _73[0], setPointerItem = _73[1];
273
- var _74 = __read(useState(0), 2), responderStartTime = _74[0], setResponderStartTime = _74[1];
274
- var _75 = __read(useState(false), 2), responderActive = _75[0], setResponderActive = _75[1];
268
+ var fourthQuadrantHeight = Math.max(primary4thQuadrantHeight, secondary4thQuadrantHeight);
269
+ var containerHeightIncludingBelowXAxis = extendedContainerHeight + fourthQuadrantHeight;
270
+ var _71 = __read(useState(-1), 2), pointerIndex = _71[0], setPointerIndex = _71[1];
271
+ var _72 = __read(useState(0), 2), pointerX = _72[0], setPointerX = _72[1];
272
+ var _73 = __read(useState(0), 2), pointerY = _73[0], setPointerY = _73[1];
273
+ var _74 = __read(useState(), 2), pointerItem = _74[0], setPointerItem = _74[1];
274
+ var _75 = __read(useState(0), 2), responderStartTime = _75[0], setResponderStartTime = _75[1];
275
+ var _76 = __read(useState(false), 2), responderActive = _76[0], setResponderActive = _76[1];
275
276
  var pointerConfig = props.pointerConfig;
276
- var getPointerProps = (_25 = props.getPointerProps) !== null && _25 !== void 0 ? _25 : null;
277
- var pointerHeight = (_26 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.height) !== null && _26 !== void 0 ? _26 : defaultPointerConfig.height;
278
- var pointerWidth = (_27 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.width) !== null && _27 !== void 0 ? _27 : defaultPointerConfig.width;
279
- var pointerRadius = (_28 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.radius) !== null && _28 !== void 0 ? _28 : defaultPointerConfig.radius;
280
- var pointerColor = (_29 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerColor) !== null && _29 !== void 0 ? _29 : defaultPointerConfig.pointerColor;
281
- var pointerComponent = (_30 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerComponent) !== null && _30 !== void 0 ? _30 : defaultPointerConfig.pointerComponent;
277
+ var getPointerProps = (_26 = props.getPointerProps) !== null && _26 !== void 0 ? _26 : null;
278
+ var pointerHeight = (_27 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.height) !== null && _27 !== void 0 ? _27 : defaultPointerConfig.height;
279
+ var pointerWidth = (_28 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.width) !== null && _28 !== void 0 ? _28 : defaultPointerConfig.width;
280
+ var pointerRadius = (_29 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.radius) !== null && _29 !== void 0 ? _29 : defaultPointerConfig.radius;
281
+ var pointerColor = (_30 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerColor) !== null && _30 !== void 0 ? _30 : defaultPointerConfig.pointerColor;
282
+ var pointerComponent = (_31 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerComponent) !== null && _31 !== void 0 ? _31 : defaultPointerConfig.pointerComponent;
282
283
  var showPointerStrip = (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.showPointerStrip) === false
283
284
  ? false
284
285
  : defaultPointerConfig.showPointerStrip;
285
- var pointerStripHeight = (_31 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripHeight) !== null && _31 !== void 0 ? _31 : defaultPointerConfig.pointerStripHeight;
286
- var pointerStripWidth = (_32 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripWidth) !== null && _32 !== void 0 ? _32 : defaultPointerConfig.pointerStripWidth;
287
- var pointerStripColor = (_33 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripColor) !== null && _33 !== void 0 ? _33 : defaultPointerConfig.pointerStripColor;
288
- var pointerStripUptoDataPoint = (_34 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripUptoDataPoint) !== null && _34 !== void 0 ? _34 : defaultPointerConfig.pointerStripUptoDataPoint;
289
- var pointerLabelComponent = (_35 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelComponent) !== null && _35 !== void 0 ? _35 : defaultPointerConfig.pointerLabelComponent;
290
- var stripOverPointer = (_36 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripOverPointer) !== null && _36 !== void 0 ? _36 : defaultPointerConfig.stripOverPointer;
291
- var shiftPointerLabelX = (_37 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelX) !== null && _37 !== void 0 ? _37 : defaultPointerConfig.shiftPointerLabelX;
292
- var shiftPointerLabelY = (_38 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelY) !== null && _38 !== void 0 ? _38 : defaultPointerConfig.shiftPointerLabelY;
293
- var pointerLabelWidth = (_39 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelWidth) !== null && _39 !== void 0 ? _39 : defaultPointerConfig.pointerLabelWidth;
294
- var pointerLabelHeight = (_40 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelHeight) !== null && _40 !== void 0 ? _40 : defaultPointerConfig.pointerLabelHeight;
295
- var autoAdjustPointerLabelPosition = (_41 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.autoAdjustPointerLabelPosition) !== null && _41 !== void 0 ? _41 : defaultPointerConfig.autoAdjustPointerLabelPosition;
296
- var pointerVanishDelay = (_42 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerVanishDelay) !== null && _42 !== void 0 ? _42 : defaultPointerConfig.pointerVanishDelay;
297
- var activatePointersOnLongPress = (_43 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersOnLongPress) !== null && _43 !== void 0 ? _43 : defaultPointerConfig.activatePointersOnLongPress;
298
- var activatePointersDelay = (_44 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersDelay) !== null && _44 !== void 0 ? _44 : defaultPointerConfig.activatePointersDelay;
299
- var initialPointerIndex = (_45 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerIndex) !== null && _45 !== void 0 ? _45 : defaultPointerConfig.initialPointerIndex;
300
- var initialPointerAppearDelay = (_46 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerAppearDelay) !== null && _46 !== void 0 ? _46 : (isAnimated
286
+ var pointerStripHeight = (_32 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripHeight) !== null && _32 !== void 0 ? _32 : defaultPointerConfig.pointerStripHeight;
287
+ var pointerStripWidth = (_33 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripWidth) !== null && _33 !== void 0 ? _33 : defaultPointerConfig.pointerStripWidth;
288
+ var pointerStripColor = (_34 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripColor) !== null && _34 !== void 0 ? _34 : defaultPointerConfig.pointerStripColor;
289
+ var pointerStripUptoDataPoint = (_35 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripUptoDataPoint) !== null && _35 !== void 0 ? _35 : defaultPointerConfig.pointerStripUptoDataPoint;
290
+ var pointerLabelComponent = (_36 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelComponent) !== null && _36 !== void 0 ? _36 : defaultPointerConfig.pointerLabelComponent;
291
+ var stripOverPointer = (_37 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripOverPointer) !== null && _37 !== void 0 ? _37 : defaultPointerConfig.stripOverPointer;
292
+ var shiftPointerLabelX = (_38 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelX) !== null && _38 !== void 0 ? _38 : defaultPointerConfig.shiftPointerLabelX;
293
+ var shiftPointerLabelY = (_39 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelY) !== null && _39 !== void 0 ? _39 : defaultPointerConfig.shiftPointerLabelY;
294
+ var pointerLabelWidth = (_40 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelWidth) !== null && _40 !== void 0 ? _40 : defaultPointerConfig.pointerLabelWidth;
295
+ var pointerLabelHeight = (_41 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelHeight) !== null && _41 !== void 0 ? _41 : defaultPointerConfig.pointerLabelHeight;
296
+ var autoAdjustPointerLabelPosition = (_42 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.autoAdjustPointerLabelPosition) !== null && _42 !== void 0 ? _42 : defaultPointerConfig.autoAdjustPointerLabelPosition;
297
+ var pointerVanishDelay = (_43 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerVanishDelay) !== null && _43 !== void 0 ? _43 : defaultPointerConfig.pointerVanishDelay;
298
+ var activatePointersOnLongPress = (_44 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersOnLongPress) !== null && _44 !== void 0 ? _44 : defaultPointerConfig.activatePointersOnLongPress;
299
+ var activatePointersDelay = (_45 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersDelay) !== null && _45 !== void 0 ? _45 : defaultPointerConfig.activatePointersDelay;
300
+ var initialPointerIndex = (_46 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerIndex) !== null && _46 !== void 0 ? _46 : defaultPointerConfig.initialPointerIndex;
301
+ var initialPointerAppearDelay = (_47 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerAppearDelay) !== null && _47 !== void 0 ? _47 : (isAnimated
301
302
  ? animationDuration
302
303
  : defaultPointerConfig.initialPointerAppearDelay);
303
- var persistPointer = (_47 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.persistPointer) !== null && _47 !== void 0 ? _47 : defaultPointerConfig.persistPointer;
304
- var hidePointer1 = (_48 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer1) !== null && _48 !== void 0 ? _48 : defaultPointerConfig.hidePointer1;
304
+ var persistPointer = (_48 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.persistPointer) !== null && _48 !== void 0 ? _48 : defaultPointerConfig.persistPointer;
305
+ var hidePointer1 = (_49 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer1) !== null && _49 !== void 0 ? _49 : defaultPointerConfig.hidePointer1;
305
306
  var pointerEvents = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerEvents;
306
- var stripBehindBars = (_49 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripBehindBars) !== null && _49 !== void 0 ? _49 : defaultPointerConfig.stripBehindBars;
307
- var disableScroll = (_50 = props.disableScroll) !== null && _50 !== void 0 ? _50 : (pointerConfig
307
+ var stripBehindBars = (_50 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripBehindBars) !== null && _50 !== void 0 ? _50 : defaultPointerConfig.stripBehindBars;
308
+ var disableScroll = (_51 = props.disableScroll) !== null && _51 !== void 0 ? _51 : (pointerConfig
308
309
  ? activatePointersOnLongPress
309
310
  ? !!responderActive
310
311
  : true
311
312
  : false);
312
313
  var yAxisExtraHeightAtTop = props.trimYAxisAtTop
313
314
  ? 0
314
- : (_51 = props.yAxisExtraHeight) !== null && _51 !== void 0 ? _51 : containerHeight / 20;
315
+ : (_52 = props.yAxisExtraHeight) !== null && _52 !== void 0 ? _52 : containerHeight / 20;
315
316
  var barInnerComponent = props.barInnerComponent;
316
317
  var localYAxisOffset1 = lineConfig.isSecondary
317
- ? (_53 = (_52 = props.secondaryYAxis) === null || _52 === void 0 ? void 0 : _52.yAxisOffset) !== null && _53 !== void 0 ? _53 : 0
318
+ ? (_54 = (_53 = props.secondaryYAxis) === null || _53 === void 0 ? void 0 : _53.yAxisOffset) !== null && _54 !== void 0 ? _54 : 0
318
319
  : yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0;
319
320
  var localYAxisOffset2 = lineConfig2.isSecondary
320
- ? (_55 = (_54 = props.secondaryYAxis) === null || _54 === void 0 ? void 0 : _54.yAxisOffset) !== null && _55 !== void 0 ? _55 : 0
321
+ ? (_56 = (_55 = props.secondaryYAxis) === null || _55 === void 0 ? void 0 : _55.yAxisOffset) !== null && _56 !== void 0 ? _56 : 0
321
322
  : yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0;
322
323
  useEffect(function () {
323
324
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
@@ -433,9 +434,9 @@ export var useBarChart = function (props) {
433
434
  spacing,
434
435
  yAxisLabelWidth,
435
436
  lineConfig.showArrow,
436
- (_56 = lineConfig.arrowConfig) === null || _56 === void 0 ? void 0 : _56.length,
437
- (_57 = lineConfig.arrowConfig) === null || _57 === void 0 ? void 0 : _57.width,
438
- (_58 = lineConfig.arrowConfig) === null || _58 === void 0 ? void 0 : _58.showArrowBase
437
+ (_57 = lineConfig.arrowConfig) === null || _57 === void 0 ? void 0 : _57.length,
438
+ (_58 = lineConfig.arrowConfig) === null || _58 === void 0 ? void 0 : _58.width,
439
+ (_59 = lineConfig.arrowConfig) === null || _59 === void 0 ? void 0 : _59.showArrowBase
439
440
  ]);
440
441
  useEffect(function () {
441
442
  var _a, _b;
@@ -481,7 +482,7 @@ export var useBarChart = function (props) {
481
482
  outputRange: [0, initialSpacing + totalWidth]
482
483
  });
483
484
  var getPropsCommonForBarAndStack = function (item, index) {
484
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
485
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
485
486
  return {
486
487
  item: item,
487
488
  index: index,
@@ -499,7 +500,7 @@ export var useBarChart = function (props) {
499
500
  xAxisIndicesHeight: xAxisIndicesHeight,
500
501
  xAxisIndicesWidth: xAxisIndicesWidth,
501
502
  xAxisIndicesColor: xAxisIndicesColor,
502
- labelsDistanceFromXaxis: (_d = item.labelsDistanceFromXaxis) !== null && _d !== void 0 ? _d : labelsDistanceFromXaxis,
503
+ labelsDistanceFromXaxis: (_e = (_d = item.labelsDistanceFromXaxis) !== null && _d !== void 0 ? _d : labelsDistanceFromXaxis) !== null && _e !== void 0 ? _e : (xAxisLabelsAtBottom ? fourthQuadrantHeight : 0),
503
504
  horizontal: horizontal,
504
505
  rtl: rtl,
505
506
  intactTopLabel: intactTopLabel,
@@ -530,28 +531,29 @@ export var useBarChart = function (props) {
530
531
  xAxisTextNumberOfLines: xAxisTextNumberOfLines,
531
532
  xAxisLabelsHeight: props.xAxisLabelsHeight,
532
533
  xAxisLabelsVerticalShift: xAxisLabelsVerticalShift,
534
+ xAxisLabelsAtBottom: xAxisLabelsAtBottom,
533
535
  renderTooltip: props.renderTooltip,
534
- renderTooltipConditions: (_e = props.renderTooltipConditions) !== null && _e !== void 0 ? _e : BarDefaults.renderTooltipConditions,
535
- leftShiftForTooltip: (_f = props.leftShiftForTooltip) !== null && _f !== void 0 ? _f : 0,
536
+ renderTooltipConditions: (_f = props.renderTooltipConditions) !== null && _f !== void 0 ? _f : BarDefaults.renderTooltipConditions,
537
+ leftShiftForTooltip: (_g = props.leftShiftForTooltip) !== null && _g !== void 0 ? _g : 0,
536
538
  autoCenterTooltip: autoCenterTooltip,
537
539
  initialSpacing: initialSpacing,
538
540
  selectedIndex: selectedIndex,
539
541
  setSelectedIndex: setSelectedIndex,
540
- activeOpacity: (_g = props.activeOpacity) !== null && _g !== void 0 ? _g : 0.2,
542
+ activeOpacity: (_h = props.activeOpacity) !== null && _h !== void 0 ? _h : 0.2,
541
543
  noOfSectionsBelowXAxis: noOfSectionsBelowXAxis,
542
- leftShiftForLastIndexTooltip: (_h = props.leftShiftForLastIndexTooltip) !== null && _h !== void 0 ? _h : 0,
543
- label: (_j = item.label) !== null && _j !== void 0 ? _j : (((_k = props.xAxisLabelTexts) === null || _k === void 0 ? void 0 : _k[index]) ? props.xAxisLabelTexts[index] : ''),
544
- secondaryLabel: (_p = (_l = item.secondaryLabel) !== null && _l !== void 0 ? _l : (_o = (_m = props.secondaryXAxis) === null || _m === void 0 ? void 0 : _m.labelTexts) === null || _o === void 0 ? void 0 : _o[index]) !== null && _p !== void 0 ? _p : '',
545
- labelTextStyle: (_q = item.labelTextStyle) !== null && _q !== void 0 ? _q : props.xAxisLabelTextStyle,
546
- secondaryLabelTextStyle: (_u = (_t = (_r = item.secondaryLabelTextStyle) !== null && _r !== void 0 ? _r : (_s = props.secondaryXAxis) === null || _s === void 0 ? void 0 : _s.labelsTextStyle) !== null && _t !== void 0 ? _t : item.labelTextStyle) !== null && _u !== void 0 ? _u : props.xAxisLabelTextStyle,
544
+ leftShiftForLastIndexTooltip: (_j = props.leftShiftForLastIndexTooltip) !== null && _j !== void 0 ? _j : 0,
545
+ label: (_k = item.label) !== null && _k !== void 0 ? _k : (((_l = props.xAxisLabelTexts) === null || _l === void 0 ? void 0 : _l[index]) ? props.xAxisLabelTexts[index] : ''),
546
+ secondaryLabel: (_q = (_m = item.secondaryLabel) !== null && _m !== void 0 ? _m : (_p = (_o = props.secondaryXAxis) === null || _o === void 0 ? void 0 : _o.labelTexts) === null || _p === void 0 ? void 0 : _p[index]) !== null && _q !== void 0 ? _q : '',
547
+ labelTextStyle: (_r = item.labelTextStyle) !== null && _r !== void 0 ? _r : props.xAxisLabelTextStyle,
548
+ secondaryLabelTextStyle: (_v = (_u = (_s = item.secondaryLabelTextStyle) !== null && _s !== void 0 ? _s : (_t = props.secondaryXAxis) === null || _t === void 0 ? void 0 : _t.labelsTextStyle) !== null && _u !== void 0 ? _u : item.labelTextStyle) !== null && _v !== void 0 ? _v : props.xAxisLabelTextStyle,
547
549
  pointerConfig: pointerConfig,
548
550
  yAxisExtraHeightAtTop: yAxisExtraHeightAtTop,
549
551
  yAxisOffset: yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0,
550
552
  focusedBarIndex: focusedBarIndex,
551
553
  stepHeight: stepHeight,
552
554
  stepValue: stepValue,
553
- negativeStepHeight: (_v = props.negativeStepHeight) !== null && _v !== void 0 ? _v : stepHeight,
554
- negativeStepValue: (_w = props.negativeStepValue) !== null && _w !== void 0 ? _w : stepValue,
555
+ negativeStepHeight: (_w = props.negativeStepHeight) !== null && _w !== void 0 ? _w : stepHeight,
556
+ negativeStepValue: (_x = props.negativeStepValue) !== null && _x !== void 0 ? _x : stepValue,
555
557
  secondaryXAxis: props.secondaryXAxis,
556
558
  secondaryYAxis: props.secondaryYAxis,
557
559
  secondaryStepHeight: secondaryStepHeight,
@@ -559,7 +561,7 @@ export var useBarChart = function (props) {
559
561
  secondaryNegativeStepHeight: secondaryNegativeStepHeight,
560
562
  secondaryNegativeStepValue: secondaryNegativeStepValue,
561
563
  secondaryNoOfSectionsBelowXAxis: secondaryNoOfSectionsBelowXAxis,
562
- barMarginBottom: (_y = (_x = item.barMarginBottom) !== null && _x !== void 0 ? _x : props.barMarginBottom) !== null && _y !== void 0 ? _y : 0,
564
+ barMarginBottom: (_z = (_y = item.barMarginBottom) !== null && _y !== void 0 ? _y : props.barMarginBottom) !== null && _z !== void 0 ? _z : 0,
563
565
  highlightEnabled: highlightEnabled,
564
566
  highlightedBarIndex: highlightedBarIndex,
565
567
  lowlightOpacity: lowlightOpacity,
@@ -571,19 +573,19 @@ export var useBarChart = function (props) {
571
573
  containerHeight: containerHeight,
572
574
  noOfSectionsBelowXAxis: noOfSectionsBelowXAxis,
573
575
  stepHeight: stepHeight,
574
- negativeStepHeight: (_59 = props.negativeStepHeight) !== null && _59 !== void 0 ? _59 : stepHeight,
576
+ negativeStepHeight: (_60 = props.negativeStepHeight) !== null && _60 !== void 0 ? _60 : stepHeight,
575
577
  labelsExtraHeight: labelsExtraHeight,
576
578
  yAxisLabelWidth: yAxisLabelWidth,
577
579
  horizontal: horizontal,
578
580
  rtl: rtl,
579
- shiftX: (_60 = props.shiftX) !== null && _60 !== void 0 ? _60 : 0,
580
- shiftY: (_61 = props.shiftY) !== null && _61 !== void 0 ? _61 : 0,
581
+ shiftX: (_61 = props.shiftX) !== null && _61 !== void 0 ? _61 : 0,
582
+ shiftY: (_62 = props.shiftY) !== null && _62 !== void 0 ? _62 : 0,
581
583
  yAxisAtTop: yAxisAtTop,
582
584
  initialSpacing: initialSpacing,
583
585
  data: data,
584
586
  stackData: stackData,
585
587
  // secondaryData,
586
- barWidth: (_62 = props.barWidth) !== null && _62 !== void 0 ? _62 : defaultBarWidth,
588
+ barWidth: (_63 = props.barWidth) !== null && _63 !== void 0 ? _63 : defaultBarWidth,
587
589
  xAxisThickness: xAxisThickness,
588
590
  totalWidth: totalWidth,
589
591
  disableScroll: disableScroll,
@@ -632,11 +634,12 @@ export var useBarChart = function (props) {
632
634
  pointerY: pointerY,
633
635
  onEndReached: props.onEndReached,
634
636
  onStartReached: props.onStartReached,
635
- endReachedOffset: (_63 = props.endReachedOffset) !== null && _63 !== void 0 ? _63 : BarDefaults.endReachedOffset,
637
+ endReachedOffset: (_64 = props.endReachedOffset) !== null && _64 !== void 0 ? _64 : BarDefaults.endReachedOffset,
636
638
  onMomentumScrollEnd: props.onMomentumScrollEnd,
637
639
  customBackground: props.customBackground,
638
640
  highlightEnabled: highlightEnabled,
639
- lowlightOpacity: lowlightOpacity
641
+ lowlightOpacity: lowlightOpacity,
642
+ xAxisLabelsAtBottom: xAxisLabelsAtBottom
640
643
  };
641
644
  return {
642
645
  lineConfig: lineConfig,
@@ -689,6 +692,7 @@ export var useBarChart = function (props) {
689
692
  noOfSectionsBelowXAxis: noOfSectionsBelowXAxis,
690
693
  stepHeight: stepHeight,
691
694
  xAxisLabelsVerticalShift: xAxisLabelsVerticalShift,
695
+ xAxisLabelsAtBottom: xAxisLabelsAtBottom,
692
696
  labelsExtraHeight: labelsExtraHeight,
693
697
  stripOverPointer: stripOverPointer,
694
698
  pointerLabelComponent: pointerLabelComponent,
@@ -71,6 +71,7 @@ export interface StackedBarChartPropsType {
71
71
  labelTextStyle?: any;
72
72
  autoShiftLabelsForNegativeStacks?: boolean;
73
73
  labelsDistanceFromXaxis?: number;
74
+ xAxisLabelsAtBottom?: boolean;
74
75
  disablePress?: boolean;
75
76
  item: stackDataItem;
76
77
  index: number;
@@ -188,6 +189,7 @@ export interface BarChartPropsType {
188
189
  xAxisTextNumberOfLines?: number;
189
190
  xAxisLabelsHeight?: number;
190
191
  xAxisLabelsVerticalShift?: number;
192
+ xAxisLabelsAtBottom?: boolean;
191
193
  yAxisLabelWidth?: number;
192
194
  hideYAxisText?: boolean;
193
195
  rotateYAxisTexts?: number;
@@ -437,7 +437,8 @@ export var useLineChartBiColor = function (props) {
437
437
  endReachedOffset: (_51 = props.endReachedOffset) !== null && _51 !== void 0 ? _51 : LineDefaults.endReachedOffset,
438
438
  extraWidthDueToDataPoint: extraWidthDueToDataPoint,
439
439
  highlightEnabled: LineDefaults.highlightEnabled,
440
- lowlightOpacity: LineDefaults.lowlightOpacity
440
+ lowlightOpacity: LineDefaults.lowlightOpacity,
441
+ xAxisLabelsAtBottom: false
441
442
  };
442
443
  return {
443
444
  toggle: toggle,
@@ -330,6 +330,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
330
330
  xAxisIndicesColor: import("react-native").ColorValue;
331
331
  xAxisTextNumberOfLines: number;
332
332
  xAxisLabelsVerticalShift: number;
333
+ xAxisLabelsAtBottom: boolean;
333
334
  horizontalRulesStyle: any;
334
335
  showFractionalValues: boolean;
335
336
  roundToDigits: number;
@@ -39,8 +39,8 @@ import { AxesAndRulesDefaults, LineDefaults, SEGMENT_END, SEGMENT_START, chartTy
39
39
  import { computeMaxAndMinItems, getAllArrowProperties, getArrowPoints, getAxesAndRulesProps, getCurvePathWithSegments, getExtendedContainerHeightWithPadding, getLineSegmentsDueToNoExtrapolation, getLineSegmentsForMissingValues, getMaxValue, getNoOfSections, getPathWithHighlight, getSanitisedData, getSecondaryDataWithOffsetIncluded, getSegmentString, indexOfFirstNonZeroDigit, svgPath } from '../utils';
40
40
  import { EdgePosition } from '../utils/types';
41
41
  export var useLineChart = function (props) {
42
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222, _223, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235, _236, _237, _238, _239, _240, _241, _242, _243, _244, _245, _246, _247, _248, _249, _250, _251, _252, _253, _254, _255, _256, _257, _258, _259, _260, _261, _262, _263, _264, _265, _266, _267, _268, _269, _270, _271, _272, _273, _274, _275, _276, _277, _278, _279, _280, _281, _282, _283, _284, _285, _286, _287, _288, _289, _290, _291, _292, _293, _294, _295, _296, _297, _298, _299, _300, _301, _302, _303, _304, _305, _306, _307, _308, _309, _310, _311, _312, _313, _314, _315, _316, _317, _318, _319, _320, _321, _322, _323, _324, _325, _326, _327, _328, _329, _330, _331, _332, _333, _334, _335, _336;
43
- var showDataPointsForMissingValues = props.showDataPointsForMissingValues, _337 = props.interpolateMissingValues, interpolateMissingValues = _337 === void 0 ? true : _337, _338 = props.extrapolateMissingValues, extrapolateMissingValues = _338 === void 0 ? true : _338, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth, negativeStepValue = props.negativeStepValue, renderTooltip = props.renderTooltip, _339 = props.renderTooltip1, renderTooltip1 = _339 === void 0 ? props.renderTooltip : _339, _340 = props.renderTooltip2, renderTooltip2 = _340 === void 0 ? props.renderTooltip : _340, _341 = props.renderTooltip3, renderTooltip3 = _341 === void 0 ? props.renderTooltip : _341, _342 = props.renderTooltip4, renderTooltip4 = _342 === void 0 ? props.renderTooltip : _342, _343 = props.renderTooltip5, renderTooltip5 = _343 === void 0 ? props.renderTooltip : _343, _344 = props.renderTooltipSecondary, renderTooltipSecondary = _344 === void 0 ? props.renderTooltip : _344;
42
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222, _223, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235, _236, _237, _238, _239, _240, _241, _242, _243, _244, _245, _246, _247, _248, _249, _250, _251, _252, _253, _254, _255, _256, _257, _258, _259, _260, _261, _262, _263, _264, _265, _266, _267, _268, _269, _270, _271, _272, _273, _274, _275, _276, _277, _278, _279, _280, _281, _282, _283, _284, _285, _286, _287, _288, _289, _290, _291, _292, _293, _294, _295, _296, _297, _298, _299, _300, _301, _302, _303, _304, _305, _306, _307, _308, _309, _310, _311, _312, _313, _314, _315, _316, _317, _318, _319, _320, _321, _322, _323, _324, _325, _326, _327, _328, _329, _330, _331, _332, _333, _334, _335, _336, _337;
43
+ var showDataPointsForMissingValues = props.showDataPointsForMissingValues, _338 = props.interpolateMissingValues, interpolateMissingValues = _338 === void 0 ? true : _338, _339 = props.extrapolateMissingValues, extrapolateMissingValues = _339 === void 0 ? true : _339, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth, negativeStepValue = props.negativeStepValue, renderTooltip = props.renderTooltip, _340 = props.renderTooltip1, renderTooltip1 = _340 === void 0 ? props.renderTooltip : _340, _341 = props.renderTooltip2, renderTooltip2 = _341 === void 0 ? props.renderTooltip : _341, _342 = props.renderTooltip3, renderTooltip3 = _342 === void 0 ? props.renderTooltip : _342, _343 = props.renderTooltip4, renderTooltip4 = _343 === void 0 ? props.renderTooltip : _343, _344 = props.renderTooltip5, renderTooltip5 = _344 === void 0 ? props.renderTooltip : _344, _345 = props.renderTooltipSecondary, renderTooltipSecondary = _345 === void 0 ? props.renderTooltip : _345;
44
44
  var lastLineNumber = 1;
45
45
  if (props.secondaryData) {
46
46
  lastLineNumber = 6667; // lastLineNumber is 6667 for a secondary line, so the index or key of the secondary line is 6666
@@ -63,48 +63,48 @@ export var useLineChart = function (props) {
63
63
  // because in absence of extrapolation we don't want the chart to unnecessarily show the 4th quadrant
64
64
  var curvature = (_l = props.curvature) !== null && _l !== void 0 ? _l : LineDefaults.curvature;
65
65
  var curveType = (_m = props.curveType) !== null && _m !== void 0 ? _m : LineDefaults.curveType;
66
- var _345 = __read(useState(0), 2), scrollX = _345[0], setScrollX = _345[1];
67
- var _346 = __read(useState(''), 2), arrow1Points = _346[0], setArrow1Points = _346[1];
68
- var _347 = __read(useState(''), 2), arrow2Points = _347[0], setArrow2Points = _347[1];
69
- var _348 = __read(useState(''), 2), arrow3Points = _348[0], setArrow3Points = _348[1];
70
- var _349 = __read(useState(''), 2), arrow4Points = _349[0], setArrow4Points = _349[1];
71
- var _350 = __read(useState(''), 2), arrow5Points = _350[0], setArrow5Points = _350[1];
72
- var _351 = __read(useState(''), 2), secondaryArrowPoints = _351[0], setSecondaryArrowPoints = _351[1];
73
- var _352 = __read(useState(-1), 2), pointerIndex = _352[0], setPointerIndex = _352[1];
74
- var _353 = __read(useState(0), 2), pointerX = _353[0], setPointerX = _353[1];
75
- var _354 = __read(useState(0), 2), pointerY = _354[0], setPointerY = _354[1];
76
- var _355 = __read(useState(), 2), pointerItem = _355[0], setPointerItem = _355[1];
77
- var _356 = __read(useState(0), 2), pointerY2 = _356[0], setPointerY2 = _356[1];
78
- var _357 = __read(useState(), 2), pointerItem2 = _357[0], setPointerItem2 = _357[1];
79
- var _358 = __read(useState(0), 2), pointerY3 = _358[0], setPointerY3 = _358[1];
80
- var _359 = __read(useState(), 2), pointerItem3 = _359[0], setPointerItem3 = _359[1];
81
- var _360 = __read(useState(0), 2), pointerY4 = _360[0], setPointerY4 = _360[1];
82
- var _361 = __read(useState(), 2), pointerItem4 = _361[0], setPointerItem4 = _361[1];
83
- var _362 = __read(useState(0), 2), pointerY5 = _362[0], setPointerY5 = _362[1];
84
- var _363 = __read(useState([]), 2), pointerYsForDataSet = _363[0], setPointerYsForDataSet = _363[1];
85
- var _364 = __read(useState(), 2), pointerItem5 = _364[0], setPointerItem5 = _364[1];
86
- var _365 = __read(useState(0), 2), secondaryPointerY = _365[0], setSecondaryPointerY = _365[1];
87
- var _366 = __read(useState(), 2), secondaryPointerItem = _366[0], setSecondaryPointerItem = _366[1];
88
- var _367 = __read(useState([]), 2), pointerItemsForSet = _367[0], setPointerItemsForSet = _367[1];
89
- var _368 = __read(useState([]), 2), secondaryPointerItemsForSet = _368[0], setSecondaryPointerItemsForSet = _368[1];
90
- var _369 = __read(useState(0), 2), responderStartTime = _369[0], setResponderStartTime = _369[1];
91
- var _370 = __read(useState(false), 2), responderActive = _370[0], setResponderActive = _370[1];
92
- var _371 = __read(useState(''), 2), points = _371[0], setPoints = _371[1];
93
- var _372 = __read(useState(''), 2), points2 = _372[0], setPoints2 = _372[1];
94
- var _373 = __read(useState(''), 2), points3 = _373[0], setPoints3 = _373[1];
95
- var _374 = __read(useState(''), 2), points4 = _374[0], setPoints4 = _374[1];
96
- var _375 = __read(useState(''), 2), points5 = _375[0], setPoints5 = _375[1];
97
- var _376 = __read(useState(''), 2), secondaryPoints = _376[0], setSecondaryPoints = _376[1];
98
- var _377 = __read(useState(''), 2), fillPoints = _377[0], setFillPoints = _377[1];
99
- var _378 = __read(useState(''), 2), fillPoints2 = _378[0], setFillPoints2 = _378[1];
100
- var _379 = __read(useState(''), 2), fillPoints3 = _379[0], setFillPoints3 = _379[1];
101
- var _380 = __read(useState(''), 2), fillPoints4 = _380[0], setFillPoints4 = _380[1];
102
- var _381 = __read(useState(''), 2), fillPoints5 = _381[0], setFillPoints5 = _381[1];
103
- var _382 = __read(useState(''), 2), secondaryFillPoints = _382[0], setSecondaryFillPoints = _382[1];
104
- var _383 = __read(useState([]), 2), pointsFromSet = _383[0], setPointsFromSet = _383[1];
105
- var _384 = __read(useState([]), 2), fillPointsFromSet = _384[0], setFillPointsFromSet = _384[1];
106
- var _385 = __read(useState([]), 2), arrowPointsFromSet = _385[0], setArrowPointsFromSet = _385[1];
107
- var _386 = __read(useState((_o = props.focusedDataPointIndex) !== null && _o !== void 0 ? _o : -1), 2), selectedIndex = _386[0], setSelectedIndex = _386[1];
66
+ var _346 = __read(useState(0), 2), scrollX = _346[0], setScrollX = _346[1];
67
+ var _347 = __read(useState(''), 2), arrow1Points = _347[0], setArrow1Points = _347[1];
68
+ var _348 = __read(useState(''), 2), arrow2Points = _348[0], setArrow2Points = _348[1];
69
+ var _349 = __read(useState(''), 2), arrow3Points = _349[0], setArrow3Points = _349[1];
70
+ var _350 = __read(useState(''), 2), arrow4Points = _350[0], setArrow4Points = _350[1];
71
+ var _351 = __read(useState(''), 2), arrow5Points = _351[0], setArrow5Points = _351[1];
72
+ var _352 = __read(useState(''), 2), secondaryArrowPoints = _352[0], setSecondaryArrowPoints = _352[1];
73
+ var _353 = __read(useState(-1), 2), pointerIndex = _353[0], setPointerIndex = _353[1];
74
+ var _354 = __read(useState(0), 2), pointerX = _354[0], setPointerX = _354[1];
75
+ var _355 = __read(useState(0), 2), pointerY = _355[0], setPointerY = _355[1];
76
+ var _356 = __read(useState(), 2), pointerItem = _356[0], setPointerItem = _356[1];
77
+ var _357 = __read(useState(0), 2), pointerY2 = _357[0], setPointerY2 = _357[1];
78
+ var _358 = __read(useState(), 2), pointerItem2 = _358[0], setPointerItem2 = _358[1];
79
+ var _359 = __read(useState(0), 2), pointerY3 = _359[0], setPointerY3 = _359[1];
80
+ var _360 = __read(useState(), 2), pointerItem3 = _360[0], setPointerItem3 = _360[1];
81
+ var _361 = __read(useState(0), 2), pointerY4 = _361[0], setPointerY4 = _361[1];
82
+ var _362 = __read(useState(), 2), pointerItem4 = _362[0], setPointerItem4 = _362[1];
83
+ var _363 = __read(useState(0), 2), pointerY5 = _363[0], setPointerY5 = _363[1];
84
+ var _364 = __read(useState([]), 2), pointerYsForDataSet = _364[0], setPointerYsForDataSet = _364[1];
85
+ var _365 = __read(useState(), 2), pointerItem5 = _365[0], setPointerItem5 = _365[1];
86
+ var _366 = __read(useState(0), 2), secondaryPointerY = _366[0], setSecondaryPointerY = _366[1];
87
+ var _367 = __read(useState(), 2), secondaryPointerItem = _367[0], setSecondaryPointerItem = _367[1];
88
+ var _368 = __read(useState([]), 2), pointerItemsForSet = _368[0], setPointerItemsForSet = _368[1];
89
+ var _369 = __read(useState([]), 2), secondaryPointerItemsForSet = _369[0], setSecondaryPointerItemsForSet = _369[1];
90
+ var _370 = __read(useState(0), 2), responderStartTime = _370[0], setResponderStartTime = _370[1];
91
+ var _371 = __read(useState(false), 2), responderActive = _371[0], setResponderActive = _371[1];
92
+ var _372 = __read(useState(''), 2), points = _372[0], setPoints = _372[1];
93
+ var _373 = __read(useState(''), 2), points2 = _373[0], setPoints2 = _373[1];
94
+ var _374 = __read(useState(''), 2), points3 = _374[0], setPoints3 = _374[1];
95
+ var _375 = __read(useState(''), 2), points4 = _375[0], setPoints4 = _375[1];
96
+ var _376 = __read(useState(''), 2), points5 = _376[0], setPoints5 = _376[1];
97
+ var _377 = __read(useState(''), 2), secondaryPoints = _377[0], setSecondaryPoints = _377[1];
98
+ var _378 = __read(useState(''), 2), fillPoints = _378[0], setFillPoints = _378[1];
99
+ var _379 = __read(useState(''), 2), fillPoints2 = _379[0], setFillPoints2 = _379[1];
100
+ var _380 = __read(useState(''), 2), fillPoints3 = _380[0], setFillPoints3 = _380[1];
101
+ var _381 = __read(useState(''), 2), fillPoints4 = _381[0], setFillPoints4 = _381[1];
102
+ var _382 = __read(useState(''), 2), fillPoints5 = _382[0], setFillPoints5 = _382[1];
103
+ var _383 = __read(useState(''), 2), secondaryFillPoints = _383[0], setSecondaryFillPoints = _383[1];
104
+ var _384 = __read(useState([]), 2), pointsFromSet = _384[0], setPointsFromSet = _384[1];
105
+ var _385 = __read(useState([]), 2), fillPointsFromSet = _385[0], setFillPointsFromSet = _385[1];
106
+ var _386 = __read(useState([]), 2), arrowPointsFromSet = _386[0], setArrowPointsFromSet = _386[1];
107
+ var _387 = __read(useState((_o = props.focusedDataPointIndex) !== null && _o !== void 0 ? _o : -1), 2), selectedIndex = _387[0], setSelectedIndex = _387[1];
108
108
  useEffect(function () {
109
109
  var _a;
110
110
  setSelectedIndex((_a = props.focusedDataPointIndex) !== null && _a !== void 0 ? _a : -1);
@@ -417,7 +417,7 @@ export var useLineChart = function (props) {
417
417
  Math, __spreadArray([], __read(mergedPrimaryDataArrays.map(function (i) { return Math.max(i.value, 0); })), false)); // find the smallest +ve number
418
418
  var showFractionalValues = (_106 = props.showFractionalValues) !== null && _106 !== void 0 ? _106 : (isFinite(valuesRange) && valuesRange <= 1);
419
419
  var roundToDigits = (_107 = props.roundToDigits) !== null && _107 !== void 0 ? _107 : (showFractionalValues ? indexOfFirstNonZeroDigit(valuesRange) + 1 : 0);
420
- var _387 = computeMaxAndMinItems(mergedPrimaryDataArrays, extrapolateMissingValues, roundToDigits, showFractionalValues, mergedPrimaryDataArraysOriginals), maxItem = _387.maxItem, minItem = _387.minItem;
420
+ var _388 = computeMaxAndMinItems(mergedPrimaryDataArrays, extrapolateMissingValues, roundToDigits, showFractionalValues, mergedPrimaryDataArraysOriginals), maxItem = _388.maxItem, minItem = _388.minItem;
421
421
  var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxItem) || 10;
422
422
  var mostNegativeValue = (_108 = props.mostNegativeValue) !== null && _108 !== void 0 ? _108 : minItem;
423
423
  var overflowTop = ((_109 = props.overflowTop) !== null && _109 !== void 0 ? _109 : props.secondaryXAxis)
@@ -437,7 +437,7 @@ export var useLineChart = function (props) {
437
437
  var secondaryRoundToDigits = (_113 = (_112 = props.secondaryYAxis) === null || _112 === void 0 ? void 0 : _112.roundToDigits) !== null && _113 !== void 0 ? _113 : (showSecondaryFractionalValues
438
438
  ? indexOfFirstNonZeroDigit(secondaryValuesRange) + 1
439
439
  : 0);
440
- var _388 = computeMaxAndMinItems(mergedSecondaryDataArrays, extrapolateMissingValues, secondaryRoundToDigits, showSecondaryFractionalValues), secondaryMaxItem = _388.maxItem, secondaryMinItem = _388.minItem;
440
+ var _389 = computeMaxAndMinItems(mergedSecondaryDataArrays, extrapolateMissingValues, secondaryRoundToDigits, showSecondaryFractionalValues), secondaryMaxItem = _389.maxItem, secondaryMinItem = _389.minItem;
441
441
  var secondaryMaxValue = (_115 = (_114 = props.secondaryYAxis) === null || _114 === void 0 ? void 0 : _114.maxValue) !== null && _115 !== void 0 ? _115 : (secondaryMaxItem || maxValue);
442
442
  var getSecondaryY = function (value) {
443
443
  return extendedContainerHeight - (value * containerHeight) / secondaryMaxValue;
@@ -500,7 +500,7 @@ export var useLineChart = function (props) {
500
500
  var endOpacity5 = (_200 = props.endOpacity5) !== null && _200 !== void 0 ? _200 : endOpacity;
501
501
  defaultArrowConfig.strokeWidth = (_202 = (_201 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _201 === void 0 ? void 0 : _201.thickness) !== null && _202 !== void 0 ? _202 : thickness1;
502
502
  defaultArrowConfig.strokeColor = (_204 = (_203 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _203 === void 0 ? void 0 : _203.color) !== null && _204 !== void 0 ? _204 : color1;
503
- var _389 = getAllArrowProperties(props, defaultArrowConfig), arrowLength1 = _389.arrowLength1, arrowWidth1 = _389.arrowWidth1, arrowStrokeWidth1 = _389.arrowStrokeWidth1, arrowStrokeColor1 = _389.arrowStrokeColor1, arrowFillColor1 = _389.arrowFillColor1, showArrowBase1 = _389.showArrowBase1, arrowLength2 = _389.arrowLength2, arrowWidth2 = _389.arrowWidth2, arrowStrokeWidth2 = _389.arrowStrokeWidth2, arrowStrokeColor2 = _389.arrowStrokeColor2, arrowFillColor2 = _389.arrowFillColor2, showArrowBase2 = _389.showArrowBase2, arrowLength3 = _389.arrowLength3, arrowWidth3 = _389.arrowWidth3, arrowStrokeWidth3 = _389.arrowStrokeWidth3, arrowStrokeColor3 = _389.arrowStrokeColor3, arrowFillColor3 = _389.arrowFillColor3, showArrowBase3 = _389.showArrowBase3, arrowLength4 = _389.arrowLength4, arrowWidth4 = _389.arrowWidth4, arrowStrokeWidth4 = _389.arrowStrokeWidth4, arrowStrokeColor4 = _389.arrowStrokeColor4, arrowFillColor4 = _389.arrowFillColor4, showArrowBase4 = _389.showArrowBase4, arrowLength5 = _389.arrowLength5, arrowWidth5 = _389.arrowWidth5, arrowStrokeWidth5 = _389.arrowStrokeWidth5, arrowStrokeColor5 = _389.arrowStrokeColor5, arrowFillColor5 = _389.arrowFillColor5, showArrowBase5 = _389.showArrowBase5, arrowLengthsFromSet = _389.arrowLengthsFromSet, arrowWidthsFromSet = _389.arrowWidthsFromSet, arrowStrokeWidthsFromSet = _389.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _389.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _389.arrowFillColorsFromSet, showArrowBasesFromSet = _389.showArrowBasesFromSet;
503
+ var _390 = getAllArrowProperties(props, defaultArrowConfig), arrowLength1 = _390.arrowLength1, arrowWidth1 = _390.arrowWidth1, arrowStrokeWidth1 = _390.arrowStrokeWidth1, arrowStrokeColor1 = _390.arrowStrokeColor1, arrowFillColor1 = _390.arrowFillColor1, showArrowBase1 = _390.showArrowBase1, arrowLength2 = _390.arrowLength2, arrowWidth2 = _390.arrowWidth2, arrowStrokeWidth2 = _390.arrowStrokeWidth2, arrowStrokeColor2 = _390.arrowStrokeColor2, arrowFillColor2 = _390.arrowFillColor2, showArrowBase2 = _390.showArrowBase2, arrowLength3 = _390.arrowLength3, arrowWidth3 = _390.arrowWidth3, arrowStrokeWidth3 = _390.arrowStrokeWidth3, arrowStrokeColor3 = _390.arrowStrokeColor3, arrowFillColor3 = _390.arrowFillColor3, showArrowBase3 = _390.showArrowBase3, arrowLength4 = _390.arrowLength4, arrowWidth4 = _390.arrowWidth4, arrowStrokeWidth4 = _390.arrowStrokeWidth4, arrowStrokeColor4 = _390.arrowStrokeColor4, arrowFillColor4 = _390.arrowFillColor4, showArrowBase4 = _390.showArrowBase4, arrowLength5 = _390.arrowLength5, arrowWidth5 = _390.arrowWidth5, arrowStrokeWidth5 = _390.arrowStrokeWidth5, arrowStrokeColor5 = _390.arrowStrokeColor5, arrowFillColor5 = _390.arrowFillColor5, showArrowBase5 = _390.showArrowBase5, arrowLengthsFromSet = _390.arrowLengthsFromSet, arrowWidthsFromSet = _390.arrowWidthsFromSet, arrowStrokeWidthsFromSet = _390.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _390.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _390.arrowFillColorsFromSet, showArrowBasesFromSet = _390.showArrowBasesFromSet;
504
504
  var secondaryLineConfig = {
505
505
  zIndex: (_206 = (_205 = props.secondaryLineConfig) === null || _205 === void 0 ? void 0 : _205.zIndex) !== null && _206 !== void 0 ? _206 : zIndex1,
506
506
  curved: (_208 = (_207 = props.secondaryLineConfig) === null || _207 === void 0 ? void 0 : _207.curved) !== null && _208 !== void 0 ? _208 : props.curved,
@@ -1082,86 +1082,89 @@ export var useLineChart = function (props) {
1082
1082
  var noOfSectionsBelowXAxis = (_263 = props.noOfSectionsBelowXAxis) !== null && _263 !== void 0 ? _263 : Math.round(Math.ceil(-mostNegativeValue / stepValue));
1083
1083
  var axesAndRulesProps = getAxesAndRulesProps(props, containerHeight, stepHeight, stepValue, noOfSections, roundToDigits, negativeStepValue !== null && negativeStepValue !== void 0 ? negativeStepValue : stepValue, secondaryMaxValue, secondaryMinItem, showSecondaryFractionalValues, secondaryRoundToDigits);
1084
1084
  var secondaryNoOfSectionsBelowXAxis = axesAndRulesProps.secondaryYAxisConfig.noOfSectionsBelowXAxis;
1085
- var containerHeightIncludingBelowXAxis = extendedContainerHeight +
1086
- Math.max(noOfSectionsBelowXAxis, secondaryNoOfSectionsBelowXAxis) *
1087
- stepHeight;
1085
+ var fourthQuadrantHeight = Math.max(noOfSectionsBelowXAxis, secondaryNoOfSectionsBelowXAxis) *
1086
+ stepHeight;
1087
+ var containerHeightIncludingBelowXAxis = extendedContainerHeight + fourthQuadrantHeight;
1088
1088
  var showXAxisIndices = (_264 = props.showXAxisIndices) !== null && _264 !== void 0 ? _264 : AxesAndRulesDefaults.showXAxisIndices;
1089
1089
  var xAxisIndicesHeight = (_265 = props.xAxisIndicesHeight) !== null && _265 !== void 0 ? _265 : AxesAndRulesDefaults.xAxisIndicesHeight;
1090
1090
  var xAxisIndicesWidth = (_266 = props.xAxisIndicesWidth) !== null && _266 !== void 0 ? _266 : AxesAndRulesDefaults.xAxisIndicesWidth;
1091
1091
  var xAxisIndicesColor = (_267 = props.xAxisIndicesColor) !== null && _267 !== void 0 ? _267 : AxesAndRulesDefaults.xAxisIndicesColor;
1092
- var xAxisTextNumberOfLines = (_268 = props.xAxisTextNumberOfLines) !== null && _268 !== void 0 ? _268 : AxesAndRulesDefaults.xAxisTextNumberOfLines;
1093
- var xAxisLabelsVerticalShift = (_269 = props.xAxisLabelsVerticalShift) !== null && _269 !== void 0 ? _269 : AxesAndRulesDefaults.xAxisLabelsVerticalShift;
1092
+ var xAxisLabelsAtBottom = (_268 = props.xAxisLabelsAtBottom) !== null && _268 !== void 0 ? _268 : false;
1093
+ var xAxisTextNumberOfLines = (_269 = props.xAxisTextNumberOfLines) !== null && _269 !== void 0 ? _269 : AxesAndRulesDefaults.xAxisTextNumberOfLines;
1094
+ var xAxisLabelsVerticalShift = (_270 = props.xAxisLabelsVerticalShift) !== null && _270 !== void 0 ? _270 : (xAxisLabelsAtBottom
1095
+ ? fourthQuadrantHeight
1096
+ : AxesAndRulesDefaults.xAxisLabelsVerticalShift);
1094
1097
  var horizontalRulesStyle = props.horizontalRulesStyle;
1095
1098
  var horizontal = false;
1096
1099
  var yAxisAtTop = false;
1097
1100
  defaultPointerConfig.pointerStripHeight =
1098
1101
  containerHeight + noOfSectionsBelowXAxis * stepHeight;
1099
1102
  var pointerConfig = props.pointerConfig;
1100
- var getPointerProps = (_270 = props.getPointerProps) !== null && _270 !== void 0 ? _270 : null;
1101
- var pointerHeight = (_271 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.height) !== null && _271 !== void 0 ? _271 : defaultPointerConfig.height;
1102
- var pointerWidth = (_272 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.width) !== null && _272 !== void 0 ? _272 : defaultPointerConfig.width;
1103
- var pointerRadius = (_273 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.radius) !== null && _273 !== void 0 ? _273 : defaultPointerConfig.radius;
1104
- var pointerColor = (_274 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerColor) !== null && _274 !== void 0 ? _274 : defaultPointerConfig.pointerColor;
1105
- var pointerComponent = (_275 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerComponent) !== null && _275 !== void 0 ? _275 : defaultPointerConfig.pointerComponent;
1103
+ var getPointerProps = (_271 = props.getPointerProps) !== null && _271 !== void 0 ? _271 : null;
1104
+ var pointerHeight = (_272 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.height) !== null && _272 !== void 0 ? _272 : defaultPointerConfig.height;
1105
+ var pointerWidth = (_273 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.width) !== null && _273 !== void 0 ? _273 : defaultPointerConfig.width;
1106
+ var pointerRadius = (_274 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.radius) !== null && _274 !== void 0 ? _274 : defaultPointerConfig.radius;
1107
+ var pointerColor = (_275 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerColor) !== null && _275 !== void 0 ? _275 : defaultPointerConfig.pointerColor;
1108
+ var pointerComponent = (_276 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerComponent) !== null && _276 !== void 0 ? _276 : defaultPointerConfig.pointerComponent;
1106
1109
  var showPointerStrip = (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.showPointerStrip) === false
1107
1110
  ? false
1108
1111
  : defaultPointerConfig.showPointerStrip;
1109
- var pointerStripHeight = (_276 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripHeight) !== null && _276 !== void 0 ? _276 : defaultPointerConfig.pointerStripHeight;
1110
- var pointerStripWidth = (_277 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripWidth) !== null && _277 !== void 0 ? _277 : defaultPointerConfig.pointerStripWidth;
1111
- var pointerStripColor = (_278 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripColor) !== null && _278 !== void 0 ? _278 : defaultPointerConfig.pointerStripColor;
1112
- var pointerStripUptoDataPoint = (_279 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripUptoDataPoint) !== null && _279 !== void 0 ? _279 : defaultPointerConfig.pointerStripUptoDataPoint;
1113
- var pointerLabelComponent = (_280 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelComponent) !== null && _280 !== void 0 ? _280 : defaultPointerConfig.pointerLabelComponent;
1114
- var stripOverPointer = (_281 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripOverPointer) !== null && _281 !== void 0 ? _281 : defaultPointerConfig.stripOverPointer;
1115
- var shiftPointerLabelX = (_282 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelX) !== null && _282 !== void 0 ? _282 : defaultPointerConfig.shiftPointerLabelX;
1116
- var shiftPointerLabelY = (_283 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelY) !== null && _283 !== void 0 ? _283 : defaultPointerConfig.shiftPointerLabelY;
1117
- var pointerLabelWidth = (_284 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelWidth) !== null && _284 !== void 0 ? _284 : defaultPointerConfig.pointerLabelWidth;
1118
- var pointerLabelHeight = (_285 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelHeight) !== null && _285 !== void 0 ? _285 : defaultPointerConfig.pointerLabelHeight;
1119
- var autoAdjustPointerLabelPosition = (_286 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.autoAdjustPointerLabelPosition) !== null && _286 !== void 0 ? _286 : defaultPointerConfig.autoAdjustPointerLabelPosition;
1120
- var pointerVanishDelay = (_287 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerVanishDelay) !== null && _287 !== void 0 ? _287 : defaultPointerConfig.pointerVanishDelay;
1121
- var activatePointersOnLongPress = (_288 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersOnLongPress) !== null && _288 !== void 0 ? _288 : defaultPointerConfig.activatePointersOnLongPress;
1122
- var activatePointersInstantlyOnTouch = (_289 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersInstantlyOnTouch) !== null && _289 !== void 0 ? _289 : defaultPointerConfig.activatePointersInstantlyOnTouch;
1123
- var activatePointersDelay = (_290 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersDelay) !== null && _290 !== void 0 ? _290 : defaultPointerConfig.activatePointersDelay;
1124
- var initialPointerIndex = (_291 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerIndex) !== null && _291 !== void 0 ? _291 : defaultPointerConfig.initialPointerIndex;
1125
- var initialPointerAppearDelay = (_292 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerAppearDelay) !== null && _292 !== void 0 ? _292 : (isAnimated
1112
+ var pointerStripHeight = (_277 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripHeight) !== null && _277 !== void 0 ? _277 : defaultPointerConfig.pointerStripHeight;
1113
+ var pointerStripWidth = (_278 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripWidth) !== null && _278 !== void 0 ? _278 : defaultPointerConfig.pointerStripWidth;
1114
+ var pointerStripColor = (_279 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripColor) !== null && _279 !== void 0 ? _279 : defaultPointerConfig.pointerStripColor;
1115
+ var pointerStripUptoDataPoint = (_280 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripUptoDataPoint) !== null && _280 !== void 0 ? _280 : defaultPointerConfig.pointerStripUptoDataPoint;
1116
+ var pointerLabelComponent = (_281 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelComponent) !== null && _281 !== void 0 ? _281 : defaultPointerConfig.pointerLabelComponent;
1117
+ var stripOverPointer = (_282 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripOverPointer) !== null && _282 !== void 0 ? _282 : defaultPointerConfig.stripOverPointer;
1118
+ var shiftPointerLabelX = (_283 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelX) !== null && _283 !== void 0 ? _283 : defaultPointerConfig.shiftPointerLabelX;
1119
+ var shiftPointerLabelY = (_284 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelY) !== null && _284 !== void 0 ? _284 : defaultPointerConfig.shiftPointerLabelY;
1120
+ var pointerLabelWidth = (_285 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelWidth) !== null && _285 !== void 0 ? _285 : defaultPointerConfig.pointerLabelWidth;
1121
+ var pointerLabelHeight = (_286 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelHeight) !== null && _286 !== void 0 ? _286 : defaultPointerConfig.pointerLabelHeight;
1122
+ var autoAdjustPointerLabelPosition = (_287 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.autoAdjustPointerLabelPosition) !== null && _287 !== void 0 ? _287 : defaultPointerConfig.autoAdjustPointerLabelPosition;
1123
+ var pointerVanishDelay = (_288 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerVanishDelay) !== null && _288 !== void 0 ? _288 : defaultPointerConfig.pointerVanishDelay;
1124
+ var activatePointersOnLongPress = (_289 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersOnLongPress) !== null && _289 !== void 0 ? _289 : defaultPointerConfig.activatePointersOnLongPress;
1125
+ var activatePointersInstantlyOnTouch = (_290 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersInstantlyOnTouch) !== null && _290 !== void 0 ? _290 : defaultPointerConfig.activatePointersInstantlyOnTouch;
1126
+ var activatePointersDelay = (_291 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersDelay) !== null && _291 !== void 0 ? _291 : defaultPointerConfig.activatePointersDelay;
1127
+ var initialPointerIndex = (_292 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerIndex) !== null && _292 !== void 0 ? _292 : defaultPointerConfig.initialPointerIndex;
1128
+ var initialPointerAppearDelay = (_293 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerAppearDelay) !== null && _293 !== void 0 ? _293 : (isAnimated
1126
1129
  ? animationDuration
1127
1130
  : defaultPointerConfig.initialPointerAppearDelay);
1128
- var persistPointer = (_293 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.persistPointer) !== null && _293 !== void 0 ? _293 : defaultPointerConfig.persistPointer;
1129
- var resetPointerIndexOnRelease = (_294 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.resetPointerIndexOnRelease) !== null && _294 !== void 0 ? _294 : defaultPointerConfig.resetPointerIndexOnRelease;
1130
- var hidePointers = (_295 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointers) !== null && _295 !== void 0 ? _295 : defaultPointerConfig.hidePointers;
1131
- var hidePointer1 = (_296 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer1) !== null && _296 !== void 0 ? _296 : defaultPointerConfig.hidePointer1;
1132
- var hidePointer2 = (_297 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer2) !== null && _297 !== void 0 ? _297 : defaultPointerConfig.hidePointer2;
1133
- var hidePointer3 = (_298 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer3) !== null && _298 !== void 0 ? _298 : defaultPointerConfig.hidePointer3;
1134
- var hidePointer4 = (_299 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer4) !== null && _299 !== void 0 ? _299 : defaultPointerConfig.hidePointer4;
1135
- var hidePointer5 = (_300 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer5) !== null && _300 !== void 0 ? _300 : defaultPointerConfig.hidePointer5;
1136
- var hideSecondaryPointer = (_301 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hideSecondaryPointer) !== null && _301 !== void 0 ? _301 : defaultPointerConfig.hideSecondaryPointer;
1137
- var resetPointerOnDataChange = (_302 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.resetPointerOnDataChange) !== null && _302 !== void 0 ? _302 : defaultPointerConfig.resetPointerOnDataChange;
1138
- var hidePointerDataPointForMissingValues = (_303 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointerDataPointForMissingValues) !== null && _303 !== void 0 ? _303 : ((pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointerForMissingValues) ? true : false);
1131
+ var persistPointer = (_294 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.persistPointer) !== null && _294 !== void 0 ? _294 : defaultPointerConfig.persistPointer;
1132
+ var resetPointerIndexOnRelease = (_295 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.resetPointerIndexOnRelease) !== null && _295 !== void 0 ? _295 : defaultPointerConfig.resetPointerIndexOnRelease;
1133
+ var hidePointers = (_296 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointers) !== null && _296 !== void 0 ? _296 : defaultPointerConfig.hidePointers;
1134
+ var hidePointer1 = (_297 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer1) !== null && _297 !== void 0 ? _297 : defaultPointerConfig.hidePointer1;
1135
+ var hidePointer2 = (_298 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer2) !== null && _298 !== void 0 ? _298 : defaultPointerConfig.hidePointer2;
1136
+ var hidePointer3 = (_299 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer3) !== null && _299 !== void 0 ? _299 : defaultPointerConfig.hidePointer3;
1137
+ var hidePointer4 = (_300 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer4) !== null && _300 !== void 0 ? _300 : defaultPointerConfig.hidePointer4;
1138
+ var hidePointer5 = (_301 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer5) !== null && _301 !== void 0 ? _301 : defaultPointerConfig.hidePointer5;
1139
+ var hideSecondaryPointer = (_302 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hideSecondaryPointer) !== null && _302 !== void 0 ? _302 : defaultPointerConfig.hideSecondaryPointer;
1140
+ var resetPointerOnDataChange = (_303 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.resetPointerOnDataChange) !== null && _303 !== void 0 ? _303 : defaultPointerConfig.resetPointerOnDataChange;
1141
+ var hidePointerDataPointForMissingValues = (_304 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointerDataPointForMissingValues) !== null && _304 !== void 0 ? _304 : ((pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointerForMissingValues) ? true : false);
1139
1142
  var pointerEvents = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerEvents;
1140
- var disableScroll = (_304 = props.disableScroll) !== null && _304 !== void 0 ? _304 : (pointerConfig
1143
+ var disableScroll = (_305 = props.disableScroll) !== null && _305 !== void 0 ? _305 : (pointerConfig
1141
1144
  ? activatePointersOnLongPress
1142
1145
  ? !!responderActive
1143
1146
  : true
1144
1147
  : false);
1145
- var showScrollIndicator = (_305 = props.showScrollIndicator) !== null && _305 !== void 0 ? _305 : LineDefaults.showScrollIndicator;
1146
- var focusEnabled = (_306 = props.focusEnabled) !== null && _306 !== void 0 ? _306 : LineDefaults.focusEnabled;
1147
- var showDataPointOnFocus = (_307 = props.showDataPointOnFocus) !== null && _307 !== void 0 ? _307 : LineDefaults.showDataPointOnFocus;
1148
- var showStripOnFocus = (_308 = props.showStripOnFocus) !== null && _308 !== void 0 ? _308 : LineDefaults.showStripOnFocus;
1149
- var showTextOnFocus = (_309 = props.showTextOnFocus) !== null && _309 !== void 0 ? _309 : LineDefaults.showTextOnFocus;
1150
- var showDataPointLabelOnFocus = (_310 = props.showDataPointLabelOnFocus) !== null && _310 !== void 0 ? _310 : LineDefaults.showDataPointLabelOnFocus;
1148
+ var showScrollIndicator = (_306 = props.showScrollIndicator) !== null && _306 !== void 0 ? _306 : LineDefaults.showScrollIndicator;
1149
+ var focusEnabled = (_307 = props.focusEnabled) !== null && _307 !== void 0 ? _307 : LineDefaults.focusEnabled;
1150
+ var showDataPointOnFocus = (_308 = props.showDataPointOnFocus) !== null && _308 !== void 0 ? _308 : LineDefaults.showDataPointOnFocus;
1151
+ var showStripOnFocus = (_309 = props.showStripOnFocus) !== null && _309 !== void 0 ? _309 : LineDefaults.showStripOnFocus;
1152
+ var showTextOnFocus = (_310 = props.showTextOnFocus) !== null && _310 !== void 0 ? _310 : LineDefaults.showTextOnFocus;
1153
+ var showDataPointLabelOnFocus = (_311 = props.showDataPointLabelOnFocus) !== null && _311 !== void 0 ? _311 : LineDefaults.showDataPointLabelOnFocus;
1151
1154
  var stripHeight = props.stripHeight;
1152
- var stripWidth = (_311 = props.stripWidth) !== null && _311 !== void 0 ? _311 : LineDefaults.stripWidth;
1153
- var stripColor = (_312 = props.stripColor) !== null && _312 !== void 0 ? _312 : color1;
1154
- var stripOpacity = (_313 = props.stripOpacity) !== null && _313 !== void 0 ? _313 : (startOpacity1 + endOpacity1) / 2;
1155
+ var stripWidth = (_312 = props.stripWidth) !== null && _312 !== void 0 ? _312 : LineDefaults.stripWidth;
1156
+ var stripColor = (_313 = props.stripColor) !== null && _313 !== void 0 ? _313 : color1;
1157
+ var stripOpacity = (_314 = props.stripOpacity) !== null && _314 !== void 0 ? _314 : (startOpacity1 + endOpacity1) / 2;
1155
1158
  var stripStrokeDashArray = props.stripStrokeDashArray;
1156
- var unFocusOnPressOut = (_314 = props.unFocusOnPressOut) !== null && _314 !== void 0 ? _314 : LineDefaults.unFocusOnPressOut;
1157
- var delayBeforeUnFocus = (_315 = props.delayBeforeUnFocus) !== null && _315 !== void 0 ? _315 : LineDefaults.delayBeforeUnFocus;
1158
- var focusTogether = (_316 = props.focusTogether) !== null && _316 !== void 0 ? _316 : true;
1159
- var focusProximity = (_317 = props.focusProximity) !== null && _317 !== void 0 ? _317 : Infinity;
1160
- var lineGradient = (_318 = props.lineGradient) !== null && _318 !== void 0 ? _318 : LineDefaults.lineGradient;
1161
- var lineGradientDirection = (_319 = props.lineGradientDirection) !== null && _319 !== void 0 ? _319 : 'vertical';
1162
- var lineGradientStartColor = (_320 = props.lineGradientStartColor) !== null && _320 !== void 0 ? _320 : LineDefaults.lineGradientStartColor;
1163
- var lineGradientEndColor = (_321 = props.lineGradientEndColor) !== null && _321 !== void 0 ? _321 : LineDefaults.lineGradientEndColor;
1164
- var _390 = __read(useState(-1), 2), selectedLineNumber = _390[0], setSelectedLineNumber = _390[1];
1159
+ var unFocusOnPressOut = (_315 = props.unFocusOnPressOut) !== null && _315 !== void 0 ? _315 : LineDefaults.unFocusOnPressOut;
1160
+ var delayBeforeUnFocus = (_316 = props.delayBeforeUnFocus) !== null && _316 !== void 0 ? _316 : LineDefaults.delayBeforeUnFocus;
1161
+ var focusTogether = (_317 = props.focusTogether) !== null && _317 !== void 0 ? _317 : true;
1162
+ var focusProximity = (_318 = props.focusProximity) !== null && _318 !== void 0 ? _318 : Infinity;
1163
+ var lineGradient = (_319 = props.lineGradient) !== null && _319 !== void 0 ? _319 : LineDefaults.lineGradient;
1164
+ var lineGradientDirection = (_320 = props.lineGradientDirection) !== null && _320 !== void 0 ? _320 : 'vertical';
1165
+ var lineGradientStartColor = (_321 = props.lineGradientStartColor) !== null && _321 !== void 0 ? _321 : LineDefaults.lineGradientStartColor;
1166
+ var lineGradientEndColor = (_322 = props.lineGradientEndColor) !== null && _322 !== void 0 ? _322 : LineDefaults.lineGradientEndColor;
1167
+ var _391 = __read(useState(-1), 2), selectedLineNumber = _391[0], setSelectedLineNumber = _391[1];
1165
1168
  var getPointerY = function (value) {
1166
1169
  return value || value === 0
1167
1170
  ? containerHeight -
@@ -1310,8 +1313,8 @@ export var useLineChart = function (props) {
1310
1313
  setTimeout(function () { return setSelectedIndex(-1); }, delayBeforeUnFocus);
1311
1314
  }
1312
1315
  };
1313
- var dataPointsRadius = (_323 = (_322 = props.dataPointsRadius1) !== null && _322 !== void 0 ? _322 : props.dataPointsRadius) !== null && _323 !== void 0 ? _323 : LineDefaults.dataPointsRadius;
1314
- var dataPointsWidth = (_325 = (_324 = props.dataPointsWidth1) !== null && _324 !== void 0 ? _324 : props.dataPointsWidth) !== null && _325 !== void 0 ? _325 : LineDefaults.dataPointsWidth;
1316
+ var dataPointsRadius = (_324 = (_323 = props.dataPointsRadius1) !== null && _323 !== void 0 ? _323 : props.dataPointsRadius) !== null && _324 !== void 0 ? _324 : LineDefaults.dataPointsRadius;
1317
+ var dataPointsWidth = (_326 = (_325 = props.dataPointsWidth1) !== null && _325 !== void 0 ? _325 : props.dataPointsWidth) !== null && _326 !== void 0 ? _326 : LineDefaults.dataPointsWidth;
1315
1318
  var extraWidthDueToDataPoint = props.hideDataPoints
1316
1319
  ? 0
1317
1320
  : dataPointsRadius !== null && dataPointsRadius !== void 0 ? dataPointsRadius : dataPointsWidth;
@@ -1379,30 +1382,31 @@ export var useLineChart = function (props) {
1379
1382
  pointerY: pointerY,
1380
1383
  onEndReached: props.onEndReached,
1381
1384
  onStartReached: props.onStartReached,
1382
- endReachedOffset: (_326 = props.endReachedOffset) !== null && _326 !== void 0 ? _326 : LineDefaults.endReachedOffset,
1385
+ endReachedOffset: (_327 = props.endReachedOffset) !== null && _327 !== void 0 ? _327 : LineDefaults.endReachedOffset,
1383
1386
  onMomentumScrollEnd: props.onMomentumScrollEnd,
1384
1387
  extraWidthDueToDataPoint: extraWidthDueToDataPoint,
1385
1388
  customBackground: props.customBackground,
1386
1389
  onlyPositive: onlyPositive,
1387
1390
  highlightEnabled: LineDefaults.highlightEnabled,
1388
- lowlightOpacity: LineDefaults.lowlightOpacity
1391
+ lowlightOpacity: LineDefaults.lowlightOpacity,
1392
+ xAxisLabelsAtBottom: xAxisLabelsAtBottom
1389
1393
  };
1390
1394
  var pointerItemLocal = [];
1391
1395
  if (pointerConfig) {
1392
1396
  pointerItemLocal = [
1393
- __assign(__assign({}, pointerItem), { value: (_328 = (_327 = props.data) === null || _327 === void 0 ? void 0 : _327[pointerIndex]) === null || _328 === void 0 ? void 0 : _328.value })
1397
+ __assign(__assign({}, pointerItem), { value: (_329 = (_328 = props.data) === null || _328 === void 0 ? void 0 : _328[pointerIndex]) === null || _329 === void 0 ? void 0 : _329.value })
1394
1398
  ];
1395
1399
  if (pointerY2 !== 0) {
1396
- pointerItemLocal.push(__assign(__assign({}, pointerItem), { value: (_330 = (_329 = props.data2) === null || _329 === void 0 ? void 0 : _329[pointerIndex]) === null || _330 === void 0 ? void 0 : _330.value }));
1400
+ pointerItemLocal.push(__assign(__assign({}, pointerItem), { value: (_331 = (_330 = props.data2) === null || _330 === void 0 ? void 0 : _330[pointerIndex]) === null || _331 === void 0 ? void 0 : _331.value }));
1397
1401
  }
1398
1402
  if (pointerY3 !== 0) {
1399
- pointerItemLocal.push(__assign(__assign({}, pointerItem), { value: (_332 = (_331 = props.data3) === null || _331 === void 0 ? void 0 : _331[pointerIndex]) === null || _332 === void 0 ? void 0 : _332.value }));
1403
+ pointerItemLocal.push(__assign(__assign({}, pointerItem), { value: (_333 = (_332 = props.data3) === null || _332 === void 0 ? void 0 : _332[pointerIndex]) === null || _333 === void 0 ? void 0 : _333.value }));
1400
1404
  }
1401
1405
  if (pointerY4 !== 0) {
1402
- pointerItemLocal.push(__assign(__assign({}, pointerItem), { value: (_334 = (_333 = props.data4) === null || _333 === void 0 ? void 0 : _333[pointerIndex]) === null || _334 === void 0 ? void 0 : _334.value }));
1406
+ pointerItemLocal.push(__assign(__assign({}, pointerItem), { value: (_335 = (_334 = props.data4) === null || _334 === void 0 ? void 0 : _334[pointerIndex]) === null || _335 === void 0 ? void 0 : _335.value }));
1403
1407
  }
1404
1408
  if (pointerY5 !== 0) {
1405
- pointerItemLocal.push(__assign(__assign({}, pointerItem), { value: (_336 = (_335 = props.data5) === null || _335 === void 0 ? void 0 : _335[pointerIndex]) === null || _336 === void 0 ? void 0 : _336.value }));
1409
+ pointerItemLocal.push(__assign(__assign({}, pointerItem), { value: (_337 = (_336 = props.data5) === null || _336 === void 0 ? void 0 : _336[pointerIndex]) === null || _337 === void 0 ? void 0 : _337.value }));
1406
1410
  }
1407
1411
  }
1408
1412
  return {
@@ -1702,6 +1706,7 @@ export var useLineChart = function (props) {
1702
1706
  xAxisIndicesColor: xAxisIndicesColor,
1703
1707
  xAxisTextNumberOfLines: xAxisTextNumberOfLines,
1704
1708
  xAxisLabelsVerticalShift: xAxisLabelsVerticalShift,
1709
+ xAxisLabelsAtBottom: xAxisLabelsAtBottom,
1705
1710
  horizontalRulesStyle: horizontalRulesStyle,
1706
1711
  showFractionalValues: showFractionalValues,
1707
1712
  roundToDigits: roundToDigits,
@@ -268,6 +268,7 @@ export interface LineChartPropsType {
268
268
  xAxisLabelTextStyle?: any;
269
269
  xAxisLabelsHeight?: number;
270
270
  xAxisLabelsVerticalShift?: number;
271
+ xAxisLabelsAtBottom?: boolean;
271
272
  width?: number;
272
273
  yAxisLabelPrefix?: string;
273
274
  yAxisLabelSuffix?: string;
@@ -329,6 +330,8 @@ export interface LineChartPropsType {
329
330
  renderTooltip4?: Function;
330
331
  renderTooltip5?: Function;
331
332
  renderTooltipSecondary?: Function;
333
+ dataPointLabelComponent?: Function;
334
+ focusedDataPointLabelComponent?: Function;
332
335
  }
333
336
  export interface lineDataItem {
334
337
  value?: number;
@@ -19,10 +19,10 @@ import { getTextSizeForPieLabels } from '../utils';
19
19
  import { PieTooltipDefaults } from '../utils/constants';
20
20
  export var usePieChart = function (props) {
21
21
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
22
- var showTooltip = props.showTooltip, tooltipWidth = props.tooltipWidth, tooltipComponent = props.tooltipComponent, _w = props.tooltipDuration, tooltipDuration = _w === void 0 ? PieTooltipDefaults.tooltipDuration : _w, _x = props.tooltipVerticalShift, tooltipVerticalShift = _x === void 0 ? PieTooltipDefaults.tooltipVerticalShift : _x, _y = props.tooltipHorizontalShift, tooltipHorizontalShift = _y === void 0 ? PieTooltipDefaults.tooltipHorizontalShift : _y, _z = props.showValuesAsTooltipText, showValuesAsTooltipText = _z === void 0 ? PieTooltipDefaults.showValuesAsTooltipText : _z, _0 = props.tooltipTextNoOfLines, tooltipTextNoOfLines = _0 === void 0 ? PieTooltipDefaults.tooltipTextNoOfLines : _0, _1 = props.tooltipBackgroundColor, tooltipBackgroundColor = _1 === void 0 ? PieTooltipDefaults.tooltipBackgroundColor : _1, _2 = props.tooltipBorderRadius, tooltipBorderRadius = _2 === void 0 ? PieTooltipDefaults.tooltipBorderRadius : _2, textColor = props.textColor,
22
+ var showTooltip = props.showTooltip, tooltipWidth = props.tooltipWidth, tooltipComponent = props.tooltipComponent, _w = props.tooltipVerticalShift, tooltipVerticalShift = _w === void 0 ? PieTooltipDefaults.tooltipVerticalShift : _w, _x = props.tooltipHorizontalShift, tooltipHorizontalShift = _x === void 0 ? PieTooltipDefaults.tooltipHorizontalShift : _x, _y = props.showValuesAsTooltipText, showValuesAsTooltipText = _y === void 0 ? PieTooltipDefaults.showValuesAsTooltipText : _y, _z = props.tooltipTextNoOfLines, tooltipTextNoOfLines = _z === void 0 ? PieTooltipDefaults.tooltipTextNoOfLines : _z, _0 = props.tooltipBackgroundColor, tooltipBackgroundColor = _0 === void 0 ? PieTooltipDefaults.tooltipBackgroundColor : _0, _1 = props.tooltipBorderRadius, tooltipBorderRadius = _1 === void 0 ? PieTooltipDefaults.tooltipBorderRadius : _1, textColor = props.textColor,
23
23
  // textSize,
24
24
  font = props.font, fontWeight = props.fontWeight, fontStyle = props.fontStyle;
25
- var _3 = __read(useState(-1), 2), tooltipSelectedIndex = _3[0], setTooltipSelectedIndex = _3[1];
25
+ var _2 = __read(useState(-1), 2), tooltipSelectedIndex = _2[0], setTooltipSelectedIndex = _2[1];
26
26
  var radius = (_a = props.radius) !== null && _a !== void 0 ? _a : 120;
27
27
  var extraRadius = (_b = props.extraRadius) !== null && _b !== void 0 ? _b : (props.showExternalLabels
28
28
  ? 40
@@ -30,10 +30,10 @@ export var usePieChart = function (props) {
30
30
  ? radius / 10
31
31
  : 0);
32
32
  var pi = props.semiCircle ? Math.PI / 2 : Math.PI;
33
- var _4 = __read(useState((_d = props.focusedPieIndex) !== null && _d !== void 0 ? _d : -1), 2), selectedIndex = _4[0], setSelectedIndex = _4[1]; // at the start, nothing is selected
33
+ var _3 = __read(useState((_d = props.focusedPieIndex) !== null && _d !== void 0 ? _d : -1), 2), selectedIndex = _3[0], setSelectedIndex = _3[1]; // at the start, nothing is selected
34
34
  // because we're going to use a useEffect, we need startAngle and total to be state variables
35
- var _5 = __read(useState((_e = props.initialAngle) !== null && _e !== void 0 ? _e : (props.semiCircle ? -pi : 0)), 2), startAngle = _5[0], setStartAngle = _5[1];
36
- var _6 = __read(useState(0), 2), total = _6[0], setTotal = _6[1];
35
+ var _4 = __read(useState((_e = props.initialAngle) !== null && _e !== void 0 ? _e : (props.semiCircle ? -pi : 0)), 2), startAngle = _4[0], setStartAngle = _4[1];
36
+ var _5 = __read(useState(0), 2), total = _5[0], setTotal = _5[1];
37
37
  useEffect(function () {
38
38
  var _a;
39
39
  setSelectedIndex((_a = props.focusedPieIndex) !== null && _a !== void 0 ? _a : -1);
@@ -76,7 +76,7 @@ export var usePieChart = function (props) {
76
76
  }
77
77
  }
78
78
  }, [selectedIndex]);
79
- var pro = props.pro, data = props.data, donut = props.donut, isThreeD = props.isThreeD, semiCircle = props.semiCircle, _7 = props.inwardExtraLengthForFocused, inwardExtraLengthForFocused = _7 === void 0 ? 0 : _7, _8 = props.isAnimated, isAnimated = _8 === void 0 ? false : _8, edgesRadius = props.edgesRadius;
79
+ var pro = props.pro, data = props.data, donut = props.donut, isThreeD = props.isThreeD, semiCircle = props.semiCircle, _6 = props.inwardExtraLengthForFocused, inwardExtraLengthForFocused = _6 === void 0 ? 0 : _6, _7 = props.isAnimated, isAnimated = _7 === void 0 ? false : _7, edgesRadius = props.edgesRadius;
80
80
  var endAngle = (_f = props.endAngle) !== null && _f !== void 0 ? _f : startAngle + Math.PI * (semiCircle ? 1 : 2);
81
81
  var canvasWidth = radius * 2;
82
82
  var canvasHeight = isThreeD ? radius * 2.3 : radius * 2;
@@ -42,7 +42,6 @@ export var getPieChartMainProps = function (props) {
42
42
  var isThreeD = props.isThreeD, isBiggerPie = props.isBiggerPie, paddingHorizontal = props.paddingHorizontal, paddingVertical = props.paddingVertical, extraRadius = props.extraRadius, showExternalLabels = props.showExternalLabels, externalLabelComponent = props.externalLabelComponent, showTooltip = props.showTooltip, tooltipWidth = props.tooltipWidth, persistTooltip = props.persistTooltip, tooltipComponent = props.tooltipComponent, _13 = props.tooltipDuration, tooltipDuration = _13 === void 0 ? PieTooltipDefaults.tooltipDuration : _13, _14 = props.tooltipVerticalShift, tooltipVerticalShift = _14 === void 0 ? PieTooltipDefaults.tooltipVerticalShift : _14, _15 = props.tooltipHorizontalShift, tooltipHorizontalShift = _15 === void 0 ? PieTooltipDefaults.tooltipHorizontalShift : _15, _16 = props.showValuesAsTooltipText, showValuesAsTooltipText = _16 === void 0 ? PieTooltipDefaults.showValuesAsTooltipText : _16, _17 = props.tooltipTextNoOfLines, tooltipTextNoOfLines = _17 === void 0 ? PieTooltipDefaults.tooltipTextNoOfLines : _17, _18 = props.tooltipBackgroundColor, tooltipBackgroundColor = _18 === void 0 ? PieTooltipDefaults.tooltipBackgroundColor : _18, _19 = props.tooltipBorderRadius, tooltipBorderRadius = _19 === void 0 ? PieTooltipDefaults.tooltipBorderRadius : _19, font = props.font, fontWeight = props.fontWeight, fontStyle = props.fontStyle, edgesPressable = props.edgesPressable, tooltipSelectedIndex = props.tooltipSelectedIndex, setTooltipSelectedIndex = props.setTooltipSelectedIndex;
43
43
  var propData = props.data;
44
44
  var data = [];
45
- // const [tooltipSelectedIndex, setTooltipSelectedIndex] = useState(-1)
46
45
  var minisculeDataItem = props.data.map(function (item) { return item.value; }).reduce(function (v, a) { return v + a; }) / 160000;
47
46
  var itemHasInnerComponent = false;
48
47
  if (propData) {
@@ -228,7 +227,6 @@ export var getPieChartMainProps = function (props) {
228
227
  coordinates[index] = { sx: sx, sy: sy, ax: ax, ay: ay };
229
228
  });
230
229
  var timer = useRef(setTimeout(function () { })); // timer for tooltip
231
- console.log('showTooltip----->', showTooltip);
232
230
  var onPressed = function (item, index) {
233
231
  if (item.onPress) {
234
232
  item.onPress();
@@ -247,7 +245,6 @@ export var getPieChartMainProps = function (props) {
247
245
  }
248
246
  }
249
247
  if (showTooltip) {
250
- console.log('tooltipSelectedIndex b4----->', tooltipSelectedIndex);
251
248
  if (tooltipSelectedIndex === index) {
252
249
  setTooltipSelectedIndex(-1);
253
250
  }
@@ -260,7 +257,6 @@ export var getPieChartMainProps = function (props) {
260
257
  }, tooltipDuration);
261
258
  }
262
259
  }
263
- console.log('tooltipSelectedIndex after----->', tooltipSelectedIndex);
264
260
  }
265
261
  };
266
262
  return {
@@ -1,3 +1,4 @@
1
+ import { chartTypes } from '../../utils/constants';
1
2
  import { LineInBarChartPropsType, type BarAndLineChartsWrapperTypes, type horizSectionPropTypes } from '../../utils/types';
2
3
  import { type NativeScrollEvent } from 'react-native';
3
4
  export declare const useBarAndLineChartsWrapper: (props: BarAndLineChartsWrapperTypes) => {
@@ -53,7 +54,7 @@ export declare const useBarAndLineChartsWrapper: (props: BarAndLineChartsWrapper
53
54
  stackData: any[] | undefined;
54
55
  barWidth: number | undefined;
55
56
  maxValue: number;
56
- chartType: import("../../utils/constants").chartTypes;
57
+ chartType: chartTypes;
57
58
  containerHeightIncludingBelowXAxis: any;
58
59
  yAxisLabelWidth: number;
59
60
  totalWidth: number;
@@ -35,11 +35,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
35
35
  return to.concat(ar || Array.prototype.slice.call(from));
36
36
  };
37
37
  import { useEffect, useState } from 'react';
38
- import { AxesAndRulesDefaults, BarDefaults } from '../../utils/constants';
38
+ import { AxesAndRulesDefaults, BarDefaults, chartTypes } from '../../utils/constants';
39
39
  import { computeMaxAndMinItems } from '../../utils';
40
40
  export var useBarAndLineChartsWrapper = function (props) {
41
41
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19;
42
- var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, rtl = props.rtl, shiftX = props.shiftX, shiftY = props.shiftY, initialSpacing = props.initialSpacing, data = props.data, dataSet = props.dataSet, stackData = props.stackData, secondaryData = props.secondaryData, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, spacing = props.spacing, lineConfig = props.lineConfig, lineConfig2 = props.lineConfig2, maxValue = props.maxValue, lineData = props.lineData, lineData2 = props.lineData2, animatedWidth = props.animatedWidth, lineBehindBars = props.lineBehindBars, points = props.points, points2 = props.points2, arrowPoints = props.arrowPoints, width = props.width, horizSections = props.horizSections, endSpacing = props.endSpacing, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, showFractionalValues = props.showFractionalValues, axesAndRulesProps = props.axesAndRulesProps, yAxisLabelTexts = props.yAxisLabelTexts, yAxisOffset = props.yAxisOffset, rotateYAxisTexts = props.rotateYAxisTexts, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, scrollEventThrottle = props.scrollEventThrottle, endReachedOffset = props.endReachedOffset, isRTL = props.isRTL, selectedIndex = props.selectedIndex, onlyPositive = props.onlyPositive, highlightEnabled = props.highlightEnabled, lowlightOpacity = props.lowlightOpacity;
42
+ var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, rtl = props.rtl, shiftX = props.shiftX, shiftY = props.shiftY, initialSpacing = props.initialSpacing, data = props.data, dataSet = props.dataSet, stackData = props.stackData, secondaryData = props.secondaryData, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, spacing = props.spacing, lineConfig = props.lineConfig, lineConfig2 = props.lineConfig2, maxValue = props.maxValue, lineData = props.lineData, lineData2 = props.lineData2, animatedWidth = props.animatedWidth, lineBehindBars = props.lineBehindBars, points = props.points, points2 = props.points2, arrowPoints = props.arrowPoints, width = props.width, horizSections = props.horizSections, endSpacing = props.endSpacing, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, showFractionalValues = props.showFractionalValues, axesAndRulesProps = props.axesAndRulesProps, yAxisLabelTexts = props.yAxisLabelTexts, yAxisOffset = props.yAxisOffset, rotateYAxisTexts = props.rotateYAxisTexts, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, scrollEventThrottle = props.scrollEventThrottle, endReachedOffset = props.endReachedOffset, isRTL = props.isRTL, selectedIndex = props.selectedIndex, onlyPositive = props.onlyPositive, highlightEnabled = props.highlightEnabled, lowlightOpacity = props.lowlightOpacity, xAxisLabelsAtBottom = props.xAxisLabelsAtBottom;
43
+ var _20 = axesAndRulesProps.secondaryYAxisConfig, secondaryStepValue = _20.stepValue, secondaryNegativeStepValue = _20.negativeStepValue, secondaryNoOfSectionsBelowXAxis = _20.noOfSectionsBelowXAxis, showSecondaryFractionalValues = _20.showFractionalValues, secondaryRoundToDigits = _20.roundToDigits, secondaryStepHeight = _20.stepHeight, secondaryNegativeStepHeight = _20.negativeStepHeight;
44
+ var primaryYAxisHeightBelowOrigin = noOfSectionsBelowXAxis * negativeStepHeight;
45
+ var secondaryYAxisHeightBelowOrigin = secondaryNoOfSectionsBelowXAxis * secondaryNegativeStepHeight;
46
+ var biggerNegativeYAxisHeight = Math.max(primaryYAxisHeightBelowOrigin, secondaryYAxisHeightBelowOrigin);
43
47
  var yAxisAtTop = rtl ? !props.yAxisAtTop : props.yAxisAtTop;
44
48
  var hideOrigin = (_a = axesAndRulesProps.hideOrigin) !== null && _a !== void 0 ? _a : AxesAndRulesDefaults.hideOrigin;
45
49
  var yAxisSide = (_b = axesAndRulesProps.yAxisSide) !== null && _b !== void 0 ? _b : AxesAndRulesDefaults.yAxisSide;
@@ -52,7 +56,9 @@ export var useBarAndLineChartsWrapper = function (props) {
52
56
  var xAxisColor = (_g = axesAndRulesProps.xAxisColor) !== null && _g !== void 0 ? _g : AxesAndRulesDefaults.xAxisColor;
53
57
  var xAxisLength = axesAndRulesProps.xAxisLength;
54
58
  var xAxisType = (_h = axesAndRulesProps.xAxisType) !== null && _h !== void 0 ? _h : AxesAndRulesDefaults.xAxisType;
55
- var xAxisLabelsVerticalShift = (_j = axesAndRulesProps.xAxisLabelsVerticalShift) !== null && _j !== void 0 ? _j : AxesAndRulesDefaults.xAxisLabelsVerticalShift;
59
+ var xAxisLabelsVerticalShift = (_j = axesAndRulesProps.xAxisLabelsVerticalShift) !== null && _j !== void 0 ? _j : (chartType === chartTypes.LINE && xAxisLabelsAtBottom
60
+ ? biggerNegativeYAxisHeight
61
+ : AxesAndRulesDefaults.xAxisLabelsVerticalShift);
56
62
  var xAxisLabelsHeight = axesAndRulesProps.xAxisLabelsHeight;
57
63
  var xAxisTextNumberOfLines = axesAndRulesProps.xAxisTextNumberOfLines;
58
64
  var dashWidth = (_k = axesAndRulesProps.dashWidth) !== null && _k !== void 0 ? _k : AxesAndRulesDefaults.dashWidth;
@@ -104,11 +110,7 @@ export var useBarAndLineChartsWrapper = function (props) {
104
110
  var secondaryDataArrayWithMinValue = (secondaryData === null || secondaryData === void 0 ? void 0 : secondaryData.length)
105
111
  ? secondaryData
106
112
  : setWithMinValueInDataset === null || setWithMinValueInDataset === void 0 ? void 0 : setWithMinValueInDataset.data;
107
- var _20 = computeMaxAndMinItems(secondaryDataArrayWithMinValue, true, (_13 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.roundToDigits) !== null && _13 !== void 0 ? _13 : roundToDigits, (_14 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.showFractionalValues) !== null && _14 !== void 0 ? _14 : showFractionalValues), secondaryMaxItem = _20.maxItem, secondaryMinItem = _20.minItem;
108
- var _21 = axesAndRulesProps.secondaryYAxisConfig, secondaryStepValue = _21.stepValue, secondaryNegativeStepValue = _21.negativeStepValue, secondaryNoOfSectionsBelowXAxis = _21.noOfSectionsBelowXAxis, showSecondaryFractionalValues = _21.showFractionalValues, secondaryRoundToDigits = _21.roundToDigits, secondaryStepHeight = _21.stepHeight, secondaryNegativeStepHeight = _21.negativeStepHeight;
109
- var primaryYAxisHeightBelowOrigin = noOfSectionsBelowXAxis * negativeStepHeight;
110
- var secondaryYAxisHeightBelowOrigin = secondaryNoOfSectionsBelowXAxis * secondaryNegativeStepHeight;
111
- var biggerNegativeYAxisHeight = Math.max(primaryYAxisHeightBelowOrigin, secondaryYAxisHeightBelowOrigin);
113
+ var _21 = computeMaxAndMinItems(secondaryDataArrayWithMinValue, true, (_13 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.roundToDigits) !== null && _13 !== void 0 ? _13 : roundToDigits, (_14 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.showFractionalValues) !== null && _14 !== void 0 ? _14 : showFractionalValues), secondaryMaxItem = _21.maxItem, secondaryMinItem = _21.minItem;
112
114
  var containerHeightIncludingBelowXAxis = extendedContainerHeight + biggerNegativeYAxisHeight;
113
115
  var horizSectionProps = {
114
116
  chartType: chartType,
@@ -340,6 +340,7 @@ export interface BarAndLineChartsWrapperTypes {
340
340
  onlyPositive?: boolean;
341
341
  highlightEnabled: boolean;
342
342
  lowlightOpacity: number;
343
+ xAxisLabelsAtBottom: boolean;
343
344
  }
344
345
  export interface HorizontalStripConfig {
345
346
  thickness?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.59",
3
+ "version": "0.1.60",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "./dist/index.js",
6
6
  "files": [