Articles in this section
Category / Section

How to display multiple JavaScript Charts in a page?

2 mins read

Essential JavaScript Chart supports displaying multiple charts in same web page using different chart object container. To create multiple chart, you need to create chart container tag <div id="container"></div> for each chart. Based on the requirement, you can create multiple chart containers with different id and display charts in web page. Refer to the following code examples.

HTML

<div id="container"></div>
<div id="container1"></div>

 

JS

$("#container1").ejChart({
    series: [{
        points: [{ x: 'Walmart', y: 13, text: '13%' },
            { x: 'Apple', y: 25, text: '25%' },
            { x: 'Best Buy', y: 12, text: '12%' },
            { x: 'Target', y: 7, text: '7%' },
            { x: 'Amazon', y: 10, text: '10%' },
            { x: 'Wenger', y: 13, text: '13%' },
            { x: 'Others', y: 20, text: '20%' }
        ],
        name: 'Newyork', type: 'pie', explode: true,
    }],
});
$("#container").ejChart({
    series: [{
        points: [{ x: 1980, y: 11 }, { x: 1984, y: 13 },
            { x: 1988, y: 16 }, { x: 1992, y: 17 }, { x: 1996, y: 17 }, { x: 2000, y: 18 }, { x: 2004, y: 20 },
                { x: 2008, y: 22 }, { x: 2012, y: 24 }],
        name: 'India', type: "column"
    }],
});

 

JS Playground Link: Multiple Charts

 

Screenshot

Following screenshot displays more than one chart in a page

More than one chart in a page

 

Conclusion

I hope you enjoyed learning about how to display multiple chart in a page.

You can refer to our JavaScript Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Chart example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or
feedback portal
. We are always happy to assist you!


Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied