diff --git a/src/app/components/fixedvar-results/results.component.ts b/src/app/components/fixedvar-results/results.component.ts index 9c05df43576eade445c25450c0a448327ee95013..748816761ac736744c73251c6b23bb3ab1c2afe6 100644 --- a/src/app/components/fixedvar-results/results.component.ts +++ b/src/app/components/fixedvar-results/results.component.ts @@ -43,7 +43,7 @@ export class ResultsComponent { */ public static get distinctColors(): string[] { return [ - "#4363d8", // blue + "#003A80", // Irstea "marine", replacing the suggested "#4363d8" (blue) "#f58231", // orange "#3cb44b", // green "#e6194B", // red diff --git a/src/app/components/results-graph/graph-type.component.ts b/src/app/components/results-graph/graph-type.component.ts index 2895abe75e196c1cd09a8401ed6beb2155d59ecb..5d70501b0a3a42349c3f58463b745bffcec26716 100644 --- a/src/app/components/results-graph/graph-type.component.ts +++ b/src/app/components/results-graph/graph-type.component.ts @@ -11,7 +11,7 @@ import { GraphType } from "../../results/graph-type"; ] }) export class GraphTypeSelectComponent implements IObservable { - private _entries: GraphType[] = [GraphType.Histogram, GraphType.Scatter]; + private _entries: GraphType[] = [ GraphType.Histogram, GraphType.Dots, GraphType.Scatter ]; private _entriesLabels: string[] = []; private _selected: GraphType; @@ -25,6 +25,7 @@ export class GraphTypeSelectComponent implements IObservable { this._observable = new Observable(); this._entriesLabels = [ this.intlService.localizeText("INFO_PARAMFIELD_GRAPH_TYPE_HISTOGRAM"), + this.intlService.localizeText("INFO_PARAMFIELD_GRAPH_TYPE_DOTS"), "XY" ]; } diff --git a/src/app/components/results-graph/results-graph.component.ts b/src/app/components/results-graph/results-graph.component.ts index 589fdac1f8c205d26d96a93fc08a36fe02894011..420583a3304c54ce1fcd8d37667118409d0d8bbb 100644 --- a/src/app/components/results-graph/results-graph.component.ts +++ b/src/app/components/results-graph/results-graph.component.ts @@ -176,6 +176,11 @@ export class ResultsGraphComponent extends ResultsComponent implements AfterCont this.generateBarGraph(); break; + case GraphType.Dots: + this.graph_type = "line"; + this.generateLineGraph(); + break; + default: this.graph_type = "scatter"; this.generateScatterGraph(); @@ -265,7 +270,7 @@ export class ResultsGraphComponent extends ResultsComponent implements AfterCont const lines: string[] = []; const nbLines = that._results.getVariatingParametersSymbols().length; for (const v of that._results.getVariatingParametersSymbols()) { - const series = that._results.getValuesSeries[0](v); + const series = that._results.getValuesSeries(v); const line = v + " = " + fv(series[tooltipItem.index]); if (v === this.chartX) { if (nbLines > 1) { @@ -285,11 +290,25 @@ export class ResultsGraphComponent extends ResultsComponent implements AfterCont labels: labs, datasets: [{ label: "", - data: dat + data: dat, + backgroundColor: "rgba(0, 58, 128, 0.5)", // ResultsComponent.distinctColors[0] with transparency + showLine: "true" }] }; } + /** + * génère les données d'un graphe de type "line" + */ + private generateLineGraph() { + // same as bar graph (histogram) + this.generateBarGraph(); + // override style + this.graph_data.datasets[0].backgroundColor = "rgba(0,0,0,0)"; // fill color under the line : transparent + this.graph_data.datasets[0].borderColor = ResultsComponent.distinctColors[0]; + this.graph_data.datasets[0].showLine = false; + } + /** * génère les données d'un graphe de type "scatter" */ diff --git a/src/app/results/graph-type.ts b/src/app/results/graph-type.ts index cf83fc76efe1803a4839d4572ef00489bc34f516..67d5dcf572411072d7fee379f216bf48dab56d11 100644 --- a/src/app/results/graph-type.ts +++ b/src/app/results/graph-type.ts @@ -8,9 +8,9 @@ export enum GraphType { Histogram, /** - * points indépendants reliés par une courbe + * points indépendants */ - HistoLine, + Dots, /** * graphe XY classique diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index 897cd44e4ae3d2cc2664ad70e2403d544a2f4c25..12c2c290e105ab838b48681080e8fda64f62efbe 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -336,6 +336,7 @@ "INFO_PARAMFIELD_GRAPH_SELECT_X_AXIS": "Variable for X axis", "INFO_PARAMFIELD_GRAPH_SELECT_Y_AXIS": "Variable for Y axis", "INFO_PARAMFIELD_GRAPH_TYPE_HISTOGRAM": "Histogram", + "INFO_PARAMFIELD_GRAPH_TYPE_DOTS": "Plot", "INFO_PARAMFIELD_GRAPH_TYPE": "Graph type", "INFO_PARAMFIELD_IN_CALCULATION_INITIAL_VALUE": "initial value", "INFO_PARAMFIELD_IN_CALCULATION": "In calculation", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 504fc9bbf6eb8a6b9d391d308d80cf149ef14088..0afc52799245d4e3ac776fc9d37958f13e42116e 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -335,6 +335,7 @@ "INFO_PARAMFIELD_GRAPH_SELECT_X_AXIS": "Variable en abscisse", "INFO_PARAMFIELD_GRAPH_SELECT_Y_AXIS": "Variable en ordonnée", "INFO_PARAMFIELD_GRAPH_TYPE_HISTOGRAM": "Histogramme", + "INFO_PARAMFIELD_GRAPH_TYPE_DOTS": "Points", "INFO_PARAMFIELD_GRAPH_TYPE": "Type de graphe", "INFO_PARAMFIELD_IN_CALCULATION_INITIAL_VALUE": "valeur initiale", "INFO_PARAMFIELD_IN_CALCULATION": "En calcul",