Skip to content

Commit

Permalink
fix(core/chart): Fixed chart pieceLabel assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Tozzi authored and peppedeka committed Oct 28, 2021
1 parent 60a2b4c commit 1a95372
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/chart/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ export class AjfChartComponent implements AfterViewInit, OnChanges {
}
}

private _fixChartOptions(options: ChartOptions): ChartOptions {
options = options || {};
private _fixChartOptions(chartOptions: ChartOptions): ChartOptions {
const options = deepCopy(chartOptions) || {};
if (options.legendCallback) {
const legendCallback = (
typeof options.legendCallback === 'string'
Expand Down Expand Up @@ -313,7 +313,7 @@ export class AjfChartComponent implements AfterViewInit, OnChanges {
if (options.scales.yAxes == null) {
options.scales.yAxes = [];
}
options.scales.yAxes.forEach(yAxe => {
options.scales.yAxes.forEach((yAxe: any) => {
if (yAxe.ticks && yAxe.ticks.callback) {
const callback = (
typeof yAxe.ticks.callback === 'string'
Expand All @@ -323,7 +323,7 @@ export class AjfChartComponent implements AfterViewInit, OnChanges {
yAxe.ticks.callback = callback;
}
});
options.scales.xAxes.forEach(xAxe => {
options.scales.xAxes.forEach((xAxe: any) => {
if (xAxe.ticks && xAxe.ticks.callback) {
const callback = (
typeof xAxe.ticks.callback === 'string'
Expand All @@ -334,7 +334,7 @@ export class AjfChartComponent implements AfterViewInit, OnChanges {
}
});
if (this.chartType == 'pie') {
let newOptions = <any>options;
let newOptions = deepCopy(options);
newOptions.pieceLabel = {
...{
render: function (args: any) {
Expand Down

0 comments on commit 1a95372

Please sign in to comment.