views:

339

answers:

2

I'm attempting to draw a background to a chart. If I try to call

canvas.beginFill(0xff0000,1)
canvas.drawEllipse(10,200,300,-30);
canvas.endFill()

And -30 is outside the range of the chart, it won't draw anything. I want it to draw an ellipse that is cut off by the edge of the chart.

A: 

Isn't it just that width/height can't be negative ? So you would just have to offset X by -30 (-20) and leave the width at 30 ?

Theo.T
A: 

You can't draw with negative size values, I guess you've mixed up the order of the arguments somehow. This is the proper order:

public function drawEllipse(x:Number, y:Number, width:Number, height:Number):void

Read more in the docs.

grapefrukt
The problem is that the drawEllipse method in CartesianDataCanvas doesn't take x, y, width, height, but rather: public function drawEllipse(left:*, top:*, right:*, bottom:*):void See http://livedocs.adobe.com/flex/3/langref/mx/charts/chartClasses/CartesianDataCanvas.html#drawEllipse%28%29
Joe Arasin
ah, i was assuming you were using drawing to a regular Graphics. Maybe you can do that instead?
grapefrukt
Yes and no, I've been using that lately, but that issues if the chart is resized - basically you need to trigger a redraw.
Joe Arasin