@spteck/fluentui-react-charts 1.0.11 → 1.0.12

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.
@@ -1712,7 +1712,9 @@ function ComboChart(_ref) {
1712
1712
  _ref$showDataLabels = _ref.showDataLabels,
1713
1713
  showDataLabels = _ref$showDataLabels === void 0 ? false : _ref$showDataLabels,
1714
1714
  _ref$theme = _ref.theme,
1715
- theme = _ref$theme === void 0 ? webLightTheme : _ref$theme;
1715
+ theme = _ref$theme === void 0 ? webLightTheme : _ref$theme,
1716
+ _ref$axesMode = _ref.axesMode,
1717
+ axesMode = _ref$axesMode === void 0 ? 'legacy' : _ref$axesMode;
1716
1718
  var _useState = useState(function () {
1717
1719
  return data.map(function (s) {
1718
1720
  return s.label;
@@ -1767,7 +1769,8 @@ function ComboChart(_ref) {
1767
1769
  return {
1768
1770
  type: series.type,
1769
1771
  label: series.label,
1770
- yAxisID: (_series$yAxisID = series.yAxisID) != null ? _series$yAxisID : 'y',
1772
+ // default yAxis assignment: legacy uses single 'y', dual uses 'y-bar'/'y-line'
1773
+ yAxisID: (_series$yAxisID = series.yAxisID) != null ? _series$yAxisID : axesMode === 'dual' ? series.type === 'bar' ? 'y-bar' : 'y-line' : 'y',
1771
1774
  data: allCategories.map(function (cat) {
1772
1775
  var found = series.data.find(function (d) {
1773
1776
  return getPrimary(d) === cat;
@@ -1798,7 +1801,7 @@ function ComboChart(_ref) {
1798
1801
  labelColor = _useMemo.labelColor,
1799
1802
  gridColor = _useMemo.gridColor;
1800
1803
  var options = useMemo(function () {
1801
- return _extends({
1804
+ var base = _extends({
1802
1805
  responsive: true,
1803
1806
  maintainAspectRatio: false
1804
1807
  }, getInstantInteractionAnimations(), {
@@ -1829,9 +1832,61 @@ function ComboChart(_ref) {
1829
1832
  display: false
1830
1833
  },
1831
1834
  tooltip: createFluentTooltip(theme)
1832
- },
1835
+ }
1836
+ });
1837
+ if (axesMode === 'dual') {
1838
+ return _extends({}, base, {
1839
+ scales: {
1840
+ x: {
1841
+ stacked: true,
1842
+ ticks: {
1843
+ color: labelColor,
1844
+ font: {
1845
+ family: fontFamily,
1846
+ size: fontSize
1847
+ }
1848
+ },
1849
+ grid: {
1850
+ color: gridColor
1851
+ }
1852
+ },
1853
+ 'y-bar': {
1854
+ type: 'linear',
1855
+ position: 'left',
1856
+ stacked: true,
1857
+ ticks: {
1858
+ color: labelColor,
1859
+ font: {
1860
+ family: fontFamily,
1861
+ size: fontSize
1862
+ }
1863
+ },
1864
+ grid: {
1865
+ color: gridColor
1866
+ }
1867
+ },
1868
+ 'y-line': {
1869
+ type: 'linear',
1870
+ position: 'right',
1871
+ stacked: false,
1872
+ ticks: {
1873
+ color: labelColor,
1874
+ font: {
1875
+ family: fontFamily,
1876
+ size: fontSize
1877
+ }
1878
+ },
1879
+ grid: {
1880
+ color: gridColor
1881
+ }
1882
+ }
1883
+ }
1884
+ });
1885
+ }
1886
+ return _extends({}, base, {
1833
1887
  scales: {
1834
1888
  x: {
1889
+ stacked: false,
1835
1890
  ticks: {
1836
1891
  color: labelColor,
1837
1892
  font: {
@@ -1844,7 +1899,9 @@ function ComboChart(_ref) {
1844
1899
  }
1845
1900
  },
1846
1901
  y: {
1902
+ type: 'linear',
1847
1903
  position: 'left',
1904
+ stacked: false,
1848
1905
  ticks: {
1849
1906
  color: labelColor,
1850
1907
  font: {
@@ -1854,12 +1911,11 @@ function ComboChart(_ref) {
1854
1911
  },
1855
1912
  grid: {
1856
1913
  color: gridColor
1857
- },
1858
- stacked: false
1914
+ }
1859
1915
  }
1860
1916
  }
1861
1917
  });
1862
- }, [title, showDataLabels, theme, fontFamily, fontSize, labelColor, gridColor, createFluentTooltip]);
1918
+ }, [title, showDataLabels, theme, fontFamily, fontSize, labelColor, gridColor, createFluentTooltip, getInstantInteractionAnimations, axesMode]);
1863
1919
  return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
1864
1920
  className: styles.chartWithLegend
1865
1921
  }, React__default.createElement("div", {