From 637af2ca9a83472a350c57ed5472699ed7cc4d0c Mon Sep 17 00:00:00 2001 From: Ludek Novy <13610612+ludeknovy@users.noreply.github.com> Date: Fri, 11 Mar 2022 09:05:06 +0100 Subject: [PATCH] custom chart yaxis visibility fix (#247) --- src/app/graphs/item-detail.ts | 5 +++++ .../item-detail/analyze-charts/analyze-charts.component.ts | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/app/graphs/item-detail.ts b/src/app/graphs/item-detail.ts index 42244f28..95ac847f 100644 --- a/src/app/graphs/item-detail.ts +++ b/src/app/graphs/item-detail.ts @@ -151,6 +151,7 @@ export const customChartSettings = () => { crosshair: true, }, yAxis: [{ + visible: false, gridLineColor: "#f2f2f2", lineWidth: 0, title: { @@ -158,6 +159,7 @@ export const customChartSettings = () => { }, }, { + visible: false, gridLineColor: "#f2f2f2", lineWidth: 0, title: { @@ -165,6 +167,7 @@ export const customChartSettings = () => { }, }, { + visible: false, gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, @@ -173,6 +176,7 @@ export const customChartSettings = () => { }, }, { + visible: false, gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, @@ -181,6 +185,7 @@ export const customChartSettings = () => { }, }, { + visible: false, gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, diff --git a/src/app/item-detail/analyze-charts/analyze-charts.component.ts b/src/app/item-detail/analyze-charts/analyze-charts.component.ts index ee4c8c1d..a68bcd0f 100644 --- a/src/app/item-detail/analyze-charts/analyze-charts.component.ts +++ b/src/app/item-detail/analyze-charts/analyze-charts.component.ts @@ -114,6 +114,12 @@ export class AnalyzeChartsComponent implements OnInit { chartSeries.push(line); } }); + // hide all axis + this.customChartsOptions.yAxis.forEach(axis => axis.visible = false) + // display only actual axis + chartSeries.forEach(serie => { + this.customChartsOptions.yAxis[serie.yAxis].visible = true + }) this.customChartsOptions.series = JSON.parse(JSON.stringify(chartSeries)); this.updateLabelChartFlag = true; }