In this blog post, I am going to share a lighting component which will display a chart based on the selected report and chart type. In this component, I have used the Chart.JS open-source javascript library to draw chart in lightning component. The user can select the report and chart type to draw/display the chart and the selection of report name and chart type will be remembered for the user.
Chart JS is a javascript library that allows us to design and draw the different kinds of charts using the HTML 5 canvas element. We can use this library to draw a simple, clean and animated chart. Below are some advantage of using this library for drawing chart.
- It is open source.
- We can use 8 chart type to display the chart.
- HTML5 canvas (great rendring performance across all the modern browser)
- It is responsive.
I have created a package which you can install in your salesforce instance.