Search results

Marker Customization in JavaScript (ES5) Chart control

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.

var shapes = [
   'Diamond', 'Circle','Rectangle', 'Line', 'Triangle', 'Rectangle'
var shapeRender = function(args) {
 args.shape = shapes[args.point.index];
var chart = new ej.charts.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'
    }, '#element');
<!DOCTYPE html><html lang="en"><head>
    <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">
    <link href="" rel="stylesheet">
<script src="" type="text/javascript"></script>

    <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">
var ele = document.getElementById('container');
if(ele) { = "visible";
<script src="index.js" type="text/javascript"></script>