hi,
how can I assign the stroke to my LineSeries, programmatically in Actionscript ?
<mx:LineSeries stroke="{new Stroke(0xCC33CC, 2)}" />
How is it in Actionscript ?
LineSeries.stroke doesn't exist
thanks
hi,
how can I assign the stroke to my LineSeries, programmatically in Actionscript ?
<mx:LineSeries stroke="{new Stroke(0xCC33CC, 2)}" />
How is it in Actionscript ?
LineSeries.stroke doesn't exist
thanks
It would be something like this:
var s:Sprite = new Sprite();
s.graphics.lineStyle(2, 0xCC33CC); // define your line style
s.graphics.moveTo(new Point(whatever, whatever)); // move to origin
s.graphics.lineTo(new Point(whatever2, whatever2)); // draw line to target
s.graphics.lineStyle(); // this just clears the linestyle.
Look into the Graphics class for more information.
The lineStroke "property" of a charting series, such as LineSeries is not actually a property but a style, therefore it needs to be set via either mxml, css, or a call to setStyle. So you could potentially call from actionscript:
myLineSeries.setStyle("lineStroke", myStroke);
However, it's best to limit your calls to setStyle() as it's an expensive call, so I'd try to use css or mxml if at all possible.