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

RadChart Bar width

5 Answers 294 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 12 Feb 2009, 06:14 AM
i want to assign radchart Bar width in pixel. i am binding chart with dataset.
so that if there is only 1 item(1bar) in the graph then width should not expand to whole width of the chart.
Barwidthpercentage sets bar width with respect to items. but if there is less items then barwidth increases.

thanks
 

5 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 12 Feb 2009, 04:35 PM
Hi Muhammad,

You can set XAxis.AutoScale to false and provide your own values for MinValue and MaxValue. 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.

Sincerely,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Muhammad
Top achievements
Rank 1
answered on 13 Feb 2009, 05:14 AM
thanks. i tried your solution but.
i did XAxis.AutoScale to false after binding with dataset. i set minvalue=6 & max value to 8 so it changed the axisitem label ("monday" to "6") and added another item with axisitem label "108" and the width issue remain the same. so the solution doesnot worked for me.
i repeat my issue
i like my chart to display > if dataset hv 3days data(mon,teus,wed) then i should also divide the chart bars width equivalent to when data is of 7 days( means in this case 3 bars jst occupy 34% of the chart not 100% of  the chart)
0
Ves
Telerik team
answered on 16 Feb 2009, 07:52 AM
Hello Muhammad,

I am afraid this is not directly supported by RadChart. Still, you can achieve this - you need to calculate the value of BarWidthPercent manually. You have the necessary information -- the chart width, the plot area margins and the number of X axis items.

All the best,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
vin
Top achievements
Rank 1
answered on 20 Jun 2009, 12:18 PM
Hello Muhammad,
Did u get the solution for it, I am also facing same issue,,, please give answer if u could solve
0
Prashant
Top achievements
Rank 1
answered on 19 Jan 2010, 06:07 AM
Hello Team,

I am using a telerik barchart which has a single value.It is occupying the entire x-axis .
Even i have tried with the solutions as suggested i souild not get it.
Please help me out how to calculate the bar width percent manually using some formula.
If possible provide me the formula.
Tags
Chart (Obsolete)
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Ves
Telerik team
Muhammad
Top achievements
Rank 1
vin
Top achievements
Rank 1
Prashant
Top achievements
Rank 1
Share this question
or