Inserting a Row/Line Number

Thread is closed for posting
5 posts, 1 answers
  1. Bruno
    Bruno avatar
    26 posts
    Member since:
    Feb 2009

    Posted 22 Jun 2009 Link to this post

    I created a Chart that outputs horizontal series like the image below:

    Chart Without NUmbers

    I want to put LineNUmbers for each Item Bounded to chart

    like the example below:

    Chart With Numbers

    How can I Add this Line Number in this order at runtime?

    does anyone knows a way to do that in prerender or itemdatabound Events ?

    Thanks.




  2. Bruno
    Bruno avatar
    26 posts
    Member since:
    Feb 2009

    Posted 23 Jun 2009 Link to this post

    any Idea?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bruno
    Bruno avatar
    26 posts
    Member since:
    Feb 2009

    Posted 23 Jun 2009 Link to this post

    may be i will tray to overlay an img with Jquery.

    does anybody knows if I can put a Fake Series with line numbers?




  5. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 24 Jun 2009 Link to this post

    Hi Bruno,

    RadChart only supports a single label for each X axis item, so adding these numbers as a separate labels would not be possible. Still, you can add the numbers to the existing labels: wire the BeforeLayout event of RadChart. At this point of the control lifecycle the axis labels are created and available for modification. You can loop through all of them and add that number:

        void RadChart1_BeforeLayout(object sender, EventArgs e) 
        { 
            int count = RadChart1.PlotArea.XAxis.Items.Count; 
     
            for (int i = 0; i < count; i++) 
            { 
                RadChart1.PlotArea.XAxis.Items[i].TextBlock.Text += "  " + (count - i); 
            } 
        } 
     


    However, if you need to have these number with different style this approach would not work. RadChart supports a custom image used as background, so you may not need to overlay another image, but set it as a chart background:

    RadChart1.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Image;
    RadChart1.Appearance.FillStyle.FillSettings.BackgroundImage = "MyImage.png";

    Hope this helps.

    Best regards,
    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. Bruno
    Bruno avatar
    26 posts
    Member since:
    Feb 2009

    Posted 24 Jun 2009 Link to this post

    Thank you !!

    this works perfect!

    I Love this forum !!


Back to Top
UI for ASP.NET Ajax is Ready for VS 2017