Installing components

To use SWC files in your Flex projects, you should add them to the project's library path.

  1. With a project selected in the Flex Navigator view, select Project > Properties > Flex Build Path.
  2. Click on the Library Path tab.
  3. Click on the Add Swc button.
  4. Browse to and select the amChartsFB3.swc file if you work with Flex Builder 3. Select amChartsFB4.swc if you work with Flash Builder 4.
  5. Click OK
  6. The component is now added. You should see amCharts folder in the components window (only available when you are in design mode).
Visit Flex documentation for more options on installing components.

AmCharts Class Reference

Compiling swc file


Examples

BalloonWithRoundedCornersFlex 3 MXMLFlex 4 MXML
BarsWithGradientFillsFlex 3 MXMLFlex 4 MXML
BubbleChartFlex 3 MXMLFlex 4 MXML
BullsEyeChartFlex 3 MXMLFlex 4 MXML
CandlestickAndOHLCFlex 3 MXMLFlex 4 MXML
ChartWithLegendFlex 3 MXMLFlex 4 MXML
ChartWithMultipleValueAxesFlex 3 MXMLFlex 4 MXML
CustomBulletsFlex 3 MXMLFlex 4 MXML
DataBindingFlex 3 MXMLFlex 3 MXML
DateBasedCategoryAxisFlex 3 MXMLFlex 4 MXML
GuidesAsAreasFlex 3 MXMLFlex 4 MXML
NegativeColorsFlex 3 MXMLFlex 4 MXML
PolarChartFlex 3 MXMLFlex 4 MXML
RadarChartFlex 3 MXMLFlex 4 MXML
RegularCategoryAxisFlex 3 MXMLFlex 4 MXML
RotatedAxisLabelsFlex 3 MXMLFlex 4 MXML
ScatterChartFlex 3 MXMLFlex 4 MXML
ScrollableAndZoomableChartFlex 3 MXMLFlex 4 MXML
SimplePieChartFlex 3 MXMLFlex 4 MXML
Stacked3DColumnChartFlex 3 MXMLFlex 4 MXML
StackedAreaChartFlex 3 MXMLFlex 4 MXML
StackedBarChartFlex 3 MXMLFlex 4 MXML
StackedColumnChartFlex 3 MXMLFlex 4 MXML

Change log

1.8.3.3

Minor bug fixes

1.8.3.2

Minor bug fixes

1.8.3.1

Fix: when minPeriod was set to "MM" (month), last month sometimes wasn't shown.

1.8.3.0

clipLabels property added to AmPieChart. If true, the size of a pie won't be adjusted if some labels won't fit to the chart container, labels will be clipped. Default value is false.

ignoreOpenValue property added to AmGraph. If you set openField for the "line" or "step" graph types, but don't want the graph to draw the open values, set it to false. Default value is false.

minBulletSize property added to AmGraph. Might be used by XY chart only.

graph property added to GraphDataItem. indicates graph to which this item belongs.

valueFunction property added to AmLegend. This function will be called on every update of value field of every legend item and will pass value field string. This function should return another string which will be displayed in the legend.

some minor bugs fixed.

1.8.2.0

combineSeries property added to AmGraph. Set it to true if you have a separate data provider for a graph and your data has series which are not included in the main data provider and you want the chart to combine series from both data providers.

If graph type is "line" or "step", you can set "openField" for this graph too. You will be able to create "range" graphs (filled area from open to close values).

1.8.1.2

Problem with balloon/label height with new version of Chrome fixed.

1.8.1.1

A problem with pie chart and legend fixed.

1.8.1.0

firstDayOfWeek property added to CategoryAxis. Default value is 1. If your week starts on Sunday, set this value to 0.

If you have a rotated serial chart (bar chart), you can set ignoreAxisWidth and wrapLabels properties of CategoryAxis to true - labels will be wrapped then.

FIX: pie chart now occupies all available space after data is updated (this problem appeared only in some occasional situations).

FIX: design mode in FB4 fixed.

Some other minor problems fixed.

1.8.0.1

Some issues with event positioning fixed.

Some issues with axis value on chart cursor fixed.

1.8.0.0

Axes of Serial and XY charts can display titles. The following properties were added for this purpose to the AxisBase class: title, titleAlignment, titleTextSize and titleTextColor. Note, in order vertical axis to display the title, you need to embed fonts. Check RotatedAxisLabels example to see how this is done.

ChartCursor can display value next to value Axis - check NegativeColors example to see this in action. showValueAxisValue boolean property was added to enable this. If you have more than one axis and wand to show value next to some specific axis, use showValueOfAxis property and pass ValueAxis to it. valueAxisBalloonAlpha, valueAxisBalloonTextColor and valueAxisBalloonColor properties allows you to style the balloon.

FIX: pie chart labels used to go outside the container and became invisible when a lot of small slices were on top or in the bottom of the pie.

FIX: when parseDates and equalSpacing properties of CategoryAxis were set to true, labels of Category axis could overlap in some situations.

1.7.2.2

Some issues with min/max calculation when logarithmic scale was used fixed.

1.7.2.1

FIX: design mode in Flash Builder 4.5 used to break with our component.

1.7.2.0

wrapLabels property added to CategoryAxis. Works with horizontal axis only (when chart is not rotated), also only when parseDates is set to false. Default value is false. If true, labels of category axis will be wrapped in order to fit them to the cell width.

maxColumnWidth style added to AmSerialChart. Sets maximum width of columns.

precision property added to ValueAxis. Sets minimum number of decimals which should be displayed near axis' values.

showBulletAt property added to AmGraph. Specifies at which value (open/close/high/low) bullet should be shown. Valid only for candlestick and ohlc graphs.

1.7.1.0

ChartCursor can display horizontal (or vertical, if chart is rotated) line now. Set crosshair property to true to enable this feature.

1.7.0.0

AutoMargins
Since v 1.7.0.0 our flex charting components has a long awaited feature - automatic calculation of margins. This means you no longer need to worry that axes labels might not fit into the available space.

autoMargins property was added to AmRectangularChart class, with default value set to true. This means that if you update swc file with a new one, the look of your charts might change! If you want to keep things old-style, set this property to false.

If autoMargins is set to true, then margins where axes (value or category) will be adjusted for the values to fit. Other margins won't be changed. Margins also won't be changed if values are inside plot area (inside is set to "true" for the axis). You can even tell the chart to ignore one or another axis when calculating margins. Set ignoreAxisWidth to true for this axis (it's a property of AxisBase).

When margins are updated, chart dispatches marginsUpdated event (AmChartEvent). This means you can monitor when margins changed and adjust some other layout you need.

Background color and opacity for axis labels
labelBackgroundColor and labelBackgroundAlpha styles added to AxisBase class. As you guessed, they allow to display a rectangle below axis labels. It might be useful when labels are inside plot area.

Maximum length of axis label
maxLabelLength property added to AxisBase class. Most likely you'll use it with category axis. If your category values are long and you want to truncate them, set maxLabelLength to 10 or so. Balloon with full label will be displayed on mouse over.

filter for bullet or column
filter property added to GraphDataItem Class. You can set BitMapFilter for individual column/bullet using this property.

Find out how many data points a graph has
A new property, dataPointCount was added to AmGraph class. It will return a number of data points this graph has.

Fly-in direction
startFrom style added to AmCoordinateChart with possible values "top", "bottom", "left" and "right". It specifies where from the graphs will fly-in. This affects line, smoothed line and step graphs only.

Private to Protected
We changed most of properties and methods from private to protected. If you have sources of our components this will allow extending our components more easily.

1.6.2.0

A possibility to display trend lines added. AmRectangular chart has new property "trendLines" and methods "addTrendLine" and "removeTrendLine" for adding/removing them. TrendLine class added.

1.6.1.0

A possibility to use prefixes for big and small number added. For example, instead of 1000 you can show 1k, instead of 2000000 - 2M, instead of 0.000001 - 1μ, etc. This works for value axes and for legend. To enable this feature, you should set usePrefixes="true" on the chart, or explicitly on the valueAxis. You can also control prefixes. Two properties, prefixesOfBigNumbers and prefixesOfSmallNumbers added. Default value of prefixesOfBigNumbers is:

[{number:1e+3,prefix:"k"},{number:1e+6,prefix:"M"},{number:1e+9,prefix:"G"},{number:1e+12,prefix:"T"},{number:1e+15,prefix:"P"},{number:1e+18,prefix:"E"},{number:1e+21,prefix:"Z"},{number:1e+24,prefix:"Y"}]

Default value of prefixesOfSmallNumbers is:

[{number:1e-24, prefix:"y"},{number:1e-21, prefix:"z"},{number:1e-18, prefix:"a"},{number:1e-15, prefix:"f"},{number:1e-12, prefix:"p"},{number:1e-9, prefix:"n"},{number:1e-6, prefix:"?"},{number:1e-3, prefix:"m"}]

You can change them if you want. For example, if you don't want 1000 to be replaced with 1k, delete first object from default value of prefixesOfBigNumbers array.

a new property, gridPosition with optional values start and middle added to CategoryAxis. It works only if you do not parseDates. Default value is middle. Set it to start if you want grid lines to be placed in the beginning of a cell.

Min/max calculation algorithm when axis uses logarithmic scale improved. We optimized it and we think it's perfect now. Or close to.

Scrollbars category axis will use the same date format as main category axis of a chart. We also added a possibility to get categoryAxis of a scrollbar.

When graph.connect was set to false, radar chart still drawn a line to the center of the radar, this is fixed now.

1.6.0.0

This is important update!

Some changes which might affect previous behavior were made in this version, read the following carefully.

AmCharts Bundle (FB4 build) now can be used with HERO SDK. This means you can build mobile applications with amCharts for Android and iPhone now. To accomplish this we had to get rid of classes, not supported by HERO SDK. We made changes both in FB3 and FB4 build so that it would be easier to maintain and document. This also made our components much lighter and a bit faster. Below listed changes which might have influence to your applications with previous versions of amCharts.

AmLegend Class no longer extends Canvas, it extends UIComponent instead. This means that AmLegend doesn't support styles/properties/methods specific to Canvas anymore. It still has styles backgroundColor, backgroundAlpha, borderColor and borderAlpha. This change might cause error on your application if you used Canvas specific styles or properties. If you need them anyway, you can always put our legend into Canvas container.

We no longer use LinkButton for zoomOutButton (property of AmRectangularChart). This property can accept any object. This means, if you used LinkButton before and still want to use it, you can do this and the chart will work fine. We build our own AmSimpleButton class and use it for this button. You can also use it if you want to customize it a bit. We also added zoomOutText property to AmRectangularChart, so that you wouldn't need to create an instance of a button if you just want to change the text of the button.

New features in this version:

dateToCoordinate(date) method was added to CategoryAxis. It allows finding x (or y if the chart is rotated) coordinate of the date. Zero coordinate is at the beginning of the axis, so you might need to add marginLeft to get right position.

categoryToCoordinate(category) method was added to CategoryAxis. It does the same as dateToCoordinate method only is made when parseDates is false.

showBullet style added to AmBalloon class. When cornerRadius style of a balloon is >0, small round bullet is shown near the balloon. If you don't want this bullet, set this style to false.

"down" option added to pointerOrientation style of AmBalloon. Use it when building applications for touch screen devices.

selectWithoutZooming property added to ChartCursor. If you set it to true, then you will be able to mark some chart's area and the chart won't zoom in. zoomable property should still be set to true in order this to work.

columnsAboveLines property added to AmSerialChart. It allows specify whether column graphs should be in front of or behind the line/area graphs. By default columns are behind lines.

Bug fixes:

There was no way to change legend's data provider at runtime.

1.5.5.0

amChartsFB4.swc can now be used with Flash Builder Buritto in your mobile applications for Android.

1.5.4.1

Some minor bugs fixed

1.5.4.0

mouseWheelStep property added to ChartScrollbar. By default, if scrolling with mouse wheel is enabled, the scrollbar moves by one minPeriod when mouse wheel is turned. If you want to change this you can set mouseWheelStep here (in milliseconds).

useScientificNotation property added to ValueAxis. If true, values will always be formatted using scientific notation (5e8, 5e-8...). Otherwise only values bigger then 1e21 and smaller then 1e-7 will be displayed in scientific notation

Some minor bugs fixed

1.5.3.0

maxSelectedSeries and maxSelectedTime properties added to AmSerialChart. Allows limiting the selected number of series or period.

1.5.2.0

milliseconds in category balloon can be displayed (use fff String, for example: chartCursor.categoryBalloonDateFormat="JJ:MM:SS.fff").

lineThickness of graph will also affect high and low lines of Candlesticks.

showBalloonAt property added to AmGraph. In case your graph's type is candlestick or OHLC, you can set where value balloon should appear. Default value is "close", other options are "open", "high" and "low".

clipContent property added to AmChart. If you set it to false, the contents which can go outside chart area will still be visible (but may overlap other contents of the page).

autoTruncate property added to CategoryAxis. If you set it to true, long category names will be truncated (if they don't fit). Works with only when category axis is horizontal and parseDates is false.

Some other minor bugs fixed.

1.5.0.1

Some minor bugs fixed.

1.5.0.0

bulletsEnabled property added to ChartCursor class, with default value "false". If it is set to "true", round bullets will follow chart cursor for each graph. In case you'd like to disable such a bullet for a specific graph, set cursorBulletAlpha style of AmGraph to 0. You can change size of tracking bullets using bulletSize property of ChartCursor class.

negativeValueColor and positiveValueColor styles added to AmLegend class. These styles allow having different value colors in your legend. In case you want these styles to be applied only when the graph values are recalculated to percents, set usePositiveNegativeOnPercentsOnly property of AmLegend to true.

useMarkerColorForLabels property added to AmLegend class, with default value "false". If it is set to "true", legend item text will use the same color as a marker.

showAllValueLabels property added to AmGraph with default value "false". If graph's type is column and labelText is set, graph hides labels which do not fit into the column's space. If you don't want these labels to be hidden, set this to true.

1.4.9.4

ChartCursor uses less CPU now.

1.4.9.3

Some minor problems fixed.

1.4.9.2

Some minor problems fixed.

1.4.9.1

FIX: A problem when recalculateToPercents was set to true and some data was missing fixed.

1.4.9.0

FEATURE: baseValue property added to ValueAxis. It allows setting base value of the axis other then 0.

FEATURE: in case dates are parsed, [[category]] in value balloons is formatted using date format of CategoryAxis.

FEATURE: numberFormatter property added to AmGraph. This allows having different number formatters for different graphs. Useful when using multiple value axes and values of the graphs differ a lot. In case numberFormatter is not defined, graph will use chart's numberFormatter.

FEATURE: updateOnReleaseOnly property added to ChartScrollbar. Specifies if the chart should be updated while dragging/resizing the scrollbar or only at the moment when user releases mouse button. Useful when working with large data sets.

1.4.8.3

zoomOutOnDataUpdate property added to AmSerialChart. Default value is true. If you don't want the chart to zoom-out after chart data was updated, set this to false.

FIX: groupPercent style of pie chart worked incorrectly if the style value was changed after the chart is rendered.

1.4.8.2

FIX: XY chart wasn't working properly with multiple X or Y axes.

1.4.8.1

FIX: colums were not removed if the last graph was removed with removeGraph or removeValueAxis method.

FIX: design mode in FB4 failed to render the chart if custom startEffect was set.

FIX: negativeLineColor was ignoring black (0x000000) color.

1.4.8.0

FEATURE: valueClickHandler property added to AxisBase. If you set some method for this property, it will be called when user clicks on the axis value.

FEATURE: valueRollOverColor style added to AxisBase. If valueClickHandler is not null, the label will change color when user rolls-over it.

FIX: Rounding of decimals in the Legend fixed.

1.4.7.5

negativeFillAlphas style added to AmGraph.

1.4.7.4

Some minor problems fixed.

1.4.7.3

Some minor problems fixed.

1.4.7.2

FIX: A problem with stacked values and stacked value axis fixed.

1.4.7.1

FEATURE: bulletSprite and columnSprite properties added to GraphDataItem. This allows accessing sprites of bullets and columns - you can easily change color when user clicks on a bullet now.

FIX: Custom bullets of bubble chart were not changing size in case value of the data point was specified.

FIX: Chart cursor wasn't changed to default on roll-out from the scrollbar (only if hideResizeGrips was set to false).

FIX: Balloon is not shown if there is no text to display.

1.4.7.0

FIX: bug with columns fixed - sometimes columns of previously selected range were displayed.

doubleClickGraphItem event added to AmCoordinateChart class.

1.4.7.0

FIX: bug with columns fixed - sometimes columns of previously selected range were displayed.

doubleClickGraphItem event added to AmCoordinateChart class.

1.4.6.2

Some minor problems fixed.

1.4.6.1

Some minor problems fixed.

1.4.6.0

Feature: autoGridCount style added to AxisBase and ChartScrollbar. In case it is true, the axis chooses number of grid lines automatically. Default value is false.

hideResizeGrips style added to ChartScrollbar. If false, the resize grips won't be hidden when mouse is away from the scrollbar.

1.4.5.0

Feature: ChartScrollbar can display vertical grid and labels, like in this example. The following styles were added to controll this: gridCount, gridColor and gridAlpha. Use default text styles to adjust text color/size/etc.

Fix: Scrollbars graph could go out of the bounds when hiding chart graphs.

1.4.4.1

LivePreview in design mode fixed (Flash Builder 4).

1.4.4.0

Feature: coordinateToDate method added to CategoryAxis. It works properly only if parseDates is true and equalSpacing is false. Example: myCategoryAxis.coordinateToDate(myCategoryAxis.mouseX);

Feature: adjustBorderColor style added to AmBalloon. If it is set to true, border color instead of background color will be changed when user rolls-over the slice, graph, etc. Note, default value of borderAlpha style is 0, so the border is invisible. You have to set it to 1 or some other value to see this working.

Feature: removeChartCursor and removeChartScrollbar methods added to AmRectangularChart (base class of AmSerialChart and AmXYChart).

Fix: round-off problems fixed.

Fix: changing of graph styles didn't affect legend marker.

1.4.3.3

Graph visibility can be changed by setting graph.hidden = true / false;

Problem with numbers with very small decimal values fixed.

1.4.3.2

Feature: ChartCursor has a new property - pan. If you set it to true, you'll be able to pan the chart (if it is zoomed), instead of zooming. This feature works with SerialChart only.

Fix: Styles were not working with XY chart's scrollbar.

Fix: ZoomToValues (Value axis, XY chart) wasn't working properly if called when the axis was already zoomed-in.

1.4.3.1

logarithmicAxisFailed event added to ValueAxis. It is dispatched when axis is logarithmic and values less or equal to zero were found in the data.

Default Date format changed so that 00:00 instead of 24:00 would be displayed.

1.4.3.0

Feature: equalSpacing property added to CategoryAxis. In case your category axis values are Date objects and parseDates is set to true, the chart will parse dates and will place your data points at irregular intervals. However if you want dates to be parsed (displayed on the axis, baloons, etc), but data points to be placed at equal intervals (omiting dates with no data), set equalSpacing to true.

Feature: axisTitleOffset style allows you to set a distance from the end of the Radar axis to the axis label.

Fix: Balloon overlapping problem solved.

Some other minor bugs fixed.

1.4.2.1

Some minor bugs fixed.

1.4.2.0

Feature: coordinateToValue(coordinate) method added to ValueAxis. Converts coordinate (pixels) to value.

Feature: recalculateToPercents property added to valueAxis. If you set it to true, values will be recalculated to percents, using first selected data items value as base value. To show percent values in balloons or legend, use [[percents.value]], [[percents.close]] tags.

Feature: graphs can have a different dataProviders from main chart's data provider. Note, only categories available in chart's dataProvider will be visible.

Feature: invalidateData() method added to AmChart.

Feature: zoomToValues(startValue, endValue) method added to ValueAxis. It can only be used with XY chart.

Feature: When zooming XY chart, value axes dispatch axisZoomed event, with startValue and endValue properties.

Some minor bugs fixed.

1.4.1.1

Some minor bugs fixed.

1.4.1.0

Feature: visibleInLegend property added to AmGraph and visibleInLegendField added to AmPieChart. This allows to remove individual items from the legend.

Feature: ChartCursor has new events properties and methods which allows you to synchronize cursors of different charts.

Feature: zoom methods, such as zoomToDates, zoomToIndexes, zoomToCategoryValues can be called right after new dataProvider is set or data is changed, you don't need to listen for dataUpdated event anymore.

Fix: dataUpdated event is dispatched when data inside dataProvider was changed, not only when a new dataProvider is set.

Change: when data is changed or new dataProvider is set, Serial chart zooms out so all the data would be visible.

Change: AmLegend component extends Canvas now (previously UIComponent).

Some other minor bugs fixed.

1.4.0.4

Some minor bugs fixed.

1.4.0.3

First official release, Flex components are not in beta stage anymore.

1.4.0.0 beta

XY (or Scatter/Bubble) and Radar (Polar) charts were added.

Upgrading from previous version

The new chart types caused some changes in the structure, so there will be several things you'll need to do when migrating from previous versions. We are sorry for this inconvenience but we feel it is the absolutely necessary change for the sake of consistency in all future versions.
  1. AmCartesianChart class renamed to AmSerialChart - simply change the name in your applications.
  2. "cartesian" folder with classes like AmGraph, ChartScrollbar, ChartCursor changed to "chartClasses" - if you import one of these classes in your Actionscript, you should change the path to the class.
  3. AmChart, AmBalloon, AmLegend classes were moved from com.amcharts to com.amcharts.chartClasses. Change the paths to these classes too.
  4. Even if you do not use these classes in your ActionScript, but only mxml, Flex builder can cache the old paths to these classes and show errors when compiling application. The most easy way to solve this is to remove all your amChart objects from the application, save it and bring it back exactly as it was. Now the application should compile properly.
  5. CartesianChartEvent is renamed to SerialChartEvent.
  6. PieChartEvent and SerialChartEvent (previously CartesianChartEvent) do not have dataUpdated event type anymore. dataUpdated event is now AmChartEvent's type.

1.3.2.0 beta

amCharts Flex components now work with Flash builder 4 (aka Gumbo). A separate swc file, amChartsFB4.swc was added.

Important change! Because of naming conflict which appeared with Flash Builder 4 only, style "depth" was changed to "depth3D", both for FB3 and FB4 versions.

Balloon, pie chart labels can display any field from your data provider.

1.3.1.1 beta

New style of AmPieChart: adjustLabelWidth - specifies whether the component should measure maximum width of a label and use it as labelWidth. In case the actual maximum label width is smaller then labelWidth value, the component will use actual maximum label width. This will help to avoid large empty spaces around the chart. However if you want all your pies in equal size containers to have the same radius, set this to false. Default value is "true".

1.3.1.0 beta

New Property of ChartCursor: cursorPosition - specifies where the cursor line should be placed - on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true). If you want the cursor to follow the mouse and not to glue to the nearest data point, set cursorPosition="mouse".

New Styles of ChartCursor: categoryBalloonColor and categoryBalloonAlpha

New Property of AmGraph: pointPosition - specifies where data points should be placed - on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true).

New Property of AmGraph: fillColorsField - name of the fill colors field in your dataProvider. Using this field you can fill individual columns or candlesticks with custom color gradients.

New Style of AmGraph: balloonColor

customBullet property of AmGraph can accept both Class and path to file name now. This means you can load custom bullets, not only embed them.

1.3.0.0 beta

Candlestick and OHLC graph types were added. Check CandlestickAndOHLC example.

negativeLineColor and negativeFillColors styles added to AmGraph. These styles allow coloring negative part of line graph or negative columns with different color. Check NegativeColors example to see this in action.

Charts can be scrolled and zoomed with mouse wheel. Press CTRL while rotating wheel to zoom-in. Note, the chart must have focus for this feature to work (you should click anywhere on the chart to receive focus). Check ScrollableAndZoomableChart example.

1.2.0.0 beta

Cartesian charts now support rotated axis values

Columns can have rounded corners

Custom bullets can be used

1.1.0.0 beta

Cartesian charts now support guides - both vertical and horizontal

Bug with date-based category axis fixed

Some minor bugs fixed