Skip to content

Commit

Permalink
Merge pull request #13589 from opf/49767-Number-of-wp-no-longer-shown…
Browse files Browse the repository at this point in the history
…-in-bars-on-the-graph

[49767] Number of wp no longer shown in bars on the graph
  • Loading branch information
ulferts committed Aug 30, 2023
2 parents 8cdbc4f + ac8babf commit fa1c4e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { WorkPackageTableConfiguration } from 'core-app/features/work-packages/c
import { ChartOptions } from 'chart.js';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { GroupObject } from 'core-app/features/hal/resources/wp-collection-resource';
import DataLabelsPlugin from 'chartjs-plugin-datalabels';

export interface WorkPackageEmbeddedGraphDataset {
label:string;
Expand Down Expand Up @@ -37,6 +38,8 @@ export class WorkPackageEmbeddedGraphComponent {

public chartData:ChartDataSet[] = [];

public chartPlugins = [DataLabelsPlugin];

public internalChartOptions:ChartOptions;

public initialized = false;
Expand Down Expand Up @@ -105,6 +108,7 @@ export class WorkPackageEmbeddedGraphComponent {
display: this.datasets.length > 1,
},
datalabels: {
anchor: 'center',
align: this.chartType === 'bar' ? 'top' : 'center',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<canvas baseChart
[datasets]="chartData"
[labels]="chartLabels"
[plugins]="chartPlugins"
[type]="mappedChartType"
[options]="internalChartOptions"
*ngIf="hasDataToDisplay">
Expand Down

0 comments on commit fa1c4e2

Please sign in to comment.