mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-07 10:18:57 +00:00
Fix covered points in visualizations (#1463)
This commit is contained in:
parent
f3e96ddff6
commit
dfffd839b9
@ -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: {
|
||||
|
@ -990,4 +990,4 @@ wz-xml-file-editor {
|
||||
|
||||
discover-app-w .container-fluid {
|
||||
background: #fff;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user