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

Dynamically Growing PlotArea

3 Answers 102 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Abdul
Top achievements
Rank 2
Abdul asked on 30 Nov 2010, 12:42 PM
I have created a simple bar chart... which is bound to an array... size of array is unknown... is it possible for me to make a chart which have same bar widths even there are 2 record or more... current bars become thicker when there are less records.... 

second thing is when I have lets' say 1000 bars in chart the PlotArea is too small for these number of bars... it creates a mess with scale and bars... i need a chart that have same same bar width for any number of charts and dynamic PlotArea...

please help

3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 03 Dec 2010, 02:26 PM
Hello Abdul,

Even though you don't know the count of the bars you can use the maximal value of the chart Bars and set it as MaxValue of the XAxis. To be able to do this you should turn off the XAxis.AutoScale proeprty and provide your own values for MinValue, MaxValue and Step. This way, you will always have the same number of items along the X axis, so the bar will always be with the same width.
Setting custom scale with appropriate Step will help you resolving your second issue too.

All the best,
Evgenia
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Abdul
Top achievements
Rank 2
answered on 07 Dec 2010, 12:33 PM
I have plotted my x-axis accordingly... and currently using zoom property to view my all millions of bars (plots) in reasonable size. I'am more concerned with my second question i.e. to draw a custom sized PlotArea. So the chart size become as much larger as the axis is..

However i have received this reply on dynamically growing chart size question... some what related to this question

"RadChart creates an image on the server and sends it to the client so there is no way on the client side to change that size. The solution is to use JavaScript and send requests to the server."

0
Evgenia
Telerik team
answered on 10 Dec 2010, 01:03 PM
Hi Abdul,

RadChart renders a normal image on the page, which does not have any dynamic values to resize itself. This how ever can be achieved with the help of some javascript for manually altering the image width/height. Take a look at the following Code Library - http://www.telerik.com/community/code-library/aspnet-ajax/chart/resize-chart-image-in-radsplitter.aspx   and more specifically the ClientSide resizing.

Greetings,
Evgenia
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Chart (Obsolete)
Asked by
Abdul
Top achievements
Rank 2
Answers by
Evgenia
Telerik team
Abdul
Top achievements
Rank 2
Share this question
or