@fluentui/react-charts 9.1.2 → 9.1.3

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +16 -2
  2. package/dist/index.d.ts +23 -1
  3. package/lib/components/AreaChart/AreaChart.js +18 -8
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/CommonComponents/CartesianChart.js +17 -13
  6. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  7. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  8. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +50 -35
  9. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  10. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +44 -18
  11. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  12. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  13. package/lib/components/HeatMapChart/HeatMapChart.js +1 -1
  14. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  15. package/lib/components/LineChart/LineChart.js +40 -36
  16. package/lib/components/LineChart/LineChart.js.map +1 -1
  17. package/lib/components/ScatterChart/ScatterChart.js +1 -1
  18. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  19. package/lib/components/VerticalBarChart/VerticalBarChart.js +4 -4
  20. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  21. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +61 -23
  22. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  23. package/lib/types/DataPoint.js.map +1 -1
  24. package/lib/utilities/utilities.js +25 -34
  25. package/lib/utilities/utilities.js.map +1 -1
  26. package/lib-commonjs/components/AreaChart/AreaChart.js +16 -7
  27. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  28. package/lib-commonjs/components/CommonComponents/CartesianChart.js +17 -13
  29. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  30. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  31. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +50 -35
  32. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  33. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +43 -17
  34. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  35. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  36. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +1 -1
  37. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  38. package/lib-commonjs/components/LineChart/LineChart.js +40 -36
  39. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  40. package/lib-commonjs/components/ScatterChart/ScatterChart.js +1 -1
  41. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  42. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +4 -4
  43. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  44. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +60 -22
  45. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  46. package/lib-commonjs/types/DataPoint.js.map +1 -1
  47. package/lib-commonjs/utilities/utilities.js +25 -34
  48. package/lib-commonjs/utilities/utilities.js.map +1 -1
  49. package/package.json +4 -4
@@ -94,7 +94,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
94
94
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
95
  let _xAxisScale = '';
96
96
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
97
- let _yAxisScale = '';
97
+ let _yScalePrimary = '';
98
98
  let _circleId = useId('circle');
99
99
  let _lineId = useId('lineID');
100
100
  let _borderId = useId('borderID');
@@ -116,6 +116,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
116
116
  const _isRTL = useRtl();
117
117
  let xAxisCalloutAccessibilityData = {};
118
118
  const cartesianChartRef = React.useRef(null);
119
+ let _yScaleSecondary;
119
120
  props.eventAnnotationProps && props.eventAnnotationProps.labelHeight && (eventLabelHeight = props.eventAnnotationProps.labelHeight);
120
121
  const [hoverXValue, setHoverXValue] = React.useState('');
121
122
  const [activeLegend, setActiveLegend] = React.useState('');
@@ -197,9 +198,10 @@ const PATH_MULTIPLY_SIZE = 2.5;
197
198
  function _getMargins(_margins) {
198
199
  margins = _margins;
199
200
  }
200
- function _initializeLineChartData(xScale, yScale, containerHeight, containerWidth, xElement) {
201
+ function _initializeLineChartData(xScale, yScalePrimary, containerHeight, containerWidth, xElement, yAxisElement, yScaleSecondary) {
201
202
  _xAxisScale = xScale;
202
- _yAxisScale = yScale;
203
+ _yScalePrimary = yScalePrimary;
204
+ _yScaleSecondary = yScaleSecondary;
203
205
  _renderedColorFillBars = props.colorFillBars ? _createColorFillBars(containerHeight) : [];
204
206
  lines = _createLines(xElement, containerHeight);
205
207
  }
@@ -357,6 +359,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
357
359
  const legendVal = _points[i].legend;
358
360
  const lineColor = _points[i].color;
359
361
  const verticaLineHeight = containerHeight - margins.bottom + 6;
362
+ const yScale = _points[i].useSecondaryYScale && _yScaleSecondary ? _yScaleSecondary : _yScalePrimary;
360
363
  if (_points[i].data.length === 1) {
361
364
  // eslint-disable-next-line @typescript-eslint/no-shadow
362
365
  const { x: x1, y: y1, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[0];
@@ -367,12 +370,12 @@ const PATH_MULTIPLY_SIZE = 2.5;
367
370
  key: circleId,
368
371
  r: activePoint === circleId ? 5.5 : 3.5,
369
372
  cx: _xAxisScale(x1),
370
- cy: _yAxisScale(y1),
373
+ cy: yScale(y1),
371
374
  fill: activePoint === circleId ? tokens.colorNeutralBackground1 : lineColor,
372
375
  opacity: isLegendSelected ? 1 : 0.1,
373
376
  tabIndex: isLegendSelected ? 0 : undefined,
374
- onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
375
- onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
377
+ onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
378
+ onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
376
379
  onMouseOut: _handleMouseOut,
377
380
  strokeWidth: activePoint === circleId ? DEFAULT_LINE_STROKE_SIZE : 0,
378
381
  stroke: activePoint === circleId ? lineColor : '',
@@ -396,7 +399,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
396
399
  var _points_i_lineOptions1;
397
400
  const line = d3Line()// eslint-disable-next-line @typescript-eslint/no-explicit-any
398
401
  .x((d)=>_xAxisScale(d[0]))// eslint-disable-next-line @typescript-eslint/no-explicit-any
399
- .y((d)=>_yAxisScale(d[1])).curve(getCurveFactory(lineCurve));
402
+ .y((d)=>yScale(d[1])).curve(getCurveFactory(lineCurve));
400
403
  const lineId = `${_lineId}_${i}`;
401
404
  const borderId = `${_borderId}_${i}`;
402
405
  const strokeWidth = ((_points_i_lineOptions1 = _points[i].lineOptions) === null || _points_i_lineOptions1 === void 0 ? void 0 : _points_i_lineOptions1.strokeWidth) || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
@@ -435,8 +438,8 @@ const PATH_MULTIPLY_SIZE = 2.5;
435
438
  stroke: lineColor,
436
439
  strokeWidth: strokeWidth,
437
440
  strokeLinecap: (_points_i_lineOptions_strokeLinecap1 = (_points_i_lineOptions3 = _points[i].lineOptions) === null || _points_i_lineOptions3 === void 0 ? void 0 : _points_i_lineOptions3.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap1 !== void 0 ? _points_i_lineOptions_strokeLinecap1 : 'round',
438
- onMouseMove: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event),
439
- onMouseOver: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event),
441
+ onMouseMove: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale),
442
+ onMouseOver: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale),
440
443
  onMouseOut: _handleMouseOut,
441
444
  ..._getClickHandler(_points[i].onLineClick),
442
445
  opacity: 1,
@@ -467,8 +470,8 @@ const PATH_MULTIPLY_SIZE = 2.5;
467
470
  strokeWidth: DEFAULT_LINE_STROKE_SIZE,
468
471
  stroke: lineColor,
469
472
  visibility: 'hidden',
470
- onMouseMove: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event),
471
- onMouseOver: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event),
473
+ onMouseMove: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale),
474
+ onMouseOver: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale),
472
475
  onMouseOut: _handleMouseOut
473
476
  }));
474
477
  } else if (!props.optimizeLargeData) {
@@ -482,7 +485,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
482
485
  const circleId = `${_circleId}_${i}_${j}`;
483
486
  const { x: x1, y: y1, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[j - 1];
484
487
  const { x: x2, y: y2 } = _points[i].data[j];
485
- let path = _getPath(_xAxisScale(x1), _yAxisScale(y1), circleId, j, false, _points[i].index);
488
+ let path = _getPath(_xAxisScale(x1), yScale(y1), circleId, j, false, _points[i].index);
486
489
  const strokeWidth = ((_points_i_lineOptions7 = _points[i].lineOptions) === null || _points_i_lineOptions7 === void 0 ? void 0 : _points_i_lineOptions7.strokeWidth) || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
487
490
  const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
488
491
  const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;
@@ -491,8 +494,8 @@ const PATH_MULTIPLY_SIZE = 2.5;
491
494
  key: circleId,
492
495
  d: path,
493
496
  "data-is-focusable": isLegendSelected,
494
- onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
495
- onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
497
+ onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
498
+ onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
496
499
  onMouseOut: _handleMouseOut,
497
500
  onFocus: ()=>_handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
498
501
  onBlur: _handleMouseOut,
@@ -510,7 +513,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
510
513
  const lastCircleId = `${circleId}${j}L`;
511
514
  const hiddenHoverCircleId = `${circleId}${j}D`;
512
515
  const lastPointHidden = _points[i].hideNonActiveDots && activePoint !== lastCircleId;
513
- path = _getPath(_xAxisScale(x2), _yAxisScale(y2), lastCircleId, j, true, _points[i].index);
516
+ path = _getPath(_xAxisScale(x2), yScale(y2), lastCircleId, j, true, _points[i].index);
514
517
  const { xAxisCalloutData: lastCirlceXCallout, xAxisCalloutAccessibilityData: lastCirlceXCalloutAccessibilityData } = _points[i].data[j];
515
518
  pointsForLine.push(/*#__PURE__*/ React.createElement(React.Fragment, {
516
519
  key: `${lastCircleId}_container`
@@ -519,8 +522,8 @@ const PATH_MULTIPLY_SIZE = 2.5;
519
522
  key: lastCircleId,
520
523
  d: path,
521
524
  "data-is-focusable": isLegendSelected,
522
- onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event),
523
- onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event),
525
+ onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
526
+ onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
524
527
  onMouseOut: _handleMouseOut,
525
528
  onFocus: ()=>_handleFocus(lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData),
526
529
  onBlur: _handleMouseOut,
@@ -537,11 +540,11 @@ const PATH_MULTIPLY_SIZE = 2.5;
537
540
  key: hiddenHoverCircleId,
538
541
  r: 8,
539
542
  cx: _xAxisScale(x2),
540
- cy: _yAxisScale(y2),
543
+ cy: yScale(y2),
541
544
  opacity: 0,
542
545
  width: 0,
543
- onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event),
544
- onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event),
546
+ onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
547
+ onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
545
548
  onMouseOut: _handleMouseOut,
546
549
  strokeWidth: 0,
547
550
  focusable: false,
@@ -560,9 +563,9 @@ const PATH_MULTIPLY_SIZE = 2.5;
560
563
  id: borderId,
561
564
  key: borderId,
562
565
  x1: _xAxisScale(x1),
563
- y1: _yAxisScale(y1),
566
+ y1: yScale(y1),
564
567
  x2: _xAxisScale(x2),
565
- y2: _yAxisScale(y2),
568
+ y2: yScale(y2),
566
569
  strokeLinecap: (_points_i_lineOptions_strokeLinecap3 = (_points_i_lineOptions12 = _points[i].lineOptions) === null || _points_i_lineOptions12 === void 0 ? void 0 : _points_i_lineOptions12.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap3 !== void 0 ? _points_i_lineOptions_strokeLinecap3 : 'round',
567
570
  strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth,
568
571
  ...((_points_i_lineOptions13 = _points[i].lineOptions) === null || _points_i_lineOptions13 === void 0 ? void 0 : _points_i_lineOptions13.lineBorderColor) && {
@@ -577,15 +580,15 @@ const PATH_MULTIPLY_SIZE = 2.5;
577
580
  id: lineId,
578
581
  key: lineId,
579
582
  x1: _xAxisScale(x1),
580
- y1: _yAxisScale(y1),
583
+ y1: yScale(y1),
581
584
  x2: _xAxisScale(x2),
582
- y2: _yAxisScale(y2),
585
+ y2: yScale(y2),
583
586
  strokeWidth: strokeWidth,
584
587
  ref: (e)=>{
585
588
  _refCallback(e, lineId);
586
589
  },
587
- onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
588
- onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
590
+ onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
591
+ onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
589
592
  onMouseOut: _handleMouseOut,
590
593
  stroke: lineColor,
591
594
  strokeLinecap: (_points_i_lineOptions_strokeLinecap4 = (_points_i_lineOptions9 = _points[i].lineOptions) === null || _points_i_lineOptions9 === void 0 ? void 0 : _points_i_lineOptions9.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap4 !== void 0 ? _points_i_lineOptions_strokeLinecap4 : 'round',
@@ -603,9 +606,9 @@ const PATH_MULTIPLY_SIZE = 2.5;
603
606
  id: lineId,
604
607
  key: lineId,
605
608
  x1: _xAxisScale(x1),
606
- y1: _yAxisScale(y1),
609
+ y1: yScale(y1),
607
610
  x2: _xAxisScale(x2),
608
- y2: _yAxisScale(y2),
611
+ y2: yScale(y2),
609
612
  strokeWidth: strokeWidth,
610
613
  stroke: lineColor,
611
614
  strokeLinecap: (_points_i_lineOptions_strokeLinecap5 = (_points_i_lineOptions15 = _points[i].lineOptions) === null || _points_i_lineOptions15 === void 0 ? void 0 : _points_i_lineOptions15.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap5 !== void 0 ? _points_i_lineOptions_strokeLinecap5 : 'round',
@@ -671,9 +674,9 @@ const PATH_MULTIPLY_SIZE = 2.5;
671
674
  fill: colorFillBar.applyPattern ? `url(#${_colorFillBarPatternId}_${i})` : color,
672
675
  fillOpacity: opacity,
673
676
  x: _isRTL ? _xAxisScale(endX) : _xAxisScale(startX),
674
- y: _yAxisScale(yMinMaxValues.endValue) - FILL_Y_PADDING,
677
+ y: _yScalePrimary(yMinMaxValues.endValue) - FILL_Y_PADDING,
675
678
  width: Math.abs(_xAxisScale(endX) - _xAxisScale(startX)),
676
- height: _yAxisScale(props.yMinValue || 0) - _yAxisScale(yMinMaxValues.endValue) + FILL_Y_PADDING,
679
+ height: _yScalePrimary(props.yMinValue || 0) - _yScalePrimary(yMinMaxValues.endValue) + FILL_Y_PADDING,
677
680
  key: `${colorFillBarId}${j}`
678
681
  }));
679
682
  }
@@ -716,7 +719,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
716
719
  refElement: element
717
720
  });
718
721
  }
719
- const _onMouseOverLargeDataset = (linenumber, lineHeight, mouseEvent)=>{
722
+ const _onMouseOverLargeDataset = (linenumber, lineHeight, mouseEvent, yScale)=>{
720
723
  mouseEvent.persist();
721
724
  const { data } = props;
722
725
  const { lineChartData } = data;
@@ -770,8 +773,8 @@ const PATH_MULTIPLY_SIZE = 2.5;
770
773
  // if no points need to be called out then don't show vertical line and callout card
771
774
  if (found && pointToHighlightUpdated) {
772
775
  _uniqueCallOutID = `#${_staticHighlightCircle}_${linenumber}`;
773
- d3Select(`#${_staticHighlightCircle}_${linenumber}`).attr('cx', `${_xAxisScale(pointToHighlight.x)}`).attr('cy', `${_yAxisScale(pointToHighlight.y)}`).attr('visibility', 'visibility');
774
- d3Select(`#${_verticalLine}`).attr('transform', ()=>`translate(${_xAxisScale(pointToHighlight.x)}, ${_yAxisScale(pointToHighlight.y)})`).attr('visibility', 'visibility').attr('y2', `${lineHeight - 5 - _yAxisScale(pointToHighlight.y)}`);
776
+ d3Select(`#${_staticHighlightCircle}_${linenumber}`).attr('cx', `${_xAxisScale(pointToHighlight.x)}`).attr('cy', `${yScale(pointToHighlight.y)}`).attr('visibility', 'visibility');
777
+ d3Select(`#${_verticalLine}`).attr('transform', ()=>`translate(${_xAxisScale(pointToHighlight.x)}, ${yScale(pointToHighlight.y)})`).attr('visibility', 'visibility').attr('y2', `${lineHeight - 5 - yScale(pointToHighlight.y)}`);
775
778
  setNearestCircleToHighlight(pointToHighlight);
776
779
  updatePosition(mouseEvent.clientX, mouseEvent.clientY);
777
780
  setStackCalloutProps(found);
@@ -808,14 +811,14 @@ const PATH_MULTIPLY_SIZE = 2.5;
808
811
  setActivePoint(circleId);
809
812
  }
810
813
  }
811
- function _handleHover(x, y, lineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, mouseEvent) {
814
+ function _handleHover(x, y, lineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, mouseEvent, yScale) {
812
815
  mouseEvent === null || mouseEvent === void 0 ? void 0 : mouseEvent.persist();
813
816
  const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;
814
817
  const xVal = x instanceof Date ? x.getTime() : x;
815
818
  const found = find(_calloutPoints, (element)=>element.x === xVal);
816
819
  // if no points need to be called out then don't show vertical line and callout card
817
820
  if (found) {
818
- d3Select(`#${_verticalLine}`).attr('transform', ()=>`translate(${_xAxisScale(x)}, ${_yAxisScale(y)})`).attr('visibility', 'visibility').attr('y2', `${lineHeight - 5 - _yAxisScale(y)}`);
821
+ d3Select(`#${_verticalLine}`).attr('transform', ()=>`translate(${_xAxisScale(x)}, ${yScale(y)})`).attr('visibility', 'visibility').attr('y2', `${lineHeight - 5 - yScale(y)}`);
819
822
  if (_uniqueCallOutID !== circleId) {
820
823
  _uniqueCallOutID = circleId;
821
824
  updatePosition(mouseEvent.clientX, mouseEvent.clientY);
@@ -1003,7 +1006,8 @@ const PATH_MULTIPLY_SIZE = 2.5;
1003
1006
  /* eslint-disable react/jsx-no-bind */ // eslint-disable-next-line react/no-children-prop
1004
1007
  children: (props)=>{
1005
1008
  _xAxisScale = props.xScale;
1006
- _yAxisScale = props.yScale;
1009
+ _yScalePrimary = props.yScalePrimary;
1010
+ _yScaleSecondary = props.yScaleSecondary;
1007
1011
  return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("g", null, /*#__PURE__*/ React.createElement("line", {
1008
1012
  x1: 0,
1009
1013
  y1: 0,