Solution 1 :

I found the solution.Posting the answer.Adding the below css aligns the chart centrally-

.center {
    margin: auto;
    width: 60%;
    padding: 10px;

Problem :

I am trying to centrally align p-chart inside a p-panel. However I’m unable to figure out the right css to do so. Please help.

This is my template code:

   <p-panel header="Charts">
       <p-chart type="bar" height="150px" width="50vw" [data]="barChartData" style="display:block;margin-right:auto;margin-left:auto;">