RadChart Bar width

6 posts, 0 answers
  1. Muhammad
    Muhammad avatar
    5 posts
    Member since:
    Feb 2009

    Posted 12 Feb 2009 Link to this post

    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
     

  2. Ves
    Admin
    Ves avatar
    2666 posts
    Member since:
    Sep 2012

    Posted 12 Feb 2009 Link to this post

    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.

  3. DevCraft Release
  4. Muhammad
    Muhammad avatar
    5 posts
    Member since:
    Feb 2009

    Posted 12 Feb 2009 Link to this post

    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)

  5. Ves
    Admin
    Ves avatar
    2666 posts
    Member since:
    Sep 2012

    Posted 16 Feb 2009 Link to this post

    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.

  6. vin
    vin avatar
    22 posts
    Member since:
    Apr 2009

    Posted 20 Jun 2009 Link to this post

    Hello Muhammad,
    Did u get the solution for it, I am also facing same issue,,, please give answer if u could solve

  7. Prashant
    Prashant avatar
    1 posts
    Member since:
    Apr 2009

    Posted 19 Jan 2010 Link to this post

    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.

Back to Top
DevCraft Release