KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Center The Chart On Dashboard Panel #3233

Closed afieq opened this topic on on Jan 23 - 4 comments

afieq commented on Jan 23

Hi,

I'm facing a problem where i reduce the height and width of my chart but it become not center now and more to the left side. How can i make it become center position?

Thanks in advance.

Regards, Afieq

KoolReport commented on Jan 23

Let try to wrap the chart within a div like this:

Html::div()->class("d-flex align-items-center")->sub([
    MyChart::create()
])

Let us know if you need further assistance.

afieq commented on Jan 23

Hi KoolReport,

I have tried added your suggestion but still the chart is not center. Am i doing it wrong?

Panel::success([
                Html::div()->class("d-flex align-items-center")->sub([
                MyChart::create()
                ])
            ])

Thanks in advance.

Regards, Afieq

KoolReport commented on Jan 24

Let try a simple css like this:

Html::div()->style("text-align:center")->...

Basically you cover the chart with an div and you can set whatever css or class to make it center. You can search more for suitable css.

afieq commented on Jan 28

Hi KoolReport,

I have found the solution, i'm using you suggestion but change the code on style to align and the chart now in center postion. Thanks for your help for solving my problem.

Panel::create()->sub([
                Html::div()->align("center")->sub([
                MyChart::create()
                ])
            ]),

Regards, Afieq

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Dashboard