3 Attachment(s)
Ext.draw.Sprit to draw a horizontal line
Hi
I have a problem to draw a horizontal line use extjs 4。
My code
Code:
//addCircle is function ,use to draw a circle,it work normally
//the arguments panel ,you can regard as a window,and x,y is coordinate
addCircle : function(panel,x,y){
var circle = new Ext.draw.Component({
width: 100,
height: 100,
x : x-200,
y : y-10,
draggable : true,
resizable: {
dynamic: !Ext.isIE,
pinned: false,
preserveRatio : true,
handles: 'all'
},
items: [{
type: 'circle',
fill: '#79BB3F',
radius: 50,
x: 50,
y: 50
}]
});
panel.add(circle);
},
//addLine is function ,use to draw a line,it work bad
addLine : function(panel,x,y){
var line = new Ext.draw.Component({
width : 100,
height : 100,
x : x-200,
y : y -10,
draggable : true,
resizable: {
dynamic: !Ext.isIE,
pinned: true,
preserveRatio : true,
handles: 'all'
},
items : [{
type: 'path',
stroke : 'blue',
fill:'darkblue',
'storke-width' : "4",
path : 'M 10 20 H 90 '
}]
});
panel.add(line);
}
I want to draw a horizontal line.
I use svg test ,you can use the url test
http://www.w3schools.com/svg/tryit.asp?filename=trysvg_path
and you can write the under code
HTML Code:
<!DOCTYPE html>
<html>
<body>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path d=" M 10,20 H 90" stroke="blue" fill="darkblue" stroke-width="4" />
</svg>
</body>
</html>
then we can see a horizontal line
Attachment 36412
so , in my extjs code I use the path and write
Code:
path : 'M 10 20 H 90 '
but it can not work.It has no js error,but has no line to display.
Attachment 36414
so , I use firebug to see the html ,
Attachment 36415
but,when i look the html,i think the code is same the above svg code.
I don't know why it can not work.
Thank you very much.