Skip to content

Commit

Permalink
Disable on hover events on agreement chart
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanoAlvino committed Nov 19, 2021
1 parent c372c69 commit 91c065e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
12 changes: 10 additions & 2 deletions frontend/src/app/vote-results/domain/ChartConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export class ChartConfiguration
public static CHART_TYPE_DOUGHNUT: ChartType = 'doughnut';

/**
* The configuration object for the entire chart.
* The configuration object for the estimates chart.
*/
public static CHART_OPTIONS: ChartOptions = {
public static ESTIMATES_CHART_OPTIONS: ChartOptions = {
animation: {
duration: 0
},
Expand All @@ -71,4 +71,12 @@ export class ChartConfiguration
}
}
};

/**
* The configuration object for the agreement rate chart.
*/
public static AGREEMENT_CHART_OPTIONS: ChartOptions = {
tooltips: {enabled: false},
hover: {mode: null},
};
}
3 changes: 2 additions & 1 deletion frontend/src/app/vote-results/vote-results.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<canvas baseChart
[datasets]="agreementRateChartData"
[legend]="false"
[options]="agreementRateChartOptions"
[chartType]="agreementRateChartType">
</canvas>
</div>
Expand All @@ -23,7 +24,7 @@
<canvas baseChart
[datasets]="estimatesChartData"
[labels]="estimatesChartXAxisLabels"
[options]="chartOptions"
[options]="estimatesChartOptions"
[legend]="false"
[chartType]="estimatesChartType">
</canvas>
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/app/vote-results/vote-results.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ export class VoteResultsComponent
public agreementRateChartType: ChartType = ChartConfiguration.CHART_TYPE_DOUGHNUT;

/**
* The chart options.
* The estimates chart options.
*/
public chartOptions: ChartOptions = ChartConfiguration.CHART_OPTIONS;
public estimatesChartOptions: ChartOptions = ChartConfiguration.ESTIMATES_CHART_OPTIONS;

/**
* The agreement rate chart options.
*/
public agreementRateChartOptions: ChartOptions = ChartConfiguration.AGREEMENT_CHART_OPTIONS;

/**
* The labels to use for the x-axis in the chart for the estimates.
Expand Down

0 comments on commit 91c065e

Please sign in to comment.