Package io.jmix.charts.model.graph
Class AbstractGraph<T extends AbstractGraph>
java.lang.Object
io.jmix.charts.model.AbstractChartObject
io.jmix.charts.model.graph.AbstractGraph<T>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Graph
,StockGraph
Defines the visualization of the data in following types: line, column, step line, smoothed line, olhc and
candlestick.
See documentation for properties of AmGraph JS Object.
http://docs.amcharts.com/3/javascriptcharts/AmGraph
See documentation for properties of AmGraph JS Object.
http://docs.amcharts.com/3/javascriptcharts/AmGraph
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetColor()
getId()
getTitle()
getType()
getXAxis()
getYAxis()
setAccessibleLabel
(String accessibleLabel) Sets text 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 graph is set to some number).setAlphaField
(String alphaField) Sets name of the alpha field from your data provider.setAnimationPlayed
(Boolean animationPlayed) If you set animationPlayed to true before chart is drawn, the animation of this graph won't be played.setBalloon
(Balloon balloon) Sets the balloon to the graph.setBalloonColor
(Color balloonColor) Sets value balloon color.setBalloonFunction
(JsFunction balloonFunction) Sets JS function, the graph will call it and pass GraphDataItem and AmGraph objects to it.setBalloonText
(String balloonText) Sets balloon text.setBehindColumns
(Boolean behindColumns) Set behindColumns to true if the line graph should be placed behind column graphs.setBullet
(BulletType bullet) Sets type of the bullets.setBulletAlpha
(Double bulletAlpha) Sets opacity of bullets.setBulletAxis
(String bulletAxis) bulletAxis value is used when you are building error chart.setBulletBorderAlpha
(Double bulletBorderAlpha) Sets bullet border opacity.setBulletBorderColor
(Color bulletBorderColor) Sets bullet border color.setBulletBorderThickness
(Integer bulletBorderThickness) Sets bullet border thickness.setBulletColor
(Color bulletColor) Sets bullet color.setBulletField
(String bulletField) Sets name of the bullet field from your data provider.setBulletHitAreaSize
(Integer bulletHitAreaSize) Sets bullet hit area size.setBulletOffset
(Integer bulletOffset) Sets bullet offset.setBulletSize
(Integer bulletSize) Sets bullet size.setBulletSizeField
(String bulletSizeField) Sets name of the bullet size field from your data provider.setClassNameField
(String classNameField) Sets CSS class name field.setCloseField
(String closeField) Sets name of the close field (used by candlesticks and ohlc) from your data provider.setClustered
(Boolean clustered) Set clustered to false if you want to place this graph's columns in front of other columns.Sets color of value labels.setColorField
(String colorField) Sets name of the color field in your data provider.setColumnIndexField
(String columnIndexField) Specifies order of columns of each category (starting from 0).You can use this property with non-stacked column graphs.setColumnWidth
(Double columnWidth) Sets column width for each graph individually.setConnect
(Boolean connect) Specifies whether to connect data points if data is missing.setCornerRadiusTop
(Integer cornerRadiusTop) Sets corner radius of column.setCursorBulletAlpha
(Double cursorBulletAlpha) Sets opacity of each graphs bullet.setCustomBullet
(String customBullet) Sets path to the image of custom bullet.setCustomBulletField
(String customBulletField) Sets name of the custom bullet field in your data provider.setCustomMarker
(String customMarker) Sets path to the image for legend marker.setDashLength
(Integer dashLength) Sets dash length.setDashLengthField
(String dashLengthField) Sets name of the dash length field in your data provider.setDateFormat
(DateFormat dateFormat) Sets date format.setDescriptionField
(String descriptionField) Sets name of the description field in your dataProvider.setErrorField
(String errorField) Sets name of error value field in your data provider.setFillAlphas
(Double fillAlphas) Sets opacity of fill.setFillColors
(List<Color> fillColors) Sets list of fill colors.setFillColorsField
(String fillColorsField) Sets name of the fill colors field in your data provider.setFillToAxis
(String fillToAxis) XY chart only.setFillToGraph
(String fillToGraph) You can set another graph here and if fillAlpha is greater than 0 , the area from this graph to fillToGraph will be filled (instead of filling the area to the X axis).setFixedColumnWidth
(Integer fixedColumnWidth) Sets column width, in pixels.setFontSize
(Integer fontSize) Sets size of value labels text.setForceGap
(Boolean forceGap) Set forceGap to true if you want the graph should always break the line if the distance in time between two adjacent data points is bigger than "gapPeriod * minPeriod", even if connect property is set to true.setGapField
(String gapField) Sets name of the gap field in your data provider.setGapPeriod
(Double gapPeriod) Specifies 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.setGradientOrientation
(GradientOrientation gradientOrientation) Sets orientation of the gradient fills (only for "column" graph type).Set hidden to true if the graph should be hidden.setHideBulletsCount
(Integer hideBulletsCount) Sets hide bullets count.setHighField
(String highField) Sets name of the high field (used by candlesticks and ohlc) in your data provider.Sets unique id of a graph.setIncludeInMinMax
(Boolean includeInMinMax) Set includeInMinMax to true if this graph should be included when calculating minimum and maximum value of the axis.setLabelAnchor
(String labelAnchor) Sets data label text anchor.setLabelColorField
(String labelColorField) Sets name of label color field in your data provider.setLabelFunction
(JsFunction labelFunction) Sets JS function to format labels of data items in any way you want.setLabelOffset
(Integer labelOffset) Sets offset of data label.setLabelPosition
(ValueLabelPosition labelPosition) Sets the position of value label.setLabelRotation
(Integer labelRotation) Sets the rotation of a data label.setLabelText
(String labelText) Sets value label text.setLegendAlpha
(Double legendAlpha) Sets legend marker opacity.setLegendColor
(Color legendColor) Sets legend marker color.setLegendColorFunction
(JsFunction legendColorFunction) Sets JS function to handle legend marker color.setLegendPeriodValueText
(String legendPeriodValueText) Sets the text which will be displayed in the value portion of the legend when user is not hovering above any data point.setLegendValueText
(String legendValueText) Sets legend value text.setLineAlpha
(Double lineAlpha) Sets opacity of the line (or column border).setLineColor
(Color lineColor) Sets color of the line (or column border).setLineColorField
(String lineColorField) Sets name of the line color field in your data provider.setLineThickness
(Integer lineThickness) Sets thickness of the graph line (or column border).setLowField
(String lowField) Sets name of the low field (used by candlesticks and ohlc) in your data provider.setMarkerType
(MarkerType markerType) Sets legend marker type.setMaxBulletSize
(Integer maxBulletSize) Sets size of the bullet which value is the biggest (XY chart).setMinBulletSize
(Integer minBulletSize) Sets minimum size of the bullet (XY chart).setMinDistance
(Integer minDistance) Sets minimum distance.setNegativeBase
(Double negativeBase) Sets different base value at which colors should be changed to negative colors if you use different colors for your negative values.setNegativeFillAlphas
(Double negativeFillAlphas) Sets fill opacity of negative part of the graph.setNegativeFillColors
(List<Color> negativeFillColors) Sets fill color of negative part of the graph.setNegativeLineAlpha
(Double negativeLineAlpha) Sets opacity of the negative portion of the line (or column border).setNegativeLineColor
(Color negativeLineColor) Sets color of the line (or column) when the values are negative.setNewStack
(Boolean newStack) Set newStack to true if column chart should begin new stack.setNoStepRisers
(Boolean noStepRisers) Set noStepRisers to true if you want to have a step line graph without risers.setOpenField
(String openField) Sets name of the open field (used by floating columns, candlesticks and ohlc) in your data provider.setPattern
(Pattern pattern) Sets pattern to the graph.setPatternField
(String patternField) Sets field name in your data provider which holds pattern information.setPeriodSpan
(Integer periodSpan) Sets how many periods one horizontal line should span.setPointPosition
(PointPosition 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).setPrecision
(Integer precision) Sets precision of values.setProCandlesticks
(Boolean proCandlesticks) If proCandlesticks 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.setShowAllValueLabels
(Boolean showAllValueLabels) If 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.setShowBalloon
(Boolean showBalloon) Set showBalloon to true if the value balloon of this graph should be shown when mouse is over data item or chart's indicator is over some series.setShowBalloonAt
(ShowPositionOnCandle showBalloonAt) Specifies graphs value at which cursor is shown.setShowBulletsAt
(ShowPositionOnCandle showBulletsAt) Works with candlestick graph type, you can set it to open, close, high, low.setShowHandOnHover
(Boolean showHandOnHover) Set showHandOnHover to true if you want mouse pointer to change to hand when hovering the graph.setShowOnAxis
(Boolean showOnAxis) If you set showOnAxis to true, the cylinder will be lowered down so that the center of it's bottom circle would be right on category axis.setStackable
(Boolean stackable) Set stackable to false if you want exclude this graph from stacking.setStepDirection
(StepDirection stepDirection) Specifies to which direction step should be drawn.setSwitchable
(Boolean switchable) If you set switchable to false, the graph will not be hidden when user clicks on legend entry.setTabIndex
(Integer tabIndex) In case you set it to some number, the chart will set focus on bullet/column (starting from first) when user clicks tab key.Sets graph titlesetTopRadius
(Integer topRadius) If you set this to 1, columns will become cylinders (must set depth3D and angle properties of a chart to greater than 0 values in order this to be visible).Sets type of the graph.setUrlField
(String urlField) Sets name of the URL field in your data provider.setUrlTarget
(String urlTarget) Sets target to open URLs in, i.e.setUseLineColorForBulletBorder
(Boolean useLineColorForBulletBorder) If set to true, the bullet border will take the same color as graph line.setUseNegativeColorIfDown
(Boolean useNegativeColorIfDown) If negativeLineColor and/or negativeFillColors are set and useNegativeColorIfDown is set to true, the line, step and column graphs will use these colors for lines, bullets or columns if previous value is bigger than current value.setValueAxis
(String valueAxis) Specifies which value axis the graph will use.setValueField
(String valueField) Sets name of the value field in your data provider.setVisibleInLegend
(Boolean visibleInLegend) Set visibleInLegend to false if the graph shouldn't be shown in theLegend
.Sets a horizontal value axis to attach graph to.Sets name of the X field in your data provider.Sets a vertical value axis id to attach graph to.Sets name of the Y field in your data provider.
-
Constructor Details
-
AbstractGraph
public AbstractGraph()
-
-
Method Details
-
getAnimationPlayed
- Returns:
- true if animation played is enabled
-
setAnimationPlayed
If you set animationPlayed to true before chart is drawn, the animation of this graph won't be played. If not set the default value is false.- Parameters:
animationPlayed
- animation played option- Returns:
- graph
-
getTitle
- Returns:
- graph title
-
setTitle
Sets graph title- Parameters:
title
- graph title string- Returns:
- graph
-
getType
- Returns:
- graph type
-
setType
Sets type of the graph. Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc". XY and Radar charts can only display "line" type graphs. If not set the default value is LINE.- Parameters:
type
- graph type- Returns:
- graph
-
getValueField
- Returns:
- value field
-
setValueField
Sets name of the value field in your data provider.- Parameters:
valueField
- value field string- Returns:
- graph
-
getXField
- Returns:
- name of the X field
-
setXField
Sets name of the X field in your data provider. XY chart only.- Parameters:
xField
- X field string- Returns:
- graph
-
getYField
- Returns:
- name of the Y field
-
setYField
Sets name of the Y field in your data provider. XY chart only.- Parameters:
yField
- name of the Y field- Returns:
- graph
-
getAlphaField
- Returns:
- alpha field
-
setAlphaField
Sets name of the alpha field from your data provider.- Parameters:
alphaField
- alpha field string- Returns:
- graph
-
getBalloonColor
- Returns:
- value balloon color
-
setBalloonColor
Sets value balloon color. Will use graph or data item color if not set.- Parameters:
balloonColor
- value balloon color- Returns:
- graph
-
getBalloonText
- Returns:
- balloon text
-
setBalloonText
Sets balloon text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] or any other field name from your data provider. HTML tags can also be used. If not set the default value is "[[value]]".- Parameters:
balloonText
- balloon text- Returns:
- graph
-
getBehindColumns
- Returns:
- true if the line graph is placed behind column graphs
-
setBehindColumns
Set behindColumns to true if the line graph should be placed behind column graphs. If not set the default value is false;- Parameters:
behindColumns
- behind columns option- Returns:
- graph
-
getBullet
- Returns:
- bullet type
-
setBullet
Sets type of the bullets. If not set the default value is NONE.- Parameters:
bullet
- bullet type- Returns:
- graph
-
getBulletAlpha
- Returns:
- opacity of bullets
-
setBulletAlpha
Sets opacity of bullets. Value range is 0 - 1. If not set the default value is 1.- Parameters:
bulletAlpha
- opacity of bullets- Returns:
- graph
-
getBulletBorderAlpha
- Returns:
- bullet border opacity
-
setBulletBorderAlpha
@StudioProperty(defaultValue="0") @Max(1L) @Min(0L) public T setBulletBorderAlpha(Double bulletBorderAlpha) Sets bullet border opacity. If not set the default value is 0.- Parameters:
bulletBorderAlpha
- bullet border opacity- Returns:
- graph
-
getBulletBorderColor
- Returns:
- bullet border color
-
setBulletBorderColor
Sets bullet border color. Will use lineColor if not set.- Parameters:
bulletBorderColor
- bullet border color- Returns:
- graph
-
getBulletBorderThickness
- Returns:
- bullet border thickness
-
setBulletBorderThickness
Sets bullet border thickness. If not set the default value is 2.- Parameters:
bulletBorderThickness
- bullet border thickness- Returns:
- graph
-
getBulletColor
- Returns:
- bullet color
-
setBulletColor
Sets bullet color. Will use lineColor if not set.- Parameters:
bulletColor
- bullet color- Returns:
- graph
-
getBulletField
- Returns:
- bullet field
-
setBulletField
Sets name of the bullet field from your data provider.- Parameters:
bulletField
- bullet field string- Returns:
- graph
-
getBulletOffset
- Returns:
- distance from the actual data point to the bullet
-
setBulletOffset
Sets bullet offset. Distance from the actual data point to the bullet. Can be used to place custom bullets above the columns. If not set the default value is 0.- Parameters:
bulletOffset
- bullet offset- Returns:
- graph
-
getBulletSize
- Returns:
- bullet size
-
setBulletSize
Sets bullet size. If not set the default value is 8.- Parameters:
bulletSize
- bullet size- Returns:
- graph
-
getBulletSizeField
- Returns:
- bullet size field
-
setBulletSizeField
Sets name of the bullet size field from your data provider.- Parameters:
bulletSizeField
- bullet size field string- Returns:
- graph
-
getCloseField
- Returns:
- close field
-
setCloseField
Sets name of the close field (used by candlesticks and ohlc) from your data provider.- Parameters:
closeField
- close field string- Returns:
- graph
-
getClustered
- Returns:
- true if clustered is enabled
-
setClustered
Set clustered to false if you want to place this graph's columns in front of other columns. If you set to true, the columns will be clustered next to each other. Note, clustering works only for graphs of type "column". If not set the default value is true.- Parameters:
clustered
- clustered option- Returns:
- graph
-
getColor
- Returns:
- color of value labels
-
setColor
Sets color of value labels. Will use chart's color if not set.- Parameters:
color
- color of value labels- Returns:
- graph
-
getColorField
- Returns:
- color field
-
setColorField
Sets name of the color field in your data provider.- Parameters:
colorField
- color field string- Returns:
- graph
-
getColumnWidth
- Returns:
- column relative width
-
setColumnWidth
Sets column width for each graph individually. Value range is 0 - 1 (we set relative width, not pixel width here).- Parameters:
columnWidth
- column relative width- Returns:
- graph
-
getConnect
- Returns:
- true if connect is enabled
-
setConnect
Specifies whether to connect data points if data is missing. This feature does not work with XY chart. If not set the default value is true.- Parameters:
connect
- connect option- Returns:
- graph
-
getCornerRadiusTop
- Returns:
- corner radius of column
-
setCornerRadiusTop
Sets corner 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. If not set the default value is 0.- Parameters:
cornerRadiusTop
- corner radius- Returns:
- graph
-
getCursorBulletAlpha
- Returns:
- opacity of each graphs bullet
-
setCursorBulletAlpha
@StudioProperty(defaultValue="1") @Max(1L) @Min(0L) public T setCursorBulletAlpha(Double cursorBulletAlpha) Sets opacity of each graphs bullet. If bulletsEnabled of Cursor is true, a bullet on each graph follows the cursor. In case you want to disable these bullets for a certain graph, set opacity to 0. If not set the default value is 1.- Parameters:
cursorBulletAlpha
- opacity of each graphs bullet- Returns:
- graph
-
getCustomBullet
- Returns:
- path to image of custom bullet
-
setCustomBullet
Sets path to the image of custom bullet.- Parameters:
customBullet
- path to image of custom bullet- Returns:
- graph
-
getCustomBulletField
- Returns:
- custom bullet field
-
setCustomBulletField
Sets name of the custom bullet field in your data provider.- Parameters:
customBulletField
- custom bullet field string- Returns:
- graph
-
getCustomMarker
- Returns:
- path to the image for legend marker
-
setCustomMarker
Sets path to the image for legend marker.- Parameters:
customMarker
- path to the image- Returns:
- graph
-
getDashLength
- Returns:
- dash length
-
setDashLength
Sets dash length. If you set it to a value greater than 0, the graph line (or columns border) will be dashed. If not set the default value is 0.- Parameters:
dashLength
- dash length- Returns:
- graph
-
getDashLengthField
- Returns:
- dash length field
-
setDashLengthField
Sets name of the dash length field in your data provider. dashLengthField 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 smoothedLine graph.- Parameters:
dashLengthField
- dash length field- Returns:
- graph
-
getDescriptionField
- Returns:
- description field
-
setDescriptionField
Sets name of the description field in your dataProvider.- Parameters:
descriptionField
- description field string- Returns:
- graph
-
getErrorField
- Returns:
- error field
-
setErrorField
Sets name of error value field in your data provider.- Parameters:
errorField
- error field string- Returns:
- graph
-
getFillAlphas
- Returns:
- opacity of fill
-
setFillAlphas
Sets opacity of fill.- Parameters:
fillAlphas
- opacity of fill- Returns:
- graph
-
getFillColors
- Returns:
- list of fill colors
-
setFillColors
Sets list of fill colors. Will use lineColor if not set. Set more than one color to generate the gradient.- Parameters:
fillColors
- list of fill colors- Returns:
- graph
-
getFillColorsField
- Returns:
- name of the fill colors field
-
setFillColorsField
Sets name of the fill colors field in your data provider. fillColorsField adds a possibility to change line graphs fill color on any data point to create highlighted sections of the graph. Works only withSerialChartModelImpl
.- Parameters:
fillColorsField
- name of the fill colors field- Returns:
- graph
-
getFontSize
- Returns:
- font size of value labels text
-
setFontSize
Sets size of value labels text. Will use chart's fontSize if not set.- Parameters:
fontSize
- font size- Returns:
- graph
-
getForceGap
- Returns:
- true if forceGap is enabled
-
setForceGap
Set forceGap to true if you want the graph should always break the line if the distance in time between two adjacent data points is bigger than "gapPeriod * minPeriod", even if connect property is set to true. If not set the default value is false.- Parameters:
forceGap
- force gap- Returns:
- graph
-
getGradientOrientation
- Returns:
- gradient orientation
-
setGradientOrientation
@StudioProperty(type=ENUMERATION, defaultValue="VERTICAL") public T setGradientOrientation(GradientOrientation gradientOrientation) Sets orientation of the gradient fills (only for "column" graph type). Possible values are "vertical" and "horizontal". If not set the default value is VERTICAL.- Parameters:
gradientOrientation
- gradient orientation- Returns:
- graph
-
getHidden
- Returns:
- true if graph is hidden
-
setHidden
Set hidden to true if the graph should be hidden. If not set the default value is false.- Parameters:
hidden
- hidden option- Returns:
- graph
-
getHideBulletsCount
- Returns:
- hide bullets count
-
setHideBulletsCount
Sets hide bullets count. If there are more data points than hideBulletsCount, the bullets will not be shown. 0 means the bullets will always be visible. If not set the default value is 0.- Parameters:
hideBulletsCount
- hide bullets count- Returns:
- graph
-
getHighField
- Returns:
- high field
-
setHighField
Sets name of the high field (used by candlesticks and ohlc) in your data provider.- Parameters:
highField
- high field string- Returns:
- graph
-
getId
- Returns:
- id of the graph
-
setId
Sets unique 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.- Parameters:
id
- id of the graph- Returns:
- graph
-
getIncludeInMinMax
- Returns:
- true if includeInMinMax is enabled
-
setIncludeInMinMax
Set includeInMinMax to true if this graph should be included when calculating minimum and maximum value of the axis. If not set the default value is true.- Parameters:
includeInMinMax
- include in min max option- Returns:
- graph
-
getLabelColorField
- Returns:
- label color field
-
setLabelColorField
Sets name of label color field in your data provider.- Parameters:
labelColorField
- label color field string- Returns:
- graph
-
getLabelPosition
- Returns:
- value label position
-
setLabelPosition
@StudioProperty(type=ENUMERATION, defaultValue="TOP") public T setLabelPosition(ValueLabelPosition labelPosition) Sets the position 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. If not set the default value is TOP.- Parameters:
labelPosition
- value label position- Returns:
- graph
-
getLabelText
- Returns:
- value label text
-
setLabelText
Sets value label text. You can use tags like [[value]], [[description]], [[percents]], [[open", [[category".- Parameters:
labelText
- value label text- Returns:
- graph
-
getLegendAlpha
- Returns:
- legend marker opacity
-
setLegendAlpha
Sets legend marker opacity. Will use lineAlpha if not set. Value range is 0 - 1. If not set the default value is 1.- Parameters:
legendAlpha
- legend marker opacity- Returns:
- graph
-
getLegendColor
- Returns:
- legend marker color
-
setLegendColor
Sets legend marker color. Will use lineColor if not set.- Parameters:
legendColor
- legend marker color- Returns:
- graph
-
getLegendPeriodValueText
- Returns:
- legend period value text
-
setLegendPeriodValueText
Sets the 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.sum]] means that sum of all data points of value field in the selected period will be displayed.- Parameters:
legendPeriodValueText
- legend period value text- Returns:
- graph
-
getLegendValueText
- Returns:
- legend value text
-
setLegendValueText
Sets legend value text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] You can also use custom fields from your data provider. If not set, usesAbstractLegend.valueText
.- Parameters:
legendValueText
- legend value text- Returns:
- graph
-
getLineAlpha
- Returns:
- opacity of the line (or column border)
-
setLineAlpha
Sets opacity of the line (or column border). Value range is 0 - 1.- Parameters:
lineAlpha
- opacity of the line (or column border)- Returns:
- graph
-
getLineColor
- Returns:
- color of the line (or column border)
-
setLineColor
Sets color of the line (or column border). If you do not set any, the color fromCoordinateChartModelImpl.colors
list will be used for each subsequent graph.- Parameters:
lineColor
- color of the line (or column border)- Returns:
- graph
-
getLineColorField
- Returns:
- name of the line color field
-
setLineColorField
Sets name of the line color field in your data provider. lineColorField adds a possibility to change graphs’ line color on any data point to create highlighted sections of the graph. Works only withSerialChartModelImpl
.- Parameters:
lineColorField
- name of the line color field- Returns:
- graph
-
getLineThickness
- Returns:
- thickness of the graph line (or column border)
-
setLineThickness
Sets thickness of the graph line (or column border). If not set the default value is 1.- Parameters:
lineThickness
- thickness of the graph line (or column border)- Returns:
- graph
-
getLowField
- Returns:
- low field
-
setLowField
Sets name of the low field (used by candlesticks and ohlc) in your data provider.- Parameters:
lowField
- low field string- Returns:
- graph
-
getMarkerType
- Returns:
- legend marker type
-
setMarkerType
Sets legend 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.- Parameters:
markerType
- legend marker type- Returns:
- graph
-
getMaxBulletSize
- Returns:
- maximum bullet size
-
setMaxBulletSize
Sets size of the bullet which value is the biggest (XY chart). If not set the default value is 50.- Parameters:
maxBulletSize
- maximum bullet size- Returns:
- graph
-
getMinBulletSize
- Returns:
- minimum bullet size
-
setMinBulletSize
Sets minimum size of the bullet (XY chart). If not set the default value is 4.- Parameters:
minBulletSize
- minimum bullet size- Returns:
- graph
-
getNegativeBase
- Returns:
- negative base
-
setNegativeBase
Sets different base value at which colors should be changed to negative colors if you use different colors for your negative values. If not set the default value is 0.- Parameters:
negativeBase
- negative base- Returns:
- graph
-
getNegativeFillAlphas
- Returns:
- opacity of negative part of the graph
-
setNegativeFillAlphas
Sets fill opacity of negative part of the graph. Will use fillAlphas if not set.- Parameters:
negativeFillAlphas
- negative fill alphas- Returns:
- graph
-
getNegativeFillColors
- Returns:
- negative fill colors
-
setNegativeFillColors
Sets fill color of negative part of the graph. Will use fillColors if not set.- Parameters:
negativeFillColors
- negative fill colors- Returns:
- graph
-
getNegativeLineAlpha
- Returns:
- opacity of the negative portion of the line (or column border)
-
setNegativeLineAlpha
@StudioProperty(defaultValue="1") @Max(1L) @Min(0L) public T setNegativeLineAlpha(Double negativeLineAlpha) Sets opacity of the negative portion of the line (or column border). Value range is 0 - 1. If not set the default value is 1.- Parameters:
negativeLineAlpha
- opacity- Returns:
- graph
-
getNegativeLineColor
- Returns:
- color of the line (or column) when the values are negative
-
setNegativeLineColor
Sets color 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.- Parameters:
negativeLineColor
- color- Returns:
- graph
-
getNoStepRisers
- Returns:
- true if noStepRisers is enabled
-
setNoStepRisers
Set noStepRisers to true if you want to have a step line graph without risers. If not set the default value is false.- Parameters:
noStepRisers
- noStepRisers option- Returns:
- graph
-
getOpenField
- Returns:
- open field
-
setOpenField
Sets name of the open field (used by floating columns, candlesticks and ohlc) in your data provider.- Parameters:
openField
- open field string- Returns:
- graph
-
getPattern
- Returns:
- pattern
-
setPattern
Sets pattern to the graph. 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. 3D bar/pie charts won't work properly with patterns.- Parameters:
pattern
- pattern- Returns:
- graph
-
getPatternField
- Returns:
- pattern field
-
setPatternField
Sets field name in your data provider which holds pattern information. Check amcharts/patterns folder for some patterns. You can create your own patterns and use them. 3D bar/Pie charts won't work properly with patterns.- Parameters:
patternField
- pattern field string- Returns:
- graph
-
getPeriodSpan
- Returns:
- period span
-
setPeriodSpan
Sets how many periods one horizontal line should span. periodSpan can be used by step graphs. If not set the default value is 1.- Parameters:
periodSpan
- period span- Returns:
- graph
-
getPointPosition
- Returns:
- point position
-
setPointPosition
@StudioProperty(type=ENUMERATION, defaultValue="MIDDLE") public T setPointPosition(PointPosition 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). This setting affects Serial chart only. Possible values are "start", "middle" and "end". If not set the default value is MIDDLE.- Parameters:
pointPosition
- point position- Returns:
- graph
-
getShowAllValueLabels
- Returns:
- true if showAllValueLabels is enabled
-
setShowAllValueLabels
If 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. If not set the default value is false.- Parameters:
showAllValueLabels
- show all value labels option- Returns:
- graph
-
getShowBalloon
- Returns:
- true if showBalloon is enabled
-
setShowBalloon
Set showBalloon to true if the value balloon of this graph should be shown when mouse is over data item or chart's indicator is over some series. If not set the default value is true.- Parameters:
showBalloon
- show balloon option- Returns:
- graph
-
getShowBalloonAt
- Returns:
- graphs value at which cursor is shown
-
setShowBalloonAt
@StudioProperty(type=ENUMERATION, defaultValue="CLOSE") public T setShowBalloonAt(ShowPositionOnCandle showBalloonAt) Specifies graphs value at which cursor is shown. 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. If not set the default value is CLOSE.- Parameters:
showBalloonAt
- graphs value at which cursor is shown- Returns:
- graph
-
getShowHandOnHover
- Returns:
- true if mouse pointer changes to hand when hovering the graph
-
setShowHandOnHover
Set showHandOnHover to true if you want mouse pointer to change to hand when hovering the graph. If not set the default value is false.- Parameters:
showHandOnHover
- showHandOnHover option- Returns:
- graph
-
getStackable
- Returns:
- true if this graph included to stacking.
-
setStackable
Set stackable to false if you want exclude this graph from stacking. Note, the value axis of this graph should has stack types like "regular" or "100%". If not set the default value is true.- Parameters:
stackable
- stackable option- Returns:
- graph
-
getStepDirection
- Returns:
- step direction
-
setStepDirection
@StudioProperty(type=ENUMERATION, defaultValue="RIGHT") public T setStepDirection(StepDirection stepDirection) Specifies to which direction step should be drawn. Step graph only. If not set the default value is RIGHT.- Parameters:
stepDirection
- step direction- Returns:
- graph
-
getUrlField
- Returns:
- the URL field
-
setUrlField
Sets name of the URL field in your data provider.- Parameters:
urlField
- the URL field string- Returns:
- graph
-
getUrlTarget
- Returns:
- the URL target
-
setUrlTarget
@StudioProperty(type=OPTIONS, options={"_blank","_parent","_self","_top"}) public T setUrlTarget(String urlTarget) Sets target to open URLs in, i.e. "_blank", "_top", etc.- Parameters:
urlTarget
- the URL target- Returns:
- graph
-
getUseNegativeColorIfDown
- Returns:
- true if graphs uses negative colors for lines, bullets or columns if previous value is bigger than current value
-
setUseNegativeColorIfDown
@StudioProperty(defaultValue="false") public T setUseNegativeColorIfDown(Boolean useNegativeColorIfDown) If negativeLineColor and/or negativeFillColors are set and useNegativeColorIfDown is set to true, 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. If not set the default value is false.- Parameters:
useNegativeColorIfDown
- useNegativeColorIfDown option- Returns:
- graph
-
getVisibleInLegend
- Returns:
- true if the graph should be shown in the legend
-
setVisibleInLegend
Set visibleInLegend to false if the graph shouldn't be shown in theLegend
. If not set the default value is true.- Parameters:
visibleInLegend
- visible in legend option- Returns:
- graph
-
getBulletAxis
- Returns:
- bullet axis
-
setBulletAxis
bulletAxis 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.- Parameters:
bulletAxis
- bullet axis- Returns:
- graph
-
getValueAxis
- Returns:
- value axis id
-
setValueAxis
Specifies which value axis the graph will use. Will use the first value axis if not set. You can set value axis id.- Parameters:
valueAxis
- value axis id- Returns:
- graph
-
getXAxis
- Returns:
- horizontal value axis id
-
setXAxis
Sets a horizontal value axis to attach graph to. XY chart only.- Parameters:
xAxis
- horizontal value axis id- Returns:
- graph
-
getYAxis
- Returns:
- vertical value axis id
-
setYAxis
Sets a vertical value axis id to attach graph to. XY chart only.- Parameters:
yAxis
- vertical value axis id- Returns:
- graph
-
getBalloonFunction
- Returns:
- JS function, the graph will call
-
setBalloonFunction
Sets JS 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.- Parameters:
balloonFunction
- JS function- Returns:
- graph
-
getFillToGraph
- Returns:
- fill to graph
-
setFillToGraph
You can set another graph here and if fillAlpha is greater than 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.- Parameters:
fillToGraph
- fill to graph- Returns:
- graph
-
getFillToAxis
- Returns:
- id of axis
-
setFillToAxis
XY chart only. If you set this property to id of your X or Y axis, and the fillAlphas is greater than 0, the area between graph and axis will be filled with color.- Parameters:
fillToAxis
- id of axis- Returns:
- graph
-
getFixedColumnWidth
- Returns:
- column width, in pixels
-
setFixedColumnWidth
Sets column width, in pixels. If you set this property, columns will be of a fixed width and won't adjust to the available space.- Parameters:
fixedColumnWidth
- column width- Returns:
- graph
-
getGapField
- Returns:
- gap field
-
setGapField
Sets name of the gap field in your data provider. You can force graph to show gap at a desired data point using this feature. This feature does not work with XY chart.- Parameters:
gapField
- gap field string- Returns:
- graph
-
getGapPeriod
- Returns:
- gap period
-
setGapPeriod
Specifies 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. If not set the default value is 1.1.- Parameters:
gapPeriod
- gap period- Returns:
- graph
-
getLabelAnchor
- Returns:
- label anchor
-
setLabelAnchor
Sets data label text anchor. If not set the default value is "auto".- Parameters:
labelAnchor
- label anchor string- Returns:
- graph
-
getLabelFunction
- Returns:
- label function
-
setLabelFunction
Sets JS function 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.- Parameters:
labelFunction
- label function- Returns:
- graph
-
getLabelOffset
-
setLabelOffset
Sets offset of data label. If not set the default value is 0.- Parameters:
labelOffset
- label offset- Returns:
- graph
-
getMinDistance
- Returns:
- minimum distance, in pixels
-
setMinDistance
Sets minimum distance. Based on this property the graph will omit some of the lines (if the distance between points is less that minDistance, in pixels). It is useful if you have really lots of data points. 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. If not set the default value is 1.- Parameters:
minDistance
- minimum distance, in pixels- Returns:
- graph
-
getNewStack
- Returns:
- true if newStack is enabled
-
setNewStack
Set newStack to true if column chart should begin new stack. This allows having Clustered and Stacked column/bar chart. If not set the default value is false.- Parameters:
newStack
- newStack option- Returns:
- graph
-
getShowBulletsAt
- Returns:
- position on candle
-
setShowBulletsAt
@StudioProperty(type=ENUMERATION, defaultValue="CLOSE") public T setShowBulletsAt(ShowPositionOnCandle showBulletsAt) Works 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. If not set the default value is CLOSE.- Parameters:
showBulletsAt
- position on candle- Returns:
- graph
-
getShowOnAxis
- Returns:
- true if showOnAxis is enabled
-
setShowOnAxis
If you set showOnAxis to true, the cylinder will be lowered down so that the center of it's bottom circle would be right on category axis. It can only be used together with topRadius (when columns look like cylinders). If not set the default value is false.- Parameters:
showOnAxis
- showOnAxis option- Returns:
- graph
-
getSwitchable
- Returns:
- true if the graph will be hidden by user clicks on legend entry
-
setSwitchable
If you set switchable to false, the graph will not be hidden when user clicks on legend entry. If not set the default value is true.- Parameters:
switchable
- switchable option- Returns:
- graph
-
getTopRadius
- Returns:
- top radius
-
setTopRadius
If you set this to 1, columns will become cylinders (must set depth3D and angle properties of a chart to greater than 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). It is strongly recommend setting grid opacity to 0 in order this to look good.- Parameters:
topRadius
- top radius- Returns:
- graph
-
getDateFormat
- Returns:
- date format for balloons
-
setDateFormat
Sets date format. Used to format balloons if value axis is date-based. If not set the default value is "MMM DD, YYYY".- Parameters:
dateFormat
- date format- Returns:
- graph
-
getLabelRotation
- Returns:
- label rotation
-
setLabelRotation
Sets the rotation of a data label. If not set the default value is 0.- Parameters:
labelRotation
- label rotation- Returns:
- graph
-
getPrecision
- Returns:
- precision of values
-
setPrecision
Sets precision of values. Will use chart's precision if not set any.- Parameters:
precision
- precision- Returns:
- graph
-
getProCandlesticks
- Returns:
- true if proCandlesticks is enabled
-
setProCandlesticks
If proCandlesticks 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. If not set the default value is false.- Parameters:
proCandlesticks
- proCandlesticks option- Returns:
- graph
-
getUseLineColorForBulletBorder
- Returns:
- true if bullet border should take the same color as graph line
-
setUseLineColorForBulletBorder
@StudioProperty(defaultValue="false") public T setUseLineColorForBulletBorder(Boolean useLineColorForBulletBorder) If set to true, the bullet border will take the same color as graph line. If not set the default value is false.- Parameters:
useLineColorForBulletBorder
- useLineColorForBulletBorder option- Returns:
- graph
-
getAccessibleLabel
- Returns:
- accessible label
-
setAccessibleLabel
@StudioProperty(defaultValue="[[title]] [[category]] [[value]]") public T setAccessibleLabel(String accessibleLabel) Sets text 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 graph is set to some number). Text is added as aria-label. Note - not all screen readers and browsers support this. If not set the default value is "[[title]] [[category]] [[value]]".- Parameters:
accessibleLabel
- accessible label string- Returns:
- graph
-
getBalloon
- Returns:
- balloon of the graph
-
setBalloon
Sets the balloon to the graph. Allows customizing graphs balloons individually (only whenCursor
is used).- Parameters:
balloon
- balloon- Returns:
- graph
-
getBulletHitAreaSize
- Returns:
- bullet hit area size
-
setBulletHitAreaSize
Sets bullet hit area size. Useful 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).- Parameters:
bulletHitAreaSize
- bullet hit area size- Returns:
- graph
-
getClassNameField
- Returns:
- CSS class name field
-
setClassNameField
Sets CSS class name field. If classNameField is set and addClassNames is enabled, the chart will look for a CSS class name string in data using this setting and apply additional class names to elements of the particular data points, such as bullets.- Parameters:
classNameField
- class name field string- Returns:
- graph
-
getWiredFields
- Returns:
- fields of the
DataItem
that are bound to the graph
-
getLegendColorFunction
- Returns:
- JS function to handle legend marker color
-
setLegendColorFunction
Sets JS function to handle legend marker color. It is called and the following attributes are passed: dataItem, formattedText, periodValues, periodPercentValues. It should return hex color code which will be used for legend marker.- Parameters:
legendColorFunction
- legend color function- Returns:
- graph
-
getTabIndex
- Returns:
- tab index
-
setTabIndex
In 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 graph. Note, not all browsers and readers support this.- Parameters:
tabIndex
- tab index- Returns:
- graph
-
getColumnIndexField
- Returns:
- column index field
-
setColumnIndexField
Specifies order of columns of each category (starting from 0).You can use this property with non-stacked column graphs. Important, this feature does not work in stacked columns scenarios as well as with graph toggling enabled in legend.- Parameters:
columnIndexField
- column index field string- Returns:
- graph
-