Answer the question
In order to leave comments, you need to log in
How to customize tooltip in ngx-charts?
The documentation describes the ability to customize the tooltip for the vertical chart. I tried to do it in the following code, but did not get the expected result, please help me figure it out.
DEMO is here.
component:
sources = [
{ "id": 0, "name": "qw1", "value": 8000 },
{ "id": 1, "name": "er2", "value": 7500 },
{ "id": 2, "name": "ty3", "value": 7300 }
]
view: any[] = [400, 200];
showXAxis = true;
showYAxis = true;
showXAxisLabel = false;
showYAxisLabel = false;
showDataLabel = true;
constructor() {}
<ngx-charts-bar-vertical
[view]="view"
[results]="sources"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[showDataLabel]="showDataLabel">
<ng-template #seriesTooltipTemplate let-item="item">
<h1>
{{1+2}}
</h1>
<h2>{{item.name}}: {{item.value}} : {{item|json}}</h2>
</ng-template>
</ngx-charts-bar-vertical>
<h2>{{item.name}}: {{item.value}} : {{item|json}}</h2>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question