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

[Solved] Two Charts Side by Side

2 Answers 88 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shawn
Top achievements
Rank 2
Shawn asked on 25 May 2012, 04:25 PM
How can I display two charts side-by-side on my page?  I have two chart definitions immediately following each other in my razor markup, and am using the 
".HtmlAttributes(new { style = "width: 480px; " })"
setting to ensure the width is narrow enough to fit two charts side by side (and this is visually confirmed).  But yet they are displaying one below the other on my page. Please advise.
Thanks for a great product.
EDIT: I've even tried putting them both in one <div> but they still display below each other instead of side-by-side.

2 Answers, 1 is accepted

Sort by
0
Accepted
Iliana Dyankova
Telerik team
answered on 28 May 2012, 01:48 PM
Hello Shawn,

The ASP.NET MVC Chart is initialized from a <div> markup element, which is a block element and it takes up the full width available. In order to arrange your charts side by side you could use CSS and display them as inline-block elements. For example:
.HtmlAttributes(new { style = "width: 480px; height: 400px; margin: auto; display: inline-block" })

I hope this helps.

Regards,
Iliana Nikolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Shawn
Top achievements
Rank 2
answered on 28 May 2012, 02:08 PM
Thanks this works (as long as I am sure to declare my two reports inside the same <div> element).
Tags
Chart
Asked by
Shawn
Top achievements
Rank 2
Answers by
Iliana Dyankova
Telerik team
Shawn
Top achievements
Rank 2
Share this question
or