# Need help with a simple api drawn bar graph

**URL:** <https://forum.kirupa.com/t/need-help-with-a-simple-api-drawn-bar-graph/255196>\
**Category:** Uncategorized\
**Created:** [March 19, 2008, 10:59pm UTC](https://forum.kirupa.com/t/need-help-with-a-simple-api-drawn-bar-graph/255196 "2008-03-19T22:59:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![janjan32](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/janjan32/32/2578_2.png) [@janjan32](https://forum.kirupa.com/u/janjan32)\
**Post date:** [March 19, 2008, 10:59pm UTC](https://forum.kirupa.com/t/need-help-with-a-simple-api-drawn-bar-graph/255196/1 "2008-03-19T22:59:36Z")

</div>

I am trying to draw a simple bar chart for our interactive annual, and I thought i would try to learn how to use the api drawing tools, but I can’t seem to get it to draw more than one line successfully.  
below is what I was using for one, but how do I tell it to draw more lines that are different colors? I attached a screen shot of what I want it to look like.  
thanks!

```auto

this.createEmptyMovieClip("line1a_mc", 10);
line1a_mc._x = 10;
line1a_mc._y = 100;
drawRectangle(line1a_mc, 25, 180, 0xbcdeef, 100);
function drawRectangle(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, fillColor:Number, fillAlpha:Number):Void {
    with (target_mc) {
        beginFill(fillColor, fillAlpha);
        moveTo(0, 0);
        lineTo(boxWidth, 0);
        lineTo(boxWidth, boxHeight);
        lineTo(0, boxHeight);
        lineTo(0, 0);
    }
}

```
