How to Create Flash Charts Software

Adobe Flash Professional software allows you to develop flash chart software. With the Flash program you can create charts software that can be used to create all types of charts, like pie charts, line charts and bar charts.



The most basic type of chart, the line chart, requires that you know how to use the Flash ActionScript moveTo and lineTo methods. The moveTo and lineTo methods, part of the the ActionScript graphics class, can be used to draw a line based on the x and y coordinates of the line's endpoints.

Things You'll Need

  • Adobe Flash Professional: CS3, CS4 or CS5 versions
Show More

Instructions

    • 1
      Setup your Flash workspace.

      Start Adobe Flash. Select "Flash" (ActionScript 3.0) below the "Create New" category. Select "Window," then "Workspace," then "Designer" from the main menu. Open up the Action editor. Select "Window," then "Action"

    • 2
      Create or obtain data for a line chart.

      Create a graphic shape object and name it "lineChart." Assign the line properties with the lineStyle method of the graphics class. Assign a line width of 1 pixel, a color of black(9) and opaque(1). Use the moveTo method to make the point (0,0) the first point on the graph.

      var lineChart:Shape = new Shape() // Create the line chart shape instance

      lineChart.graphics.lineStyle(1, 0, 1) ; // Set the line style properties

      lineChart.graphics.moveTo(0,0);

    • 3
      Code the chart data.

      Assign an array to contain the x-coordinates and an array to contain the y-coordinates

      var xpoint:Array = new Array(0, 10, 20, 30, 40, 50); //create the xpoint data array

      var ypoint:Array = new Array(3, 40, 140, 180, 200, 300); //create the ypoint data array

    • 4
      Add the drawing code.

      Use a "for loop" to read in the data in the xpoint and ypoint arrays. A "for loop" allows code to be repeatedly executed. Use the lineTo method of the graphics class to draw the lines of the chart.

      for (var i:int = 0; i < xpoint.length ; i ++)

      {

      lineChart.graphics.lineTo(xpoint[i], ypoint[i])

      };

      Place the chart on the stage. Use the addChild method.

      addChild (lineChart);

Learnify Hub © www.0685.com All Rights Reserved