diff --git a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts index b1e971ec1f85573ff85b4c68744ec6caf4f20a63..a5cc9fcecbac2ac9ab0baa1346c43253a4c73d09 100644 --- a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts +++ b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts @@ -108,20 +108,20 @@ export class DialogEditParamValuesComponent implements OnInit { duration: 0 }, scales: { - x: [{ + x: { type: "linear", position: "bottom", ticks: { precision: ResultsComponentDirective.CHARTS_AXIS_PRECISION } - }], - y: [{ + }, + y: { type: "linear", position: "left", ticks: { precision: ResultsComponentDirective.CHARTS_AXIS_PRECISION } - }] + } }, elements: { line: { diff --git a/src/app/components/jet-trajectory-chart/jet-trajectory-chart.component.ts b/src/app/components/jet-trajectory-chart/jet-trajectory-chart.component.ts index c5df1edb317b76415a3d6212469f0296f620ef6b..c11af834a6e31f27c40f7094b149401295dd08c3 100644 --- a/src/app/components/jet-trajectory-chart/jet-trajectory-chart.component.ts +++ b/src/app/components/jet-trajectory-chart/jet-trajectory-chart.component.ts @@ -67,7 +67,7 @@ export class JetTrajectoryChartComponent extends ResultsComponentDirective imple super(); // do not move following block out of constructor or scale labels won't be rendered this.graph_options["scales"] = { - x: [{ + x: { type: "linear", position: "bottom", ticks: { @@ -77,8 +77,8 @@ export class JetTrajectoryChartComponent extends ResultsComponentDirective imple display: true, text: this.intlService.localizeText("INFO_LIB_ABSCISSE") } - }], - y: [{ + }, + y: { type: "linear", position: "left", ticks: { @@ -88,7 +88,7 @@ export class JetTrajectoryChartComponent extends ResultsComponentDirective imple display: true, text: this.intlService.localizeText("INFO_LIB_ALTITUDE") } - }] + } }; // enable zoom and pan (using "chartjs-plugin-zoom" package) const that = this; @@ -134,7 +134,7 @@ export class JetTrajectoryChartComponent extends ResultsComponentDirective imple @Input() public set results(r: Result) { - this.forceRebuild(); // used for forcing redefinition of x[0].min/max in generateScatterChart() + this.forceRebuild(); // used for forcing redefinition of x.min/max in generateScatterChart() this._results = r; } @@ -195,8 +195,8 @@ export class JetTrajectoryChartComponent extends ResultsComponentDirective imple } // adjust chart width - this.graph_options.scales.x[0].min = 0; - this.graph_options.scales.x[0].max = greatestAbscissa; + this.graph_options.scales.x.min = 0; + this.graph_options.scales.x.max = greatestAbscissa; // build Y data series for (const ys of ySeries) { diff --git a/src/app/components/pab-profile-chart/pab-profile-chart.component.ts b/src/app/components/pab-profile-chart/pab-profile-chart.component.ts index ca8aeebcda4bf5bf73eae5cb07b189b794e5147d..b79afc76bd0e568b22ccc7ed592f04d778b434b2 100644 --- a/src/app/components/pab-profile-chart/pab-profile-chart.component.ts +++ b/src/app/components/pab-profile-chart/pab-profile-chart.component.ts @@ -72,7 +72,7 @@ export class PabProfileChartComponent extends ResultsComponentDirective implemen super(); // do not move following block out of constructor or scale labels won't be rendered this.graph_options["scales"] = { - x: [{ + x: { type: "linear", position: "bottom", ticks: { @@ -82,8 +82,8 @@ export class PabProfileChartComponent extends ResultsComponentDirective implemen display: true, text: this.intlService.localizeText("INFO_LIB_DISTANCE_AMONT") } - }], - y: [{ + }, + y: { type: "linear", position: "left", ticks: { @@ -93,7 +93,7 @@ export class PabProfileChartComponent extends ResultsComponentDirective implemen display: true, text: this.intlService.localizeText("INFO_LIB_COTE") } - }] + } }; // enable zoom and pan (using "chartjs-plugin-zoom" package) const that = this; diff --git a/src/app/components/remous-results/remous-results.component.ts b/src/app/components/remous-results/remous-results.component.ts index ed8143ab37545f399cf2884dd75b4162b6c25f81..77f8bd8d6c2e16ff34617682672d00b602d4aebc 100644 --- a/src/app/components/remous-results/remous-results.component.ts +++ b/src/app/components/remous-results/remous-results.component.ts @@ -398,7 +398,7 @@ export class RemousResultsComponent extends ResultsComponentDirective implements duration: 0 }, scales: { - x: [{ + x: { gridLines: { display: true, color: "rgba(255,99,132,0.2)", @@ -414,14 +414,14 @@ export class RemousResultsComponent extends ResultsComponentDirective implements display: true, text: this.uitextAbscisse } - }], - y: [{ + }, + y: { // stacked: true, gridLines: { display: true, color: "rgba(255,99,132,0.2)" } - }] + } }, plugins: { legend: { @@ -448,7 +448,7 @@ export class RemousResultsComponent extends ResultsComponentDirective implements duration: 0 }, scales: { - x: [{ + x: { title: { display: true, text: this.uitextAbscisse @@ -459,7 +459,7 @@ export class RemousResultsComponent extends ResultsComponentDirective implements return fv(Number(value)); } }, - }] + } }, plugins: { legend: { diff --git a/src/app/components/results-chart/results-chart.component.ts b/src/app/components/results-chart/results-chart.component.ts index 743986e40e3b4a80b022c46144cb21d06b7eeca9..9821f98e94e320f621fd0afd9a505c1af3abee55 100644 --- a/src/app/components/results-chart/results-chart.component.ts +++ b/src/app/components/results-chart/results-chart.component.ts @@ -252,7 +252,7 @@ export class ResultsChartComponent extends ResultsComponentDirective implements } this.graph_options["scales"] = { - x: [{ + x: { gridLines: { offsetGridLines: true }, @@ -266,13 +266,13 @@ export class ResultsChartComponent extends ResultsComponentDirective implements display: true, text: this.axisLabelWithoutSymbol(this.chartX) } - }], - y: [{ + }, + y: { title: { display: true, text: this.axisLabelWithoutSymbol(this.chartY) } - }] + } }; const that = this; @@ -349,7 +349,7 @@ export class ResultsChartComponent extends ResultsComponentDirective implements } this.graph_options["scales"] = { - x: [{ + x: { type: "linear", position: "bottom", ticks: { @@ -359,8 +359,8 @@ export class ResultsChartComponent extends ResultsComponentDirective implements display: true, text: this.axisLabelWithoutSymbol(this.chartX) } - }], - y: [{ + }, + y: { type: "linear", position: "left", ticks: { @@ -370,7 +370,7 @@ export class ResultsChartComponent extends ResultsComponentDirective implements display: true, text: this.axisLabelWithoutSymbol(this.chartY) } - }] + } }; if (isMultiple) {