You can use a LineChart component wherever you need to display data for users.
You can set the following authoring parameters for each LineChart component instance in the Property inspector or in the Component inspector:
__numberPrefix specifies the prefix to be added to all labels.
For example, if the chart represents dollars, you would set the __numberPrefix
to be $
. This value is a string. The default values is empty.
__numberPostfix specifies the postfix to be added to all
labels. For example, if the chart represents thousands, you would
set the __numberPrefix to be K
. This value is a string. The
default values is empty.
__zeroBase indicates whether the chart starts at zero (true
)
or not (false
). If you set the value to false
, then the chart
will start at the lowest plot value. The default value is true
.
You can write ActionScript to control these and additional options for the LineChart component using its properties and methods. For more information, see LineChart class.
The following procedure explains how to create an example chart, and add two lines to it.
X
parameter to 75
. Y
parameter to 50
. $
.
// Specify points demo_chart.points = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
// Plot lines demo_chart.plotLine({Sunday:12, Monday:5, Tuesday:15, Wednesday:10, Thursday:18, Friday:30, Saturday:25}, "Assets"); demo_chart.plotLine({Sunday:10, Monday:5, Tuesday:15, Wednesday:10, Thursday:20, Friday:30, Saturday:25}, "Liabilities"); demo_chart.plotLine({Sunday:8, Monday:7, Tuesday:10, Wednesday:1, Thursday:4, Friday:29, Saturday:24}, "Captital");
This code creates a chart and plots values for Assets, Liabilities, and Capital.
demo_chart.removeLines();