|
App.component.html:
<ejs-chart style='display:block' align='center' [tooltip]='tooltip' >
<e-series-collection>
// add your additional code snippet here
</e-series-collection>
</ejs-chart>
App.component.ts:
// add your additional code snippet here
public tooltip: Object = {
enable: true,
shared: true
}; |
|
// add your additional code snippet here
App.component.html:
<div class="control-section">
<div align='center'>
<ejs-chart #chart style='display:block' align='center' id='chartcontainer' [title]='title' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis' (tooltipRender) = 'tooltipRender($event)' [tooltip]='tooltip' (load)='load($event)' [chartArea]='chartArea' [width]='width'>
<e-series-collection>
<e-series [dataSource]='data' type='Line' xName='x' yName='y' width=2 [marker]='marker'> </e-series>
<e-series [dataSource]='data1' type='Line' xName='x' yName='y' width=2 [marker]='marker'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</div>
App.component.ts:
@ViewChild('chart')
private chart: ChartComponent;
public tooltip: Object = {
enable: true,
template: '<div id="wrap"></div>'
};
// add your additional code snippet here
public tooltipRender(args : ITooltipRenderEventArgs ): void {
args.template =
'<div id="wrap"><table style="width:100%; border: 1px solid black;" class="table-borderless">' +
'<tr><td style="height: 25px; width: 100px; background-color: #C1272D; font-size: 12px; color: #E7C554; font-weight: bold; padding-left: 5px"><div>Series1 yValue: <b>'+ this.chart.series[0].dataSource[args.data.pointIndex].y + '</b></div></td></tr>' +
'<tr><td style="height: 25px; width: 100px; background-color: #C1272D; font-size: 12px; color: #FFFFFF; font-weight: bold; padding-left: 5px"><div>Series2 yValue: <b>'+ this.chart.series[1].dataSource[args.data.pointIndex].y + '</b></div></td></tr></table></div>'
};
// add your additional code snippet here
|