mirror of
https://github.com/ceph/ceph
synced 2024-12-26 21:43:10 +00:00
Merge pull request #53411 from rhcs-dashboard/align-charts
mgr/dashboard: align charts of landing page Reviewed-by: Nizamudeen A <nia@redhat.com>
This commit is contained in:
commit
e068b2aabd
@ -119,6 +119,7 @@ export class DashboardAreaChartComponent implements OnChanges, AfterViewInit {
|
||||
],
|
||||
yAxes: [
|
||||
{
|
||||
afterFit: (scaleInstance: any) => (scaleInstance.width = 100),
|
||||
gridLines: {
|
||||
display: false
|
||||
},
|
||||
@ -129,7 +130,7 @@ export class DashboardAreaChartComponent implements OnChanges, AfterViewInit {
|
||||
if (value === 0) {
|
||||
return null;
|
||||
}
|
||||
return this.fillString(this.convertUnits(value));
|
||||
return this.convertUnits(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -265,18 +266,6 @@ export class DashboardAreaChartComponent implements OnChanges, AfterViewInit {
|
||||
return dataWithUnits;
|
||||
}
|
||||
|
||||
private fillString(str: string): string {
|
||||
let maxNumberOfChar: number = 8;
|
||||
let numberOfChars: number = str.length;
|
||||
if (str.length < 4) {
|
||||
maxNumberOfChar = 11;
|
||||
}
|
||||
for (; numberOfChars < maxNumberOfChar; numberOfChars++) {
|
||||
str = '\u00A0' + str;
|
||||
}
|
||||
return str + '\u00A0\u00A0';
|
||||
}
|
||||
|
||||
private setChartTicks() {
|
||||
if (!this.chart) {
|
||||
return;
|
||||
@ -305,9 +294,9 @@ export class DashboardAreaChartComponent implements OnChanges, AfterViewInit {
|
||||
return null;
|
||||
}
|
||||
if (!maxValueDataUnits) {
|
||||
return this.fillString(`${value}`);
|
||||
return `${value}`;
|
||||
}
|
||||
return this.fillString(`${value} ${maxValueDataUnits}`);
|
||||
return `${value} ${maxValueDataUnits}`;
|
||||
};
|
||||
this.chartDataUnits = maxValueDataUnits || '';
|
||||
this.chart.chart.update();
|
||||
|
Loading…
Reference in New Issue
Block a user