I want to use ApexCharts as a means of visualization in Angular. ng-apexcharts is the npm package that acts as a wrapper. Because the default tooltip of ApexCharts doesn't fit my design, I'd like to make a custom tooltip component.
A custom tooltip can be specified the following way:
HTML:
<apx-chart ... [tooltip]="tooltip"></apx-chart>
TypeScript:
@Component({...})
export class LineChartComponent implements OnInit {
tooltip: ApexTooltip = {
custom: ({ series, seriesIndex, dataPointIndex, w }) => {
return "<div>Custom tooltip HTML</div>"
}
};
...
}
I have the following problem:
When trying to define a template like this as the tooltip HTML
`<div class="SOME_CLASS"><mat-card>${SOME_VALUE}</mat-card></div>`
and adding this to the component's CSS file
.SOME_CLASS {
color: red;
}
the class property and a non-HTML component like mat-card won't translate to the appropriate representations in the DOM. The string is just pasted instead. The HTML-structure can be found here.
What would be a way to make Angular bind this template correctly?
PS: I don't have access to the tooltip component so specifying
<tooltip [innerHtml]="SOME_VARIABLE"></tooltip>
won't work either.