Problem formatting labels

Thread is closed for posting
2 posts, 0 answers
  1. kizza
    kizza avatar
    14 posts
    Member since:
    Oct 2006

    Posted 01 Apr 2009 Link to this post

    Hello,

    I would like to change the labels above my bars to reflect money.

    I tried to change the defaultlabelvalue like this: RadChart.Series[0].DefaultLabelValue = something

    I get a index out of range error.

    When i lookup the amount of series i have in my graph, it shows 0 series, but i still have data.

    How do i format the labels now?



  2. Dessy
    Admin
    Dessy avatar
    73 posts

    Posted 03 Apr 2009 Link to this post

    Hi kizza,

    Actually your chart does have series.They could be created from the design view mode or when the chart is databound, or also programmatically.  If you use a databound chart, you should first  use DataBind method and then you could access the chart series and set DefaultLabelValue property. Otherwise the chart will not recognize the series and will generate the exception which you receive.
    In order to display labels with currency you should set DefaultLabelValue to "#Y{C}" where ,"#Y" display numbers from the Y axis respectively and C is equal to Currency.

    RadChart1.Series[0].DefaultLabelValue=
    "#Y{C}";
     

    You can also use the formatting described in this MSDN article  Standard Numeric Formats . Use curly brackets to contain the standard numeric formats

    Hope that helps.

    Best wishes,
    Dessy
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top