@spteck/fluentui-react-charts 1.0.12 → 1.0.14

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.
@@ -779,8 +779,10 @@ var lightenColor = function lightenColor(hex, amount) {
779
779
  };
780
780
  return "#" + toHex(r) + toHex(g) + toHex(b);
781
781
  };
782
- var getFluentPalette = function getFluentPalette(_theme) {
783
- return ['#4e79a7', '#f28e2c', '#e15759', '#76b7b2', '#59a14f', '#edc949', '#af7aa1', '#ff9da7', '#9c755f', '#bab0ab', '#8cd17d', '#b6992d', '#d37295', '#fabfd2', '#79706e'];
782
+ var getFluentPalette = function getFluentPalette(theme) {
783
+ // Check if theme is dark by looking at global color tokens
784
+ var isDark = theme.colorNeutralBackground1.startsWith('#1') || theme.colorNeutralBackground1 === '#000000';
785
+ return isDark ? ['#2899f5', '#ff8c00', '#32cd32', '#f06b71', '#c390f2', '#00b7c3', '#ffb900', '#b4a0ff', '#60cdff', '#92c353'] : ['#0078d4', '#d83b01', '#097223', '#a4262c', '#3f0c7aff', '#024339ff', '#791d2dff', '#005a9e', '#8764b8', '#376102ff'];
784
786
  };
785
787
  /**
786
788
  * Returns animation configuration for instant interactions.
@@ -807,7 +809,7 @@ function createFluentTooltip(theme) {
807
809
  var fontSize = parseInt(theme.fontSizeBase200.replace('px', '')) || 14;
808
810
  var tooltipBg = theme.colorNeutralBackground1;
809
811
  var tooltipTitleColor = theme.colorNeutralForeground1;
810
- var tooltipBodyColor = theme.colorNeutralForeground2;
812
+ //const tooltipBodyColor = theme.colorNeutralForeground1;
811
813
  var borderColor = theme.colorNeutralStroke2;
812
814
  var callbacks = {
813
815
  title: function title(context) {
@@ -892,7 +894,6 @@ function createFluentTooltip(theme) {
892
894
  cornerRadius: 4,
893
895
  padding: 10,
894
896
  titleColor: tooltipTitleColor,
895
- bodyColor: tooltipBodyColor,
896
897
  titleFont: {
897
898
  family: fontFamily,
898
899
  size: fontSize
@@ -1769,7 +1770,7 @@ function ComboChart(_ref) {
1769
1770
  return {
1770
1771
  type: series.type,
1771
1772
  label: series.label,
1772
- // default yAxis assignment: legacy uses single 'y', dual uses 'y-bar'/'y-line'
1773
+ // Respect explicit series yAxisID if provided (retro-compatibility).
1773
1774
  yAxisID: (_series$yAxisID = series.yAxisID) != null ? _series$yAxisID : axesMode === 'dual' ? series.type === 'bar' ? 'y-bar' : 'y-line' : 'y',
1774
1775
  data: allCategories.map(function (cat) {
1775
1776
  var found = series.data.find(function (d) {
@@ -1777,6 +1778,8 @@ function ComboChart(_ref) {
1777
1778
  });
1778
1779
  return found ? getSecondary(found) : 0;
1779
1780
  }),
1781
+ // In dual mode, group bars into a common stack so they stack on x axis
1782
+ stack: axesMode === 'dual' && series.type === 'bar' ? 'barStack' : undefined,
1780
1783
  backgroundColor: seriesColors[series.label],
1781
1784
  borderColor: seriesColors[series.label],
1782
1785
  fill: series.type === 'bar',
@@ -1854,6 +1857,7 @@ function ComboChart(_ref) {
1854
1857
  type: 'linear',
1855
1858
  position: 'left',
1856
1859
  stacked: true,
1860
+ offset: true,
1857
1861
  ticks: {
1858
1862
  color: labelColor,
1859
1863
  font: {
@@ -1886,7 +1890,6 @@ function ComboChart(_ref) {
1886
1890
  return _extends({}, base, {
1887
1891
  scales: {
1888
1892
  x: {
1889
- stacked: false,
1890
1893
  ticks: {
1891
1894
  color: labelColor,
1892
1895
  font: {
@@ -1899,9 +1902,7 @@ function ComboChart(_ref) {
1899
1902
  }
1900
1903
  },
1901
1904
  y: {
1902
- type: 'linear',
1903
1905
  position: 'left',
1904
- stacked: false,
1905
1906
  ticks: {
1906
1907
  color: labelColor,
1907
1908
  font: {
@@ -1911,7 +1912,8 @@ function ComboChart(_ref) {
1911
1912
  },
1912
1913
  grid: {
1913
1914
  color: gridColor
1914
- }
1915
+ },
1916
+ stacked: false
1915
1917
  }
1916
1918
  }
1917
1919
  });
@@ -3426,6 +3428,7 @@ var chartProps = function chartProps(chart) {
3426
3428
  };
3427
3429
  };
3428
3430
  var getChartComponent = function getChartComponent(chart, theme) {
3431
+ var _chart$axesMode;
3429
3432
  var type = chart.type;
3430
3433
  var fuiTheme = theme != null ? theme : webLightTheme;
3431
3434
  switch (type) {
@@ -3459,6 +3462,8 @@ var getChartComponent = function getChartComponent(chart, theme) {
3459
3462
  case 'multiple-axes':
3460
3463
  return React__default.createElement(ComboChart, Object.assign({}, chartProps(chart), {
3461
3464
  theme: fuiTheme,
3465
+ // allow the originating chart descriptor to opt into dual axes
3466
+ axesMode: (_chart$axesMode = chart.axesMode) != null ? _chart$axesMode : 'dual',
3462
3467
  data: chart.data.map(function (series) {
3463
3468
  var _series$type;
3464
3469
  return {