I'm submitting a ... (check one with "x")
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior
Not able to use the input tooltipTemplate of ngx-charts-line-chart.
nhandled Promise rejection: Template parse errors:
Can't bind to 'tooltipTemplate' since it isn't a known property of 'ngx-charts-line-chart'.
Expected behavior
use tooltipTemplate to customize the tooptip
Reproduction of the problem
https://plnkr.co/edit/U7JE8d?p=preview
<ngx-charts-line-chart
[view]="view"
[scheme]="colorScheme"
[results]="multi"
[gradient]="gradient"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
[legend]="showLegend"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[xAxisLabel]="xAxisLabel"
[yAxisLabel]="yAxisLabel"
[autoScale]="autoScale"
[tooltipTemplate]='someTemplate'
(select)="onSelect($event)">
<ng-template #someTemplate let-model="model">
bla bla bla
</ng-template>
</ngx-charts-line-chart>
What is the motivation / use case for changing the behavior?
use tooltipTemplate to customize the tooptip
Please tell us about your environment:
see plunkar
ngx-charts version: x.x.x
latest
Angular version: 2.x.x
4.0.1
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Language: [all | TypeScript X.X | ES6/7 | ES5]
ok I figure it out.
Seems I misunderstand the usage (maybe the doc should be more clear on this? I think it's not intuitive to use a 'input' like this).
Following codes works:
<ngx-charts-line-chart
[view]="view"
[scheme]="colorScheme"
[results]="multi"
[gradient]="gradient"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
[legend]="showLegend"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[xAxisLabel]="xAxisLabel"
[yAxisLabel]="yAxisLabel"
[autoScale]="autoScale"
(select)="onSelect($event)">
<ng-template #tooltipTemplate let-model="model">
bla bla bla
</ng-template>
</ngx-charts-line-chart>
I did the exact same.
At the docs, you find the tooltipTemplate under the Inputs table along with results, scheme, schemeType... so that can be a little misleading.
I do think that the documentation needs more clarity. This section is under Examples, but there are no actual examples on the page.
Ref: https://swimlane.gitbook.io/ngx-charts/examples/line-area-charts/area-chart
Most helpful comment
ok I figure it out.
Seems I misunderstand the usage (maybe the doc should be more clear on this? I think it's not intuitive to use a 'input' like this).
Following codes works: