Tuesday, January 30, 2018

Using Chartjs in Lightning Components

ChartJS provides interactive and animated HTML 5 based javaScript charts. We can use these in Lightning components to display charts.

I have created a sample lightning app which display different charts by using salesforce data.

I am going to display opportunities amount(in millions) grouped by forecast category. First of all store the Chartjs file in static resource in order to use it in lightning components.

Download the Chartjs file which I am using from this link Chartjs download

You can download complete code along with static resource from below Github repository and deploy to your org.


Below is sample code used to display charts in above snapshot.

Hope this will help!!


  1. Hi,
    if you change the point style line, locker service not work, check this:


  2. Can you use custom objects for the charts???

  3. How can you make the charts larger?

  4. I unquestionably truly loved all aspects about free page view tracker USA and I likewise have you spared to fav to take a gander at new data in your site.