[SalesForce] Add Report Chart to Lightning Components

Question 1-
I am trying to add Report Charts (Salesforce custom reports) to the lightning record page layout. This is not meeting my requirement as I have to apply/modify report filters with landing record page custom field values.

Question 2-
As a workaround to above, I am thinking to host the same Report Charts in custom Lightning Component and then modify the report filters using apex, etc. But I am not finding any way to host it.

Is either of the above solution possible? Or any recommendation on how to do it differently? I am trying to prevent using any 3rd party chart library to draw charts in the LC.

Best Answer

I think Report Chart type Component can fulfil your requirement. If you have created a report having a chart and stored in a shared folder can we used on the Lightning record pages, also, It will respect all the filters and grouping you have applied. Additionally, You can filter your report based on the current record.

The report chart will appear on your record page as per your chart setting:-

enter image description here

The above chart appears without filtering the report with current record id. If you have applied filter with the current record it will come as:-

enter image description here

The properties pane of Report chart in Lightning app builder pane:-

enter image description here

Related Topic