Skip to content
Snippets Groups Projects
Commit 7dbca63a authored by mathias.chouet's avatar mathias.chouet
Browse files

#234 : ajout légende des axes

parent 9e244e56
No related branches found
No related tags found
1 merge request!49Resolve "Ajout du module de calcul d'une passe à bassins"
......@@ -53,31 +53,59 @@ export class PabProfileGraphComponent extends ResultsComponent {
private intlService: I18nService
) {
super();
const nDigits = this.appSetupService.displayDigits;
// do not move following block out of constructor or scale labels won't be rendered
this.graph_options["scales"] = {
xAxes: [{
type: "linear",
position: "bottom",
ticks: {
precision: nDigits
},
scaleLabel: {
display: true,
labelString: this.intlService.localizeText("INFO_LIB_DISTANCE_AMONT")
}
}],
yAxes: [{
type: "linear",
position: "left",
ticks: {
precision: nDigits
},
scaleLabel: {
display: true,
labelString: this.intlService.localizeText("INFO_LIB_COTE")
}
}]
};
}
public set results(r: PabResults) {
this._results = r;
// pre-extract variable parameters values
this.varValues = [];
const nDigits = this.appSetupService.displayDigits;
// find longest list
this.size = 0;
for (let i = 0; i < this._results.variatedParameters.length; i++) {
const vs = this._results.variatedParameters[i].valuesIterator.count();
if (vs > this.size) {
this.size = vs;
if (this._results) {
this.varValues = [];
const nDigits = this.appSetupService.displayDigits;
// find longest list
this.size = 0;
for (let i = 0; i < this._results.variatedParameters.length; i++) {
const vs = this._results.variatedParameters[i].valuesIterator.count();
if (vs > this.size) {
this.size = vs;
}
}
}
// get extended values lists for each variable parameter
for (const v of this._results.variatedParameters) {
const vv = [];
const iter = v.getExtendedValuesIterator(this.size);
while (iter.hasNext) {
const nv = iter.next();
vv.push(nv.value.toFixed(nDigits));
// get extended values lists for each variable parameter
for (const v of this._results.variatedParameters) {
const vv = [];
const iter = v.getExtendedValuesIterator(this.size);
while (iter.hasNext) {
const nv = iter.next();
vv.push(nv.value.toFixed(nDigits));
}
this.varValues.push(vv);
}
this.varValues.push(vv);
}
}
......@@ -90,39 +118,12 @@ export class PabProfileGraphComponent extends ResultsComponent {
* génère les données d'un graphe de type "scatter"
*/
private generateScatterGraph() {
const nDigits = this.appSetupService.displayDigits;
const ySeries = this.getYSeries();
this.graph_data = {
datasets: []
};
this.graph_options["scales"] = {
xAxes: [{
type: "linear",
position: "bottom",
ticks: {
precision: nDigits
},
scaleLabel: {
display: true,
labelString: "la super abscisse"
// labelString: this.axisLabelWithoutSymbol(this.chartX)
}
}],
yAxes: [{
type: "linear",
position: "left",
ticks: {
precision: nDigits
},
scaleLabel: {
display: true,
labelString: "la super ordonnée"
/// labelString: this.axisLabelWithoutSymbol(this.chartY)
}
}]
};
// build Y data series
for (const ys of ySeries) {
// push series config
......
......@@ -126,11 +126,13 @@
"INFO_LIB_BT": "Half opening of the triangle",
"INFO_LIB_CD": "Discharge coefficient",
"INFO_LIB_CLOISON": "Cross wall #",
"INFO_LIB_COTE": "Elevation (m)",
"INFO_LIB_COTE_VANNE_LEVANTE": "Lift gate elevation",
"INFO_LIB_CV": "Cv: Velocity coefficient",
"INFO_LIB_CVQT": "CV.QT: Corrected discharge",
"INFO_LIB_DH": "Fall",
"INFO_LIB_DHR": "DHR : Residual fall",
"INFO_LIB_DISTANCE_AMONT": "Distance from upstream (m)",
"INFO_LIB_EC": "EC: Kinetic energy",
"INFO_LIB_ENUM_MACRORUGOFLOWTYPE": "Flow type",
"INFO_LIB_FLU": "Subcritical water line",
......
......@@ -126,11 +126,13 @@
"INFO_LIB_BT": "Demi-ouverture du triangle",
"INFO_LIB_CD": "Coefficient de débit",
"INFO_LIB_CLOISON": "Cloison n°",
"INFO_LIB_COTE": "Cote (m)",
"INFO_LIB_COTE_VANNE_LEVANTE": "Cote vanne levante",
"INFO_LIB_CV": "Cv: Coefficient de vitesse d'approche",
"INFO_LIB_CVQT": "CV.QT: Débit corrigé",
"INFO_LIB_DH": "Chute",
"INFO_LIB_DHR": "DHR: Chute résiduelle",
"INFO_LIB_DISTANCE_AMONT": "Distance depuis l'amont (m)",
"INFO_LIB_EC": "EC: Énergie cinétique",
"INFO_LIB_ENUM_MACRORUGOFLOWTYPE": "Type d'écoulement",
"INFO_LIB_FLU": "Ligne d'eau fluviale",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment