PDA

View Full Version : [CLOSED] How to draw a custom line (solid, dotted) on chart at specific position?



PriceRightHTML5team
Apr 03, 2014, 5:11 AM
I want to draw custom solid and dotted lines on chart at specified position from C# code, can anyone tell me how to do this?

Daniil
Apr 03, 2014, 8:10 PM
Hi @PriceRightHTML5team,

This way:

<ext:Chart>
<Items>
<ext:Sprite ... />
</Items>
</ext:Chart>

PriceRightHTML5team
Apr 04, 2014, 10:47 AM
Hi @PriceRightHTML5team,

This way:

<ext:Chart>
<Items>
<ext:Sprite ... />
</Items>
</ext:Chart>

Hi @Daniil,

I tried with following code:


var line=new Sprite { Type = SpriteType.Path, X = 100, Y = 100, Path = "M0.5,0.5L16.5,0.5", ZIndex = 7000, Stroke = "#000", StrokeWidth = 1 }


Added above sprite to Items collection of Chart, but it shows line at 0,0 position, not at 100,100 as specified.

Daniil
Apr 04, 2014, 4:37 PM
It appears that a path SVN element doesn't support x, y.

You should change the Path to:

"M100.5,100.5L116.5,100.5"

PriceRightHTML5team
Apr 07, 2014, 6:30 AM
It appears that a path SVN element doesn't support x, y.

You should change the Path to:

"M100.5,100.5L116.5,100.5"

Thanks @Daniil.

It worked. Please close the thread.