Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

improve work package graph widget scale

bsatarnejaddbd6924268ac
diff --git a/frontend/src/app/modules/work-package-graphs/embedded/wp-embedded-graph.component.ts b/frontend/src/app/modules/work-package-graphs/embedded/wp-embedded-graph.component.ts
index b6e2ee332c6..e0baece6f87 100644
--- a/frontend/src/app/modules/work-package-graphs/embedded/wp-embedded-graph.component.ts
+++ b/frontend/src/app/modules/work-package-graphs/embedded/wp-embedded-graph.component.ts
@@ -124,6 +124,29 @@ export class WorkPackageEmbeddedGraphComponent {
};
}
+ if (this.chartType === 'bar') {
+ chartTypeDefaults = {
+ scales: {
+ yAxes: [{
+ stacked: true,
+ ticks: {
+ callback: (value:number) => {
+ if (Math.floor(value) === value) {
+ return value;
+ } else {
+ return 0;
+ }
+ }
+ }
+ }],
+ xAxes:
+ [{
+ stacked: true
+ }]
+ }
+ };
+ }
+
this.chartOptions = Object.assign({}, defaults, chartTypeDefaults, this.inputChartOptions);
}