@tetacom/svg-charts 1.7.21 → 1.7.22
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.
|
@@ -750,29 +750,33 @@ class ScaleService {
|
|
|
750
750
|
.set(ScaleType.pow, d3.scalePow)
|
|
751
751
|
.set(ScaleType.sqrt, d3.scaleSqrt)
|
|
752
752
|
.set(ScaleType.band, d3.scaleBand);
|
|
753
|
-
this.scales = combineLatest([this.chartService.size, this.chartService.config, this.zoomService.zoomed]).pipe(map((
|
|
754
|
-
|
|
753
|
+
this.scales = combineLatest([this.chartService.size, this.chartService.config, this.zoomService.zoomed]).pipe(map(([size, config, zoom]) => {
|
|
754
|
+
config = { ...config };
|
|
755
|
+
config.xAxis = config.xAxis.map((_) => ({ ..._ }));
|
|
756
|
+
config.yAxis = config.yAxis.map((_) => ({ ..._ }));
|
|
755
757
|
const xAxisMap = new Map();
|
|
756
758
|
const yAxisMap = new Map();
|
|
757
|
-
config.yAxis.
|
|
758
|
-
|
|
759
|
+
config.yAxis.forEach((axis, index) => {
|
|
760
|
+
const newAxis = Axis.createAxis(AxisOrientation.y, config, index);
|
|
761
|
+
if (newAxis.options.visible &&
|
|
759
762
|
config.series.some((serie) => serie.yAxisIndex === index && serie.enabled && serie.data?.length > 0)) {
|
|
760
|
-
|
|
763
|
+
newAxis.options.visible = true;
|
|
761
764
|
}
|
|
762
765
|
else {
|
|
763
|
-
|
|
766
|
+
newAxis.options.visible = false;
|
|
764
767
|
}
|
|
765
|
-
yAxisMap.set(index,
|
|
768
|
+
yAxisMap.set(index, newAxis);
|
|
766
769
|
});
|
|
767
|
-
config.xAxis.
|
|
768
|
-
|
|
770
|
+
config.xAxis.forEach((axis, index) => {
|
|
771
|
+
const newAxis = Axis.createAxis(AxisOrientation.x, config, index);
|
|
772
|
+
if (newAxis.options.visible &&
|
|
769
773
|
config.series.some((serie) => serie.xAxisIndex === index && serie.enabled && serie.data?.length > 0)) {
|
|
770
|
-
|
|
774
|
+
newAxis.options.visible = true;
|
|
771
775
|
}
|
|
772
776
|
else {
|
|
773
|
-
|
|
777
|
+
newAxis.options.visible = false;
|
|
774
778
|
}
|
|
775
|
-
xAxisMap.set(index,
|
|
779
|
+
xAxisMap.set(index, newAxis);
|
|
776
780
|
});
|
|
777
781
|
// Generate x scales
|
|
778
782
|
const left = Array.from(yAxisMap.values())
|