StockGraph
Type class
StockGraph displays graphs on StockPanel.
Sources
This information about StockGraph is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.
Inheritance
StockGraph extends AmGraph.
StockGraph is not extended by any other symbol.
Properties
comparableType
booleanDefaultfalseSpecifies whether this graph will be compared if some data set is selected for comparing.
compareFieldType
stringSpecifies a field to be used to generate comparing graph. Note, this field is not the one used in your dataProvider, but toField from FieldMapping object.
compareFromStartType
booleanDefaultfalseIf you set it to true, when data sets are compared, the graphs will use first value as a base value instead of using the first value of selected period.
compareGraphType
AmGraphYou can use this property to set config of compared graphs. This allows you to set any of AmGraph properties on compared graphs instead of using old-style properties like compareGraphBulletBorderThickness. For example: stockGraph.compareGraph = {“bulletBorderThickness”:2, “lineAlpha”:0.4}.
compareGraphBalloonColorType
colorBalloon color of comparing graph.
compareGraphBalloonFunctionIf you set some function, the graph will call it and pass GraphDataItem and AmGraph object to it. This function should return a string which will be displayed in a balloon. This will be used for graphs from compared data sets only. Use balloonFunction for main data set's graphs.
compareGraphBalloonTextType
stringBalloon text of comparing graph.
compareGraphBulletType
stringBullet of comparing graph. Possible values are: round, square, diamond, triangleUp, triangleDown, triangleLeft, triangleRight, bubble
compareGraphBulletBorderAlphaType
numberOpacity of bullet border of comparing graph.
compareGraphBulletBorderColorType
colorColor of bullet border of comparing graph.
compareGraphBulletBorderThicknessType
numberThickness of bullet border of comparing graph.
compareGraphBulletColorType
colorColor of compared graphs' bullets.
compareGraphBulletSizeType
numberBullet size of comparing graph.
compareGraphCornerRadiusTopType
numberCorner radius of comparing graph (if type is "column").
compareGraphDashLengthType
numberDash length of compare graph.
compareGraphFillAlphasType
numberFill alpha of comparing graph.
compareGraphFillColorsType
colorFill color of comparing graph.
compareGraphLineAlphaType
numberOpacity of comparing graph line.
compareGraphLineColorType
colorColor of compare graph (by default data set color is used)
compareGraphLineThicknessType
numberThickness of compare graph.
compareGraphTypeType
stringDefaultlineType of comparing graph. Possible values are: "line", "column", "step", "smoothedLine."
compareGraphVisibleInLegendType
booleanDefaulttrueSpecifies if compare graph is visible in legend.
periodValueType
stringDefaultCloseWhen data is grouped to periods, the graph must know which period value should be used. Possible values are: "Open", "Low", "High", "Close", "Average" and "Sum".
recalculateValueType
number/stringPossible values are Open, Close, High, Low, Average and Sum. There is no default value set – graph uses it’s periodValue when calculating changes. For example, the graph’s periodValue is Close. This means that when data is grouped to longer periods (months for example) when recalculating, the graph will use Close value of the first period of the selection as base value and will compare each months Close value to it. If you set recalculateValue to Open, the first value of a month will be used as base value.
showEventsOnComparedGraphsType
booleanDefaultfalseSpecifies if events of compared graphs should be shown.
useDataSetColorsType
booleanDefaulttrueSpecifies whether data set color should be used as this graph's lineColor. By default all graphs from the same data set will have a color from its relative DataSet (either auto-assigned by chart or set by color parameter). The graph's color properties will be ignored.
To disable this behavior, set "useDataSetColors" to false. This way the chart will use graph's own color settings, such as "lineColor" or auto-assign the color if those are not set.
111 inherited items
accessibleLabelType
stringDefault[[title]] [[category]] [[value]]Inherited fromAmGraphText which screen readers will read if user rolls-over the bullet/column or sets focus using tab key (this is possible only if tabIndex property of AmGraph is set to some number). Text is added as aria-label tag. Note - not all screen readers and browsers support this.
alphaFieldType
stringInherited fromAmGraphName of the alpha field in your dataProvider.
animationPlayedType
booleanDefaultfalseInherited fromAmGraphIf you set this to true before chart is drawn, the animation of this graph won't be played.
balloonColorType
colorInherited fromAmGraphValue balloon color. Will use graph or data item color if not set.
balloonFunctionInherited from
AmGraphIf you set some function, the graph will call it and pass GraphDataItem and AmGraph objects to it. This function should return a string which will be displayed in a balloon.
balloonTextType
stringDefault[[value]]Inherited fromAmGraphBalloon text. You can use tags like
value,description,percents,open,categoryor any other field name from your data provider. HTML tags can also be used.behindColumnsType
booleanDefaultfalseInherited fromAmGraphSpecifies if the line graph should be placed behind column graphs
bulletType
stringDefaultnoneInherited fromAmGraphType of the bullets. Possible values are: "none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond", "xError", "yError" and "custom".
bulletAlphaType
numberDefault1Inherited fromAmGraphOpacity of bullets. Value range is 0 - 1.
bulletAxisType
ValueAxisInherited fromAmGraphbulletAxis value is used when you are building error chart. Error chart is a regular serial or XY chart with bullet type set to "xError" or "yError". The graph should know which axis should be used to determine the size of this bullet - that's when bulletAxis should be set. Besides that, you should also set graph.errorField. You can also use other bullet types with this feature too. For example, if you set bulletAxis for XY chart, the size of a bullet will change as you zoom the chart.
bulletBorderAlphaType
numberDefault0Inherited fromAmGraphBullet border opacity.
bulletBorderColorType
colorInherited fromAmGraphBullet border color. Will use lineColor if not set.
bulletBorderThicknessType
numberDefault2Inherited fromAmGraphBullet border thickness.
bulletColorType
colorInherited fromAmGraphBullet color. Will use lineColor if not set.
bulletFieldType
stringInherited fromAmGraphName of the bullet field in your dataProvider.
bulletHitAreaSizeType
numberInherited fromAmGraphUseful for touch devices - if you set it to 20 or so, the bullets of a graph will have invisible circle around the actual bullet (bullets should still be enabled), which will be easier to touch (bullets usually are smaller and hard to hit).
bulletOffsetType
numberDefault0Inherited fromAmGraphBullet offset. Distance from the actual data point to the bullet. Can be used to place custom bullets above the columns.
bulletSizeType
numberDefault8Inherited fromAmGraphBullet size.
bulletSizeFieldType
stringInherited fromAmGraphName of the bullet size field in your dataProvider.
classNameFieldType
stringInherited fromAmGraphIf this field is set and addClassNames is enabled, the chart will look for a class name string in data using this setting and apply additional class names to elements of the particular data points, such as bullets.
closeFieldType
stringInherited fromAmGraphName of the close field (used by candlesticks and ohlc) in your dataProvider.
clusteredType
booleanDefaulttrueInherited fromAmGraphIn case you want to place this graph's columns in front of other columns, set this to false. In case "true", the columns will be clustered next to each other.
NOTE: clustering works only for graphs of type "column".
colorType
colorInherited fromAmGraphColor of value labels. Will use chart's color if not set.
colorFieldType
stringInherited fromAmGraphName of the color field in your dataProvider.
columnIndexFieldType
stringInherited fromAmGraphYou can use this property with non-stacked column graphs and specify order of columns of each category (starting from 0). Important: this feature does not work in stacked columns scenarios as well as with graph toggling enabled in legend.
columnWidthType
numberInherited fromAmGraphYou can specify custom column width for each graph individually. Value range is 0 - 1 (we set relative width, not pixel width here).
connectType
booleanDefaulttrueInherited fromAmGraphSpecifies whether to connect data points if data is missing. The default value is true. This feature does not work with XY chart.
cornerRadiusTopType
numberDefault0Inherited fromAmGraphCorner radius of column. It can be set both in pixels or in percents. The chart's depth and angle styles must be set to 0. The default value is 0. Note, cornerRadiusTop will be applied for all corners of the column, JavaScript charts do not have a possibility to set separate corner radius for top and bottom. As we want all the property names to be the same both on JS and Flex, we didn't change this too.
cursorBulletAlphaType
numberDefault1Inherited fromAmGraphIf bulletsEnabled of ChartCurosor is true, a bullet on each graph follows the cursor. You can set opacity of each graphs bullet. In case you want to disable these bullets for a certain graph, set opacity to 0.
customBulletType
stringInherited fromAmGraphPath to the image of custom bullet.
customBulletFieldType
stringInherited fromAmGraphName of the custom bullet field in your dataProvider.
customMarkerType
stringInherited fromAmGraphPath to the image for legend marker.
dashLengthType
numberDefault0Inherited fromAmGraphDash length. If you set it to a value greater than 0, the graph line (or columns border) will be dashed.
dashLengthFieldType
stringInherited fromAmGraphName of the dash length field in your dataProvider. This property adds a possibility to change graphs’ line from solid to dashed on any data point. You can also make columns border dashed using this setting. Note, this won't work with smoothedLineGraph.
dateFormatType
stringDefaultMMM DD, YYYYInherited fromAmGraphUsed to format balloons if value axis is date-based.
descriptionFieldType
stringInherited fromAmGraphName of the description field in your dataProvider.
errorFieldType
stringInherited fromAmGraphName of error value field in your data provider.
fillAlphasType
numberDefault0Inherited fromAmGraphOpacity of fill. Plural form is used to keep the same property names as our Flex charts'. Flex charts can accept array of numbers to generate gradients. Although you can set array here, only first value of this array will be used.
fillColorsType
colorInherited fromAmGraphFill color. Will use lineColor if not set. You can also set array of colors here.
fillColorsFieldType
stringInherited fromAmGraphName of the fill colors field in your dataProvider. This property adds a possibility to change line graphs’ fill color on any data point to create highlighted sections of the graph. Works only with AmSerialChart.
fillToAxisType
ValueAxisInherited fromAmGraphXY chart only. If you set this property to id or reference of your X or Y axis, and the fillAlphas is > 0, the area between graph and axis will be filled with color, like in this demo.
fillToGraphType
AmGraphInherited fromAmGraphYou can set another graph here and if fillAlpha is >0, the area from this graph to fillToGraph will be filled (instead of filling the area to the X axis). This feature is not supported by smoothedLine graphs and Radar chart.
fixedColumnWidthType
numberInherited fromAmGraphColumn width in pixels. If you set this property, columns will be of a fixed width and won't adjust to the available space.
fontSizeType
numberInherited fromAmGraphSize of value labels text. Will use chart's fontSize if not set.
forceGapType
booleanDefaultfalseInherited fromAmGraphIf this is set
true, the graph will always break the line if the distance in time between two adjacent data points is bigger thangapPeriod x minPeriod, even ifconnectis set totrue.gapFieldType
stringInherited fromAmGraphName of the gap field in your dataProvider. You can force graph to show gap at a desired data point using this feature. This feature does not work with XY chart.
gapPeriodType
numberDefault1.1Inherited fromAmGraphUsing this property you can specify when graph should display gap - if the time difference between data points is bigger than duration of minPeriod * gapPeriod, and connect property of a graph is set to false, graph will display gap.
gradientOrientationType
stringDefaultverticalInherited fromAmGraphOrientation of the gradient fills (only for "column" graph type). Possible values are "vertical" and "horizontal".
Type
booleanDefaultfalseInherited fromAmGraphSpecifies whether the graph is hidden. Do not use this to show/hide the graph, use hideGraph(graph) and showGraph(graph) methods instead.
hideBulletsCountType
numberDefault0Inherited fromAmGraphIf there are more data points than hideBulletsCount, the bullets will not be shown. 0 means the bullets will always be visible.
highFieldType
stringInherited fromAmGraphName of the high field (used by candlesticks and ohlc) in your dataProvider.
idType
stringInherited fromAmGraphUnique id of a graph. It is not required to set one, unless you want to use this graph for as your scrollbar's graph and need to indicate which graph should be used.
includeInMinMaxType
booleanDefaulttrueInherited fromAmGraphWhether to include this graph when calculating min and max value of the axis.
labelAnchorType
stringDefaultautoInherited fromAmGraphData label text anchor.
labelColorFieldType
stringInherited fromAmGraphName of label color field in data provider.
labelFunctionInherited from
AmGraphYou can use it to format labels of data items in any way you want. Graph will call this function and pass reference to GraphDataItem and formatted text as attributes. This function should return string which will be displayed as label.
labelOffsetType
numberDefault0Inherited fromAmGraphOffset of data label.
labelPositionType
stringDefaulttopInherited fromAmGraphPosition of value label. Possible values are: "bottom", "top", "right", "left", "inside", "middle". Sometimes position is changed by the chart, depending on a graph type, rotation, etc.
labelRotationType
numberDefault0Inherited fromAmGraphRotation of a data label.
labelTextType
stringInherited fromAmGraphValue label text. You can use tags like
value,description,percents,open,category.legendAlphaType
numberInherited fromAmGraphLegend marker opacity. Will use lineAlpha if not set. Value range is 0 - 1.
legendColorType
colorInherited fromAmGraphLegend marker color. Will use lineColor if not set.
legendPeriodValueTextType
stringInherited fromAmGraphThe text which will be displayed in the value portion of the legend when user is not hovering above any data point. The tags should be made out of two parts - the name of a field (value / open / close / high / low) and the value of the period you want to be show - open / close / high / low / sum / average / count. For example:
value.summeans that sum of all data points of value field in the selected period will be displayed.legendValueTextType
stringInherited fromAmGraphLegend value text. You can use tags like
value,description,percents,open,categoryYou can also use custom fields from your dataProvider. If not set, uses Legend's valueText.lineAlphaType
numberDefault1Inherited fromAmGraphOpacity of the line (or column border). Value range is 0 - 1.
lineColorType
colorInherited fromAmGraphColor of the line (or column border). If you do not set any, the color from AmCoordinateChart.colors array will be used for each subsequent graph.
lineColorFieldType
stringInherited fromAmGraphName of the line color field in your dataProvider. This property adds a possibility to change graphs’ line color on any data point to create highlighted sections of the graph. Works only with AmSerialChart.
lineThicknessType
numberDefault1Inherited fromAmGraphSpecifies thickness of the graph line (or column border).
lowFieldType
stringInherited fromAmGraphName of the low field (used by candlesticks and ohlc) in your dataProvider.
markerTypeType
stringInherited fromAmGraphLegend marker type. You can set legend marker (key) type for individual graphs. Possible values are: square, circle, diamond, triangleUp, triangleDown, triangleLeft, triangleDown, bubble, line, none.
maxBulletSizeType
numberDefault50Inherited fromAmGraphSpecifies size of the bullet which value is the biggest (XY chart).
minBulletSizeType
numberDefault4Inherited fromAmGraphSpecifies minimum size of the bullet (XY chart).
minDistanceType
numberDefault1Inherited fromAmGraphIt is useful if you have really lots of data points. Based on this property the graph will omit some of the lines (if the distance between points is less that minDistance, in pixels). This will not affect the bullets or indicator in anyway, so the user will not see any difference (unless you set minValue to a bigger value, let say 5), but will increase performance as less lines will be drawn. By setting value to a bigger number you can also make your lines look less jagged.
negativeBaseType
numberDefault0Inherited fromAmGraphIf you use different colors for your negative values, a graph below zero line is filled with negativeColor. With this property you can define a different base value at which colors should be changed to negative colors.
negativeFillAlphasType
numberInherited fromAmGraphFill opacity of negative part of the graph. Will use fillAlphas if not set.
negativeFillColorsType
colorInherited fromAmGraphFill color of negative part of the graph. Will use fillColors if not set.
negativeLineAlphaType
numberDefault1Inherited fromAmGraphOpacity of the negative portion of the line (or column border). Value range is 0 - 1.
negativeLineColorType
colorInherited fromAmGraphColor of the line (or column) when the values are negative. In case the graph type is candlestick or ohlc, negativeLineColor is used when close value is less then open value.
newStackType
booleanDefaultfalseInherited fromAmGraphIf you set it to true, column chart will begin new stack. This allows having Clustered and Stacked column/bar chart.
noStepRisersType
booleanDefaultfalseInherited fromAmGraphIn case you want to have a step line graph without risers, you should set this to true.
openFieldType
stringInherited fromAmGraphName of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider.
patternType
objectInherited fromAmGraphValue of pattern should be object with url, width, height of an image, optionally it might have x, y, randomX and randomY values. For example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}. If you want to have individual patterns for each column, define patterns in data provider and set graph.patternField property. Check amcharts/patterns folder for some patterns. You can create your own patterns and use them. Note, x, y, randomX and randomY properties won't work with IE8 and older. 3D bar/Pie charts won't work properly with patterns.
patternFieldType
stringInherited fromAmGraphField name in your data provider which holds pattern information. Value of pattern should be object with url, width, height of an image, optionally it might have x, y, randomX and randomY values. For example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}. Check amcharts/patterns folder for some patterns. You can create your own patterns and use them. Note, x, y, randomX and randomY properties won't work with IE8 and older. 3D bar/Pie charts won't work properly with patterns.
periodSpanType
numberDefault1Inherited fromAmGraphThis property can be used by step graphs - you can set how many periods one horizontal line should span.
pointPositionType
stringDefaultmiddleInherited fromAmGraphSpecifies 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). This setting affects Serial chart only. Possible values are "start", "middle" and "end"
precisionType
numberInherited fromAmGraphPrecision of values. Will use chart's precision if not set any.
proCandlesticksType
booleanDefaultfalseInherited fromAmGraphIf this is set to true, candlesticks will be colored in a different manner - if current close is less than current open, the candlestick will be empty, otherwise - filled with color. If previous close is less than current close, the candlestick will use positive color, otherwise - negative color.
showAllValueLabelsType
booleanDefaultfalseInherited fromAmGraphIf graph's type is column and labelText is set, graph hides labels which do not fit into the column's space or go outside plot area. If you don't want these labels to be hidden, set this to true.
showBalloonType
booleanDefaulttrueInherited fromAmGraphSpecifies whether the value balloon of this graph is shown when mouse is over data item or chart's indicator is over some series.
showBalloonAtType
stringDefaultcloseInherited fromAmGraphSpecifies graphs value at which cursor is showed. This is only important for candlestick and ohlc charts, also if column chart has "open" value. Possible values are: "open", "close", "high", "low". "top" and "bottom" values will glue the balloon to top/bottom of the plot area.
showBulletsAtType
stringDefaultcloseInherited fromAmGraphWorks with candlestick graph type, you can set it to open, close, high, low. If you set it to high, the events will be shown at the tip of the high line.
showHandOnHoverType
booleanDefaultfalseInherited fromAmGraphIf you want mouse pointer to change to hand when hovering the graph, set this property to true.
showOnAxisType
booleanDefaultfalseInherited fromAmGraphIt can only be used together with topRadius (when columns look like cylinders). If you set it to true, the cylinder will be lowered down so that the center of it's bottom circle would be right on category axis.
stackableType
booleanDefaulttrueInherited fromAmGraphIf the value axis of this graph has stack types like "regular" or "100%" You can exclude this graph from stacking.
stepDirectionType
stringDefaultrightInherited fromAmGraphStep graph only. Specifies to which direction step should be drawn.
switchableType
booleanDefaulttrueInherited fromAmGraphIf you set it to false, the graph will not be hidden when user clicks on legend entry.
tabIndexType
numberInherited fromAmGraphIn case you set it to some number, the chart will set focus on bullet/column (starting from first) when user clicks tab key. When a focus is set, screen readers like NVDA Screen reader will read label which is set using accessibleLabel property of AmGraph. Note, not all browsers and readers support this.
titleType
stringInherited fromAmGraphGraph title.
topRadiusType
numberInherited fromAmGraphIf you set this to 1, columns will become cylinders (must set depth3D and angle properties of a chart to >0 values in order this to be visible). you can make columns look like cones (set topRadius to 0) or even like some glasses (set to bigger than 1). We strongly recommend setting grid opacity to 0 in order this to look good.
typeType
stringDefaultlineInherited fromAmGraphType of the graph. Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc". XY and Radar charts can only display "line" type graphs.
urlFieldType
stringInherited fromAmGraphName of the url field in your dataProvider.
urlTargetType
stringInherited fromAmGraphTarget to open URLs in, i.e. _blank, _top, etc.
useLineColorForBulletBorderType
booleanDefaultfalseInherited fromAmGraphIf set to true, the bullet border will take the same color as graph line.
useNegativeColorIfDownType
booleanDefaultfalseInherited fromAmGraphIf negativeLineColor and/or negativeFillColors are set and useNegativeColorIfDown is set to true (default is false), the line, step and column graphs will use these colors for lines, bullets or columns if previous value is bigger than current value. In case you set openField for the graph, the graph will compare current value with openField value instead of comparing to previous value. Here is a demo.
valueAxisType
ValueAxisDefaultValueAxisInherited fromAmGraphSpecifies which value axis the graph will use. Will use the first value axis if not set. You can use reference to the real ValueAxis object or set value axis id.
valueFieldType
stringInherited fromAmGraphName of the value field in your dataProvider.
visibleInLegendType
booleanDefaulttrueInherited fromAmGraphSpecifies whether this graph should be shown in the Legend.
xAxisType
ValueAxisDefaultValueAxisInherited fromAmGraphXY chart only. A horizontal value axis object to attach graph to.
xFieldType
stringInherited fromAmGraphXY chart only. Name of the x field in your dataProvider.
yAxisType
ValueAxisDefaultValueAxisInherited fromAmGraphXY chart only. A vertical value axis object to attach graph to.
yFieldType
stringInherited fromAmGraphXY chart only. Name of the y field in your dataProvider.
Methods
2 inherited items
Events
StockGraph does not have any events.