Changing the Format

Thread is closed for posting
6 posts, 0 answers
  1. Michael
    Michael avatar
    58 posts
    Member since:
    Jan 2008

    Posted 05 Mar 2008 Link to this post

    I'm trying to set the format to currency for the numbers that sit on top of the horizontal bars in my graph.  I was able to do this quite easily for the Y-axis by setting the ValueFormat = Currency, but I'm not sure how this is done for the numbers in the actual bar graph itself.

    Thanks.
  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 06 Mar 2008 Link to this post

    Hello Michael,

    You can use DefaultLabelValue property of the ChartSeries. Set it to "#Y{C}". You can find more details in this help topic:

    http://www.telerik.com/help/aspnet/chart/?UnderstandingElementsSeriesDefaultValues.html

    Hope this helps.

    Sincerely yours,
    Ves
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Michael
    Michael avatar
    58 posts
    Member since:
    Jan 2008

    Posted 06 Mar 2008 Link to this post

    Interesting - I can see the change at design time but when I run the project the dollar values aren't there...
  4. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 06 Mar 2008 Link to this post

    Hello Michael,

    We are unable to reproduce any problem with the describe approach -- please review the attached sample application and let us know how it goes.


    Regards,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Michael
    Michael avatar
    58 posts
    Member since:
    Jan 2008

    Posted 06 Mar 2008 Link to this post

    Seems like the RadChart doesn't like my objectdatasource.  Here's an update:

    1.) Your stand-alone project works just fine.
    2.) Ripping your chart code and placing it in my page with the other charts that don't work properly, works fine.
    3.) Taking your chart example and giving it a datasourceid of my objectdatasource is problematic.  It does not show the formatted $ properly.

    My objectdatasource pulls back a datatable.  The query behind it does a sum() of a float column in SQL Server.

    Keep in mind, the designer shows the correct currency format.  However, at runtime I'm getting one long string of digits.

    P.S - my dollar amounts are in the millions...


  6. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 10 Mar 2008 Link to this post

    Hi Michael,

    We are still unable to reproduce the problem on our end. Could you review the modified sample application that uses an ObjectDataSource control and let us know how can we observe the erroneous issue.

    Looking forward to your reply.


    Sincerely yours,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top