BarChart with differernt color

5 posts, 0 answers
  1. rahul
    rahul avatar
    25 posts
    Member since:
    Jan 2011

    Posted 23 Aug 2011 Link to this post

    Question 1)
    How can I make bars in a chart with different colors, by default it takes only first color from the Pallete Brushes and all the bars get created with the same color?? I don't want to go with Stacked Bar?/

    Question 2)
    How can I format the numbers in K . example 481000.23 should give 481.23 K

    mapping1.SeriesDefinition.ItemLabelFormat =

     

    "0, k";
    The above format string gives 481 K but I wnat it as 481.23 K


    These are very urgent issues!! Any help is appreciated.

    Thanks,
    Rahul Saxena

     

  2. rahul
    rahul avatar
    25 posts
    Member since:
    Jan 2011

    Posted 23 Aug 2011 Link to this post

    I got the solution for first question

    mapping1.SeriesDefinition.LegendDisplayMode =

     

    LegendDisplayMode.DataPointLabel; but reply for question 2 is still expecting.

     



    Have one more question.
    On X asis I have very big names(screen shot attched), datase column (FULL_NAME) which makes the charts unreadable,   I want to show only first 15 chars  only for display purpose, which I have stored in other column(FULL_NAME_TRIM).

    How can I create the X axis with column FULL_NAME and only for display purpose I want to show FULL_NAME_TRIM.

    Below  code give display as FULL_NAME, what change I shall do to draw the X Asix with column FULL_NAMEm but to display  FULL_NAME_TRIM

    mapping1.ItemMappings.Add(

     

    new ItemMapping("YAxis", DataPointMember.YValue));

     

    mapping1.SeriesDefinition =

     

    new BarSeriesDefinition();

     

    mapping1.GroupingSettings.GroupDescriptors.Add(

     

    new ChartGroupDescriptor("Group"));

     

    mapping1.ItemMappings.Add(

     

    new ItemMapping("FULL_NAME)", DataPointMember.XCategory));


    Many Thanks.
    Rahul

     

  3. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 26 Aug 2011 Link to this post

    Hello Rahul,

    To your question regarding the ItemLabelFormat. Here is how your format should look like:
    seriesMapping.SeriesDefinition.ItemLabelFormat = "#Y{0,.00} k";

    To your latest question:
    Why don't you set the ItemMapping's FieldName to FULL_NAME_TRIM and the DataPointMember to XCategory like this:
    mapping1.ItemMappings.Add( new ItemMapping("FULL_NAME_TRIM)", DataPointMember.XCategory));

    All the best,
    Evgenia
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  4. Mayra
    Mayra avatar
    18 posts
    Member since:
    Oct 2011

    Posted 25 Oct 2011 Link to this post

    I have current a series with Y axis (number) and x axis ( percent) 
    Can you please provide a example on how to have one series with different colors for the axis in the XAML code? In other words, Percent less than zero one color and percent greater than 0 other color. 
    I would really appreciate your help.
  5. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 28 Oct 2011 Link to this post

    Hi Mayra,

    Your scenario looks pretty much like our MVVM demo. You may also find our online documentation helpful for achieving it.

    All the best,
    Evgenia
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top