Marker customization in EJ2 TypeScript Chart control

8 May 20237 minutes to read

By using the pointRender, you can customize the marker shape.

To Customize the marker shape, follow the given steps:

Step 1:

Customize the marker shape in each data point by using the pointRender event. Using this event, you can set the shape value to the argument.

import { Chart, LineSeries, Category,IPointRenderEventArgs, Legend,ILoadedEventArgs } from '@syncfusion/ej2-charts';
Chart.Inject(LineSeries, Category, Legend);
let shapes: string[] = [
   'Diamond', 'Circle','Rectangle', 'Line', 'Triangle', 'Rectangle'
let shapeRender: EmitType<IPointRenderEventArgs> = (args: IPointRenderEventArgs)=> {
 args.shape = shapes[args.point.index];
    let chart: Chart = new Chart({
        //Initializing Primary X Axis
        primaryXAxis: {
            title: 'Countries', valueType: 'Category',
            interval: 1
        //Initializing Primary Y Axis
            title: 'Penetration', rangePadding: 'None',
            labelFormat: '{value}%', minimum: 0,
            maximum: 75, interval: 15
        //Initializing Chart Series
        series: [
                type: 'Line',
                dataSource: [{ x: 'WW', y: 12, text: 'World Wide' },
                { x: 'EU', y: 5, text: 'Europe' },
                { x: 'APAC', y: 15, text: 'Pacific' },
                { x: 'LATAM', y: 6.4, text: 'Latin' },
                { x: 'MEA', y: 30, text: 'Africa' },
                { x: 'NA', y: 25.3, text: 'America' }],
                name: 'December 2007',
                marker: {
                    visible: true, width: 10, height: 10,
                    shape: 'Diamond', dataLabel: { name: 'text' }
                xName: 'x', width: 2,
                yName: 'y',

        //Initializing Chart title
        title: 'FB Penetration of Internet Audience',
        legendSettings: { visible: false },
        pointRender: shapeRender,
    height: '350px'
<!DOCTYPE html>
<html lang="en">

    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="" rel="stylesheet" rel="stylesheet">
    <link href="" rel="stylesheet">
    <script src=""></script>
    <script src="systemjs.config.js"></script>
<script src="" type ="text/javascript"></script>

    <div id='loader'>Loading....</div>
    <div class="col-sm-8">
            <div class="row">
                <div class="col-sm-4">  
                  <div id='container'>
                    <div id='element'  style="width:350px; height:350px;float:left">
                    <label id="lbl"></label>
                <div class="col-sm-4" style="width:200px; height:350px;float: right">
                  <div id='Grid'>