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

Rad Chart - X axis dynamic width and bar width setting

3 Answers 462 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jasvinder
Top achievements
Rank 1
Jasvinder asked on 20 Sep 2010, 11:13 AM
I have  a need to display dynamic items on X axis i.e form one item to n number of items (may go to 100 or more)


Y-Axis has a maximum value of 100 %

There can be more then one series on X-axis, maximum can go up to 5.

Problem I am facing is width of the bar is getting very big on x-axis if there are fewer items,
I have tried BarWidthPercentage it works, but not helpful for dynamic adjustments.

Need help to fit in my dynamic series and dynamic items on x-axis and the chart should look consistent.

I have used scrolling and X Scale property  also, as  I need the scrolling functionality.

Attached is the image for bad chart i am getting, there are more then 25 items and I have used scrolling,
the width of BAR is very large, the number of items in scroll is very less as only 10 items are viewable after
scrolling....


Kindly help in getting a good looking chart with  lot of items and up-to 5 series dynamically, where all the calculation
is done on the rutime for width and formatting.

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 22 Sep 2010, 01:11 PM
Hi Jasvinder,

Indeed, RadChart is designed so that the bar width actually depends on the number of items. The more items -- the narrower the bars. This provides the necessary level  of flexibility, so that the chart can handle multiple cases with minimum adjustments. Still, in cases like this one RadChart allows you to fix the bar width by fixing the XAxis range. You can use these two lines:

Copy Code
RadChart1.PlotArea.XAxis.AutoScale = false;
RadChart1.PlotArea.XAxis.AddRange(0, max, 1);

where max is defined by the max number of items in the underlying datasource. This way the X axis will always reserve space for max items, and even if there are less items in the chart the bars will not grow.

Kind regards,
Ves
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Yazan
Top achievements
Rank 1
answered on 17 Nov 2011, 01:24 PM
"Before posting make sure your project is using the exact same RadControl version as the one in this thread".
This is a great tip (that I got before posting the reply).. and it's my exact problem.. Actually I can't find
RadChart1.PlotArea
In other words, the PlotArea property is missing.. my current version of Telerik is come from "RadControls_for_Silverlight_4_2010_2_0812_DEV.msi". Is there any alternative solution ??!

Thanks
0
Ves
Telerik team
answered on 22 Nov 2011, 08:46 AM
Hi Yazan,

This forum is about Telerik Reporting and the file you mentioned is the installer for RadControls for Silverlight. For help and samples, please visit our online help and examples, dedicated to RadChart for Silverlight as well as the corresponding forum.

Best regards,
Ves
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

Tags
General Discussions
Asked by
Jasvinder
Top achievements
Rank 1
Answers by
Ves
Telerik team
Yazan
Top achievements
Rank 1
Share this question
or