I was facing a problem with Ngx
line chart xAxisTickFormatting
function which was called from HTML like this: [xAxisTickFormatting]="xFormat"
.
I was unable to access my component's variable from the function declared. This solution helped me to resolve the issue to find the correct this. Hope this helps the Ngx
line chart, users.
insteadInstead of using the function like this:
xFormat (value): string {
return value.toString() + this.oneComponentVariable; //gives wrong result
}
Use this:
xFormat = (value) => {
// console.log(this);
// now you have access to your component variables
return value + this.oneComponentVariable
}