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

Drawing an average line on a bar chart

3 Answers 279 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dhanushka Athukorala
Top achievements
Rank 2
Dhanushka Athukorala asked on 17 Nov 2009, 08:17 AM
I'm new to telerik reporting tools and i wanna draw an average line on a bar chart surface like the following image can any one give me a hand
thanx in advance
p.s
I have seen the scale break property of the chart object, and I set its value tolerance to the average value from the code behind file and used it as the average line, but the thing is as the pictures shows I wanna make the line to appear behind the chart bars not above them is there a way for me to achieve this please help me!



3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 18 Nov 2009, 02:30 PM
Hello Dhanushka,

You can take advantage of the MarkedZones in the chart item. In this case you will need to set the ValueStartY and ValueEndY with the same value, so that only the border is visible and provide color and border width:

myMarkedZone.ValueStartY = 3.5
myMarkedZone.ValueEndY = 3.5
myMarkedZone.Appearance.Border.Color = Colors.Red;
myMarkedZone.Appearance.Border.Width = 3;


Best regards,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dhanushka Athukorala
Top achievements
Rank 2
answered on 19 Nov 2009, 06:07 AM
Thanx for the reply and all is well for now, but a small problem persists how can i set the label for the marked zone out side the chart as seen on the picture.
i tried to use the following line but the whole plot area goes blank when i do that
customMarkedZone.Label.TextBlock.Text = "Average is 15000"
why is that?
Thanx again


0
Vladimir Milev
Telerik team
answered on 24 Nov 2009, 08:33 AM
Hello Dhanushka,

We tested it locally and were unable to reproduce the issue reported. However, unfortunately, we are also unable to offer you a work-around to achieve the custom label positioning as desired in the screen shot attached.

We sincerely apologize for this inconvenience.

Best regards,
Vladimir Milev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Dhanushka Athukorala
Top achievements
Rank 2
Answers by
Ves
Telerik team
Dhanushka Athukorala
Top achievements
Rank 2
Vladimir Milev
Telerik team
Share this question
or