You need to sign in to do that
Don't have an account?
Brooks Johnson 6
Center a Visualforce Chart in Lightning
I have a simple Visualforce Pie Chart that I wanted to use in Lightning. When I add it to a record page the chart aligns left. I would like to be in the center but don't seem to be able to adjust it's positioning. Can this be done with CSS when it is being used on a Lightning Record Page?
<apex:page controller="CampaignPieChartController" title="Campaign Metrics" lightningStylesheets="true"> <div style="margin: 0px auto"> <apex:chart height="300" width="300" data="{!pieData}" resizable="true"> <apex:legend position="bottom" font="14px Helvetica"/> <apex:pieSeries dataField="data" labelField="name" colorSet="#008CC3,#F0B428,#B42846"> <apex:chartLabel display="outside" font="bold 18px Helvetica"/> </apex:pieSeries> </apex:chart> </div> </apex:page>
https://www.lightningdesignsystem.com/utilities/alignment/
All Answers
https://www.lightningdesignsystem.com/utilities/alignment/