This is a migrated thread and some comments may be shown as answers.

Inserting a Row/Line Number

4 Answers 49 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Bruno
Top achievements
Rank 1
Bruno asked on 22 Jun 2009, 09:02 PM
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.




4 Answers, 1 is accepted

Sort by
0
Bruno
Top achievements
Rank 1
answered on 23 Jun 2009, 12:50 PM
any Idea?
0
Bruno
Top achievements
Rank 1
answered on 23 Jun 2009, 06:29 PM
may be i will tray to overlay an img with Jquery.

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




0
Accepted
Ves
Telerik team
answered on 24 Jun 2009, 07:26 AM
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.
0
Bruno
Top achievements
Rank 1
answered on 24 Jun 2009, 01:11 PM
Thank you !!

this works perfect!

I Love this forum !!


Tags
Chart (Obsolete)
Asked by
Bruno
Top achievements
Rank 1
Answers by
Bruno
Top achievements
Rank 1
Ves
Telerik team
Share this question
or