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

Is it possible to add a short custom grid line to a graph?

3 Answers 67 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 28 Jul 2011, 09:32 PM
I have a line graph and I would like to put a small tick mark that is perpendicular to the actual data line.  Is this possibe?  I don't want the line to go all the way across the chart, just like a 20 pixel line on the chart.

Tks.

3 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 02 Aug 2011, 02:16 PM
Hello Brian,

In your case you need to use custom line, not custom grid line. You can find more information about it in the following help topic: Custom Line.

I hope this helps.

Kind regards,
Sia
the Telerik team

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

0
Brian
Top achievements
Rank 1
answered on 02 Aug 2011, 03:40 PM
That's the control I was looking for, but all I'm trying to do is make a line go from one X/Y point to another X/Y point but can't seem to get it to work. 

For example, I want a line to go from (X=5, Y=5)  to (X=15, Y=5).  I'm assuming my slope = 0 and my YIntercept = 5.  Using the  y = mx + b equation, these numbers should work out:

5 = 0 * 5 + 5
5 = 0 * 15 + 5

However, my line never shows up.  What am I doing wrong?

Also, what do 'ElementX1', 'ElementY2', etc do?

Tks.
0
Sia
Telerik team
answered on 04 Aug 2011, 04:11 PM
Hello Brian,

I understand your confusion. I will forward this to the responsible people, so we can extend the mentioned help topic with the bordeline cases - custom lines parallel to one of the two axes.

In your case you need to add Custom Line with Slope = Infinity and to specify the MinY and MaxY properties in order to get it clipped properly. For example:
<telerik:ChartArea.Annotations>
    <telerik:CustomLine Stroke="Red"  Slope="Infinity" XIntercept="2"  MinY="100"   MaxY="200" />
</telerik:ChartArea.Annotations>

Regards,
Sia
the Telerik team

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

Tags
Chart
Asked by
Brian
Top achievements
Rank 1
Answers by
Sia
Telerik team
Brian
Top achievements
Rank 1
Share this question
or