Fix covered points in visualizations (#1463)

This commit is contained in:
Jesús Ángel 2019-06-05 15:04:10 +02:00 committed by GitHub
parent f3e96ddff6
commit dfffd839b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -111,6 +111,19 @@ export class VisualizeDataLoader {
);
}
const valueAxes = (visParams || {}).valueAxes || false;
const hasSeries = ((this.visData || {}).series || []).length;
if (valueAxes && hasSeries) {
if (visParams.type !== 'area') {
visParams.valueAxes.forEach((axis: { scale: { max: number; }; }, idx: string | number) => {
const maxValue = Math.max.apply(Math, this.visData.series[idx].values.map((x: { y: any; }) => { return x.y; }));
const lengthMaxValue = maxValue.toString().length;
const addTo = parseInt('1' + '0'.repeat(lengthMaxValue - 1));
axis.scale.max = maxValue + (addTo / 2);
});
}
}
return {
as: 'visualization',
value: {

View File

@ -990,4 +990,4 @@ wz-xml-file-editor {
discover-app-w .container-fluid {
background: #fff;
}
}