📄 cartesianchart.as
字号:
package com.yahoo.astra.fl.charts{ import com.yahoo.astra.fl.charts.axes.AxisOrientation; import com.yahoo.astra.fl.charts.axes.CategoryAxis; import com.yahoo.astra.fl.charts.axes.DefaultAxisRenderer; import com.yahoo.astra.fl.charts.axes.DefaultGridLinesRenderer; import com.yahoo.astra.fl.charts.axes.IAxis; import com.yahoo.astra.fl.charts.axes.ICartesianAxisRenderer; import com.yahoo.astra.fl.charts.axes.IGridLinesRenderer; import com.yahoo.astra.fl.charts.axes.IStackingAxis; import com.yahoo.astra.fl.charts.axes.NumericAxis; import com.yahoo.astra.fl.charts.axes.TimeAxis; import com.yahoo.astra.fl.charts.series.CartesianSeries; import com.yahoo.astra.fl.charts.series.ISeries; import com.yahoo.astra.fl.charts.series.IStackedSeries; import com.yahoo.astra.fl.utils.UIComponentUtil; import fl.core.InvalidationType; import fl.core.UIComponent; import flash.display.DisplayObject; import flash.display.Sprite; import flash.geom.Point; import flash.geom.Rectangle; import flash.text.TextFormat; import flash.text.TextFormatAlign; //-------------------------------------- // Styles //-------------------------------------- /** * An object containing style values to be passed to the vertical axis * renderer. The available styles are listed with the class that is used as the * axis renderer. * * @example * <listing version="3.0"> * { * showTicks: true, * tickWeight: 1, * tickColor: 0x999999, * showMinorTicks: true, * minorTickWeight: 1, * minorTickColor: 0xcccccc * } * </listing> * * <p><strong>Note:</strong> Previously, all styles for the axis renderers * were listed as individual styles on the chart, but since it is possible * to use a renderer class that has completely different styles than the * default renderer, we need to deprecate the previous method to allow * maximum flexibility when new or custom renderers are added.</p> * * <p>The old styles still exist, and legacy code will continue to work * for the time being. However, it is recommended that you begin porting * code to the new system as soon as possible.</p> * * <p>For the vertical axis, you should use the following method to set * styles at runtime:</p> * * @example * <listing version="3.0"> * chart.setVerticalAxisStyle("showTicks", false); * </listing> * * @see setVerticalAxisStyle() * @see com.yahoo.astra.fl.charts.axes.DefaultAxisRenderer */ [Style(name="verticalAxisStyles", type="Object")] /** * The class used to instantiate the visual representation of the vertical * axis. * * @default DefaultAxisRenderer * @see com.yahoo.astra.fl.charts.axes.DefaultAxisRenderer */ [Style(name="verticalAxisRenderer", type="Class")] /** * An object containing style values to be passed to the horizontal axis * renderer. The available styles are listed with the class that is used as the * axis renderer. * * @example * <listing version="3.0"> * { * showTicks: true, * tickWeight: 1, * tickColor: 0x999999, * showMinorTicks: true, * minorTickWeight: 1, * minorTickColor: 0xcccccc * } * </listing> * * <p><strong>Note:</strong> Previously, all styles for the grid lines * renderer were listed as individual styles on the chart, but since it is * possible to use a renderer class that has completely different styles * than the default renderer, we need to deprecate the previous * method to allow maximum flexibility when new or custom renderers are * added.</p> * * <p>The old styles still exist, and legacy code will continue to work * for the time being. However, it is recommended that you begin porting * code to the new system as soon as possible.</p> * * <p>For the horizontal axis, you should use the following method to set * styles at runtime:</p> * * @example * <listing version="3.0"> * chart.setHorizontalAxisStyle("showTicks", false); * </listing> * * @see setHorizontalAxisStyle() * @see com.yahoo.astra.fl.charts.axes.DefaultAxisRenderer */ [Style(name="horizontalAxisStyles", type="Object")] /** * The class used to instantiate the visual representation of the horizontal * axis. * * @default DefaultAxisRenderer * @see com.yahoo.astra.fl.charts.axes.DefaultAxisRenderer */ [Style(name="horizontalAxisRenderer", type="Class")] /** * An object containing style values to be passed to the vertical axis grid * lines renderer. The available styles are listed with the class that is used as the * grid lines renderer. * * @example * <listing version="3.0"> * { * showLines: true, * lineWeight: 1, * lineColor: 0x999999, * showMinorLines: false * } * </listing> * * <p><strong>Note:</strong> Previously, all styles for the grid lines were listed as individual * styles on the chart, but since it is possible to use a renderer class * that has completely different styles, we need to deprecate the previous * method to allow maximum flexibility when new or custom renderers are * added.</p> * * <p>The old styles still exist, and legacy code will continue to work * for the time being. However, it is recommended that you begin porting * code to the new system as soon as possible.</p> * * <p>For the vertical axis grid lines, you should use the following method to set * styles at runtime:</p> * * @example * <listing version="3.0"> * chart.setVerticalAxisGridLinesStyle("lineColor", 0x999999); * </listing> * * @see setVerticalAxisGridLinesStyle() * @see com.yahoo.astra.fl.charts.axes.DefaultGridLinesRenderer */ [Style(name="verticalAxisGridLinesStyles", type="Object")] /** * The class used to instantiate the vertical axis grid lines. * * @default DefaultGridLinesRenderer * @see com.yahoo.astra.fl.charts.axes.DefaultGridLinesRenderer */ [Style(name="verticalAxisGridLinesRenderer", type="Class")] /** * An object containing style values to be passed to the horizontal axis grid * lines renderer. The available styles are listed with the class that is used as the * grid lines renderer. * * @example * <listing version="3.0"> * { * showLines: true, * lineWeight: 1, * lineColor: 0x999999, * showMinorLines: false * } * </listing> * * <p><strong>Note:</strong> Previously, all styles for the grid lines were listed as individual * styles on the chart, but since it is possible to use a renderer class * that has completely different styles, we need to deprecate the previous * method to allow maximum flexibility when new or custom renderers are * added.</p> * * <p>The old styles still exist, and legacy code will continue to work * for the time being. However, it is recommended that you begin porting * code to the new system as soon as possible.</p> * * <p>For the horizontal axis grid lines, you should use the following method to set * styles at runtime:</p> * * @example * <listing version="3.0"> * chart.setHorizontalAxisGridLinesStyle("lineColor", 0x999999); * </listing> * * @see setHorizontalAxisGridLinesStyle() * @see com.yahoo.astra.fl.charts.axes.DefaultGridLinesRenderer */ [Style(name="horizontalAxisGridLinesStyles", type="Object")] /** * The class used to instantiate the horizontal axis grid lines. * * @default DefaultGridLinesRenderer */ [Style(name="horizontalAxisGridLinesRenderer", type="Class")] //-- DEPRECATED Vertical Axis styles /** * If false, the vertical axis is not drawn. Titles, labels, ticks, and grid * lines may still be drawn, however, so you must specifically hide each * item if nothing should be drawn. * * @default true * @deprecated */ [Style(name="showVerticalAxis", type="Boolean")] /** * The line weight, in pixels, for the vertical axis. * * @default 1 * @deprecated */ [Style(name="verticalAxisWeight", type="int")] /** * The line color for the vertical axis. * * @default #888a85 * @deprecated */ [Style(name="verticalAxisColor", type="uint")] //-- Labels - Vertical Axis /** * If true, labels will be displayed on the vertical axis. * * @default true * @deprecated */ [Style(name="showVerticalAxisLabels", type="Boolean")] /** * The distance, in pixels, between a label and the vertical axis. * * @default 2 * @deprecated */ [Style(name="verticalAxisLabelDistance", type="Number")] /** * Defines the TextFormat used by labels on the vertical axis. If null, * the <code>textFormat</code> style will be used. * * @default null * @deprecated */ [Style(name="verticalAxisTextFormat", type="TextFormat")] /** * If true, labels that overlap previously drawn labels on the axis will be * hidden. The first and last labels on the axis will always be drawn. * * @default true * @deprecated */ [Style(name="verticalAxisHideOverlappingLabels", type="Boolean")] /** * The angle, in degrees, of the labels on the vertical axis. May be a value * between <code>-90</code> and <code>90</code>. The font must be embedded * in the SWF and the <code>embedFonts</code> style on the chart must be set * to <code>true</code> before labels may be rotated. If these conditions * aren't met, the labels will not be rotated. * * @default 0 * @deprecated */ [Style(name="verticalAxisLabelRotation", type="Number")] //-- Grid - Vertical Axis /** * An Array of <code>uint</code> color values that is used to draw * alternating fills between the vertical axis' grid lines. * * @default [] * @deprecated */ [Style(name="verticalAxisGridFillColors", type="Array")] /** * An Array of alpha values (in the range of 0 to 1) that is used to draw * alternating fills between the vertical axis' grid lines. * * @default [] * @deprecated */ [Style(name="verticalAxisGridFillAlphas", type="Array")] //-- DEPRECATED Grid Lines styles - Vertical Axis /** * If true, grid lines will be displayed on the vertical axis. * * @default false * @deprecated */ [Style(name="showVerticalAxisGridLines", type="Boolean")] /** * The line weight, in pixels, for the grid lines on the vertical axis. * * @default 1 * @deprecated */ [Style(name="verticalAxisGridLineWeight", type="int")] /** * The line color for the grid lines on the vertical axis. * * @default #babdb6 * @deprecated */ [Style(name="verticalAxisGridLineColor", type="uint")] //-- Minor Grid Lines - Vertical Axis /** * If true, minor grid lines will be displayed on the vertical axis. * * @default false * @deprecated */ [Style(name="showVerticalAxisMinorGridLines", type="Boolean")] /** * The line weight, in pixels, for the minor grid lines on the vertical axis. * * @default 1 * @deprecated */ [Style(name="verticalAxisMinorGridLineWeight", type="int")] /** * The line color for the minor grid lines on the vertical axis. * * @default #eeeeec * @deprecated */ [Style(name="verticalAxisMinorGridLineColor", type="uint")] //-- Ticks - Vertical Axis /** * If true, ticks will be displayed on the vertical axis. * * @default true * @deprecated */ [Style(name="showVerticalAxisTicks", type="Boolean")] /** * The line weight, in pixels, for the ticks on the vertical axis. * * @default 1 * @deprecated */ [Style(name="verticalAxisTickWeight", type="int")] /** * The line color for the ticks on the vertical axis. * * @default #888a85 * @deprecated */ [Style(name="verticalAxisTickColor", type="uint")] /** * The length, in pixels, of the ticks on the vertical axis. * * @default 4 * @deprecated */ [Style(name="verticalAxisTickLength", type="Number")] /** * The position of the ticks on the vertical axis. * * @default "cross" * @see com.yahoo.astra.fl.charts.axes.TickPosition * @deprecated */ [Style(name="verticalAxisTickPosition", type="String")] //-- Minor ticks - Vertical Axis /** * If true, ticks will be displayed on the vertical axis at minor positions. * * @default true * @deprecated */ [Style(name="showVerticalAxisMinorTicks", type="Boolean")] /** * The line weight, in pixels, for the minor ticks on the vertical axis. * * @default 1 * @deprecated */ [Style(name="verticalAxisMinorTickWeight", type="int")] /** * The line color for the minor ticks on the vertical axis. * * @default #888a85 * @deprecated */ [Style(name="verticalAxisMinorTickColor", type="uint")] /** * The length of the minor ticks on the vertical axis. * * @default 3 * @deprecated */ [Style(name="verticalAxisMinorTickLength", type="Number")] /** * The position of the minor ticks on the vertical axis. * * @default "outside" * @see com.yahoo.astra.fl.charts.axes.TickPosition * @deprecated */ [Style(name="verticalAxisMinorTickPosition", type="String")] //-- Title - Vertical Axis /** * If true, the vertical axis title will be displayed. * * @default 2 * @deprecated */ [Style(name="showVerticalAxisTitle", type="Boolean")]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -