This is a migrated thread and some comments may be shown as answers.

How to center a funnel chart in a div

1 Answer 195 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 07 Mar 2019, 05:59 AM

I am trying to center a funnel chart in a div, but it doesn't work with my css. It would work well if I use other svg in a div. It looks like that the svg for the unnel chart always start from the point(0, 0) even though I set its margin in css. Much appreciate if any help.

Following is my css

div svg {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

1 Answer, 1 is accepted

Sort by
0
Teya
Telerik team
answered on 08 Mar 2019, 02:32 PM
Hi Nick,

Generally speaking, in order to center a Kendo Chart inside a div, you should set text-align: center to the wrapper element of the chart's container and display: inline-block to the chart's div container:

#chart-wrap {
 text-align: center;
}
       
#chart {
 display: inline-block;
}

I have created a working example in the following Dojo:

https://dojo.telerik.com/iMOcuWUg

If for some reason these additional styles are not working in your case, can you please update the Dojo with your custom configuration so that I can provide you with the respective CSS rules?

I hope this helps.


Regards,
Teya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Charts
Asked by
Nick
Top achievements
Rank 1
Answers by
Teya
Telerik team
Share this question
or