cats-charts 0.0.80 → 0.0.81

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.
@@ -1489,11 +1489,13 @@ class LinesChart {
1489
1489
  xAxisName: '',
1490
1490
  yAxisName: '',
1491
1491
  secondaryYAxisName: '',
1492
+ axisNameStyleSignature: '',
1492
1493
  };
1493
1494
  ngDoCheck() {
1494
1495
  if (!this.chartInstance || !this.config)
1495
1496
  return;
1496
1497
  const updateOption = {};
1498
+ const axisNameStyleSignature = this.resolveAxisNameStyleSignature();
1497
1499
  if (this.previousConfig.xAxisName !== this.config.xAxisName) {
1498
1500
  this.previousConfig.xAxisName = this.config.xAxisName;
1499
1501
  updateOption.xAxis = {
@@ -1526,6 +1528,10 @@ class LinesChart {
1526
1528
  if (Object.keys(updateOption).length) {
1527
1529
  this.chartInstance.setOption(updateOption);
1528
1530
  }
1531
+ if (this.previousConfig.axisNameStyleSignature !== axisNameStyleSignature) {
1532
+ this.previousConfig.axisNameStyleSignature = axisNameStyleSignature;
1533
+ this.refreshAxisNameSpace();
1534
+ }
1529
1535
  }
1530
1536
  /* ------------------ OPTION BUILDER ------------------ */
1531
1537
  buildOption() {
@@ -1897,6 +1903,16 @@ class LinesChart {
1897
1903
  }
1898
1904
  return Math.max(chartHeight - 72, 80);
1899
1905
  }
1906
+ resolveAxisNameStyleSignature() {
1907
+ return JSON.stringify({
1908
+ xAxisName: this.config?.xAxisName,
1909
+ yAxisName: this.config?.yAxisName,
1910
+ secondaryYAxisName: this.config?.secondaryYAxisName,
1911
+ xAxisNameTextStyle: this.config?.xAxis?.nameTextStyle,
1912
+ yAxisNameTextStyle: this.config?.yAxis?.nameTextStyle,
1913
+ secondaryYAxisNameTextStyle: this.config?.secondaryYAxisConfig?.nameTextStyle,
1914
+ });
1915
+ }
1900
1916
  enableDataZoom(active) {
1901
1917
  if (!this.chartInstance)
1902
1918
  return;
@@ -2131,11 +2147,13 @@ class BarChart {
2131
2147
  xAxisName: '',
2132
2148
  yAxisName: '',
2133
2149
  secondaryYAxisName: '',
2150
+ axisNameStyleSignature: '',
2134
2151
  };
2135
2152
  ngDoCheck() {
2136
2153
  if (!this.chartInstance || !this.config)
2137
2154
  return;
2138
2155
  const updateOption = {};
2156
+ const axisNameStyleSignature = this.resolveAxisNameStyleSignature();
2139
2157
  if (this.previousConfig.xAxisName !== this.config.xAxisName) {
2140
2158
  this.previousConfig.xAxisName = this.config.xAxisName;
2141
2159
  updateOption.xAxis = {
@@ -2168,6 +2186,10 @@ class BarChart {
2168
2186
  if (Object.keys(updateOption).length) {
2169
2187
  this.chartInstance.setOption(updateOption);
2170
2188
  }
2189
+ if (this.previousConfig.axisNameStyleSignature !== axisNameStyleSignature) {
2190
+ this.previousConfig.axisNameStyleSignature = axisNameStyleSignature;
2191
+ this.refreshAxisNameSpace();
2192
+ }
2171
2193
  }
2172
2194
  moveLeft() {
2173
2195
  this.moveZoom(-10);
@@ -2598,6 +2620,16 @@ class BarChart {
2598
2620
  }
2599
2621
  return Math.max(chartHeight - 72, 80);
2600
2622
  }
2623
+ resolveAxisNameStyleSignature() {
2624
+ return JSON.stringify({
2625
+ xAxisName: this.config?.xAxisName,
2626
+ yAxisName: this.config?.yAxisName,
2627
+ secondaryYAxisName: this.config?.secondaryYAxisName,
2628
+ xAxisNameTextStyle: this.config?.xAxis?.nameTextStyle,
2629
+ yAxisNameTextStyle: this.config?.yAxis?.nameTextStyle,
2630
+ secondaryYAxisNameTextStyle: this.config?.secondaryYAxisConfig?.nameTextStyle,
2631
+ });
2632
+ }
2601
2633
  get hasSideLegendWidth() {
2602
2634
  return this.isSideLegend && !!this.config.customLegend?.maxWidth;
2603
2635
  }
@@ -4546,6 +4578,16 @@ class ScatterChartComp {
4546
4578
  }
4547
4579
  this.buildOption();
4548
4580
  }
4581
+ previousAxisNameStyleSignature = '';
4582
+ ngDoCheck() {
4583
+ if (!this.chartInstance || !this.config)
4584
+ return;
4585
+ const axisNameStyleSignature = this.resolveAxisNameStyleSignature();
4586
+ if (this.previousAxisNameStyleSignature === axisNameStyleSignature)
4587
+ return;
4588
+ this.previousAxisNameStyleSignature = axisNameStyleSignature;
4589
+ this.refreshAxisNameSpace();
4590
+ }
4549
4591
  buildOption() {
4550
4592
  const selected = this.readLegendSelected();
4551
4593
  const selectedMode = this.config?.customLegend?.selectionMode === 'exclusive' ? 'single' : true;
@@ -4739,6 +4781,14 @@ class ScatterChartComp {
4739
4781
  }
4740
4782
  return Math.max(chartHeight - 72, 80);
4741
4783
  }
4784
+ resolveAxisNameStyleSignature() {
4785
+ return JSON.stringify({
4786
+ xAxisName: this.config?.xAxisName,
4787
+ yAxisName: this.config?.yAxisName,
4788
+ xAxisNameTextStyle: this.config?.xAxis?.nameTextStyle,
4789
+ yAxisNameTextStyle: this.config?.yAxis?.nameTextStyle,
4790
+ });
4791
+ }
4742
4792
  onLegendEvent(event) {
4743
4793
  this.legendEvent.emit(event);
4744
4794
  this.chartEvent.emit({