- 如何用 1 个图表系列绘制下面的图表,它可以表示多个未连接的,如果可能的话,不是连续的(在 X 轴上)线?
user791888
问问题
40 次
1 回答
1
var sprite:Sprite = new Sprite();
drawChart([ [0,50], [70, 100], [120, 190] ], sprite);
private function drawChart(data:Array, sprite:Sprite):void {
var grachics:Graphics = sprite.graphics;
grachics.beginFill(0xffff00);
for (var i:int = 0; i < data.length; i++) {
var obj:Array = data[i] as Array;
var startX:int = obj[0];
var endX:int = obj[1];
grachics.drawRect(startX, 0, endX - startX, 30);
}
graphics.endFill();
}
于 2013-06-18T12:36:37.683 回答