Class StockGraph

All Implemented Interfaces:
Serializable

public class StockGraph extends AbstractGraph<StockGraph>
StockGraph displays graphs on StockPanel.
See documentation for properties of StockGraph JS object.
http://docs.amcharts.com/3/javascriptstockchart/StockGraph
See Also:
  • Constructor Details

    • StockGraph

      public StockGraph()
  • Method Details

    • getComparable

      public Boolean getComparable()
      Returns:
      true if this graph is compared
    • setComparable

      @StudioProperty(defaultValue="false") public StockGraph setComparable(Boolean comparable)
      Sets comparable to true if this graph should be compared if some data set is selected for comparing. If not set the default value is false.
      Parameters:
      comparable - comparable option
      Returns:
      stock graph
    • getCompareField

      public String getCompareField()
      Returns:
      field that is used to generate comparing the graph
    • setCompareField

      @StudioProperty public StockGraph setCompareField(String compareField)
      Sets the field to be used to generate comparing the graph. Note, this field is not the one used in your data provider, but toField from FieldMapping object.
      Parameters:
      compareField - compare field
      Returns:
      stock graph
    • getCompareFromStart

      public Boolean getCompareFromStart()
      Returns:
      true if compareFromStart is enabled
    • setCompareFromStart

      @StudioProperty(defaultValue="false") public StockGraph setCompareFromStart(Boolean compareFromStart)
      Set compareFromStart to true if the graphs should use first value as a base value instead of using the first value of selected period when data sets are compared. If not set the default value is false.
      Parameters:
      compareFromStart - compareFromStart option
      Returns:
      stock graph
    • getCompareGraph

      public Graph getCompareGraph()
      Returns:
      config of compared graphs
    • setCompareGraph

      public StockGraph setCompareGraph(Graph compareGraph)
      Sets config of compared graphs. This allows you to set any of Graph properties on compared graphs instead of using old-style properties like compareGraphBulletBorderThickness.
      Parameters:
      compareGraph - graph
      Returns:
      stock graph
    • getCompareGraphBalloonColor

      public Color getCompareGraphBalloonColor()
      Returns:
      balloon color of comparing graph
    • setCompareGraphBalloonColor

      @StudioProperty(type=OPTIONS) public StockGraph setCompareGraphBalloonColor(Color compareGraphBalloonColor)
      Sets balloon color of comparing graph.
      Parameters:
      compareGraphBalloonColor - color
      Returns:
      stock graph
    • getCompareGraphBalloonFunction

      public JsFunction getCompareGraphBalloonFunction()
      Returns:
      JS function
    • setCompareGraphBalloonFunction

      public StockGraph setCompareGraphBalloonFunction(JsFunction compareGraphBalloonFunction)
      Sets JS 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.
      Parameters:
      compareGraphBalloonFunction - JS function
      Returns:
      stock graph
    • getCompareGraphBalloonText

      public String getCompareGraphBalloonText()
      Returns:
      balloon text of comparing graph
    • setCompareGraphBalloonText

      @StudioProperty public StockGraph setCompareGraphBalloonText(String compareGraphBalloonText)
      Sets balloon text of comparing graph.
      Parameters:
      compareGraphBalloonText - text
      Returns:
      stock graph
    • getCompareGraphBullet

      public String getCompareGraphBullet()
      Returns:
      bullet of comparing graph
    • setCompareGraphBullet

      @StudioProperty(type=OPTIONS, options={"round","square","diamond","triangleUp","triangleDown","triangleLeft","triangleRight","bubble"}) public StockGraph setCompareGraphBullet(String compareGraphBullet)
      Sets bullet of comparing graph. Possible values are: round, square, diamond, triangleUp, triangleDown, triangleLeft, triangleRight, bubble
      Parameters:
      compareGraphBullet - compare graph bullet string
      Returns:
      stock graph
    • getCompareGraphBulletBorderAlpha

      public Double getCompareGraphBulletBorderAlpha()
      Returns:
      opacity of bullet border of comparing graph
    • setCompareGraphBulletBorderAlpha

      @StudioProperty @Max(1L) @Min(0L) public @Max(1L) @Min(0L) StockGraph setCompareGraphBulletBorderAlpha(Double compareGraphBulletBorderAlpha)
      Sets opacity of bullet border of comparing graph.
      Parameters:
      compareGraphBulletBorderAlpha - opacity
      Returns:
      stock graph
    • getCompareGraphBulletBorderColor

      public Color getCompareGraphBulletBorderColor()
      Returns:
      color of bullet border of comparing graph
    • setCompareGraphBulletBorderColor

      @StudioProperty(type=OPTIONS) public StockGraph setCompareGraphBulletBorderColor(Color compareGraphBulletBorderColor)
      Sets color of bullet border of comparing graph.
      Parameters:
      compareGraphBulletBorderColor - color
      Returns:
      stock graph
    • getCompareGraphBulletBorderThickness

      public Integer getCompareGraphBulletBorderThickness()
      Returns:
      thickness of bullet border of comparing graph
    • setCompareGraphBulletBorderThickness

      @StudioProperty public StockGraph setCompareGraphBulletBorderThickness(Integer compareGraphBulletBorderThickness)
      Sets thickness of bullet border of comparing graph.
      Parameters:
      compareGraphBulletBorderThickness - thickness
      Returns:
      stock graph
    • getCompareGraphBulletColor

      public Color getCompareGraphBulletColor()
      Returns:
      color of compared graphs bullets
    • setCompareGraphBulletColor

      @StudioProperty(type=OPTIONS) public StockGraph setCompareGraphBulletColor(Color compareGraphBulletColor)
      Sets color of compared graphs bullets.
      Parameters:
      compareGraphBulletColor - color
      Returns:
      stock graph
    • getCompareGraphBulletSize

      public Integer getCompareGraphBulletSize()
      Returns:
      bullet size of comparing graph
    • setCompareGraphBulletSize

      @StudioProperty public StockGraph setCompareGraphBulletSize(Integer compareGraphBulletSize)
      Sets bullet size of comparing graph.
      Parameters:
      compareGraphBulletSize - bullet size
      Returns:
      stock graph
    • getCompareGraphCornerRadiusTop

      public Integer getCompareGraphCornerRadiusTop()
      Returns:
      corner radius of comparing graph
    • setCompareGraphCornerRadiusTop

      @StudioProperty public StockGraph setCompareGraphCornerRadiusTop(Integer compareGraphCornerRadiusTop)
      Sets corner radius of comparing graph (if type is "column").
      Parameters:
      compareGraphCornerRadiusTop - corner radius
      Returns:
      stock graph
    • getCompareGraphDashLength

      public Integer getCompareGraphDashLength()
      Returns:
      dash length of compare graph
    • setCompareGraphDashLength

      @StudioProperty public StockGraph setCompareGraphDashLength(Integer compareGraphDashLength)
      Sets dash length of compare graph.
      Parameters:
      compareGraphDashLength - dash length
      Returns:
      stock graph
    • getCompareGraphFillAlphas

      public Double getCompareGraphFillAlphas()
      Returns:
      fill alpha of comparing graph
    • setCompareGraphFillAlphas

      @StudioProperty @Max(1L) @Min(0L) public @Max(1L) @Min(0L) StockGraph setCompareGraphFillAlphas(Double compareGraphFillAlphas)
      Sets fill alpha of comparing graph.
      Parameters:
      compareGraphFillAlphas - fill alpha
      Returns:
      stock graph
    • getCompareGraphFillColors

      public List<Color> getCompareGraphFillColors()
      Returns:
      list of fill colors of comparing graph
    • setCompareGraphFillColors

      public StockGraph setCompareGraphFillColors(List<Color> compareGraphFillColors)
      Sets list of fill colors of comparing graph.
      Parameters:
      compareGraphFillColors - list of fill colors
      Returns:
      stock graph
    • getCompareGraphLineAlpha

      public Double getCompareGraphLineAlpha()
      Returns:
      opacity of comparing graph line
    • setCompareGraphLineAlpha

      @StudioProperty @Max(1L) @Min(0L) public @Max(1L) @Min(0L) StockGraph setCompareGraphLineAlpha(Double compareGraphLineAlpha)
      Sets opacity of comparing graph line.
      Parameters:
      compareGraphLineAlpha - opacity
      Returns:
      stock graph
    • getCompareGraphLineColor

      public Color getCompareGraphLineColor()
      Returns:
      color of compare graph
    • setCompareGraphLineColor

      @StudioProperty(type=OPTIONS) public StockGraph setCompareGraphLineColor(Color compareGraphLineColor)
      Sets color of compare graph (by default data set color is used).
      Parameters:
      compareGraphLineColor - color
      Returns:
      stock graph
    • getCompareGraphLineThickness

      public Integer getCompareGraphLineThickness()
      Returns:
      thickness of compare graph
    • setCompareGraphLineThickness

      @StudioProperty public StockGraph setCompareGraphLineThickness(Integer compareGraphLineThickness)
      Sets thickness of compare graph.
      Parameters:
      compareGraphLineThickness - thickness
      Returns:
      stock graph
    • getCompareGraphType

      public GraphType getCompareGraphType()
      Returns:
      type of comparing graph
    • setCompareGraphType

      @StudioProperty(type=ENUMERATION, defaultValue="LINE") public StockGraph setCompareGraphType(GraphType compareGraphType)
      Sets type of comparing graph. Possible values are: "line", "column", "step", "smoothedLine". If not set the default value is LINE.
      Parameters:
      compareGraphType - type
      Returns:
      stock graph
    • getCompareGraphVisibleInLegend

      public Boolean getCompareGraphVisibleInLegend()
      Returns:
      true if compare graph is visible in legend
    • setCompareGraphVisibleInLegend

      @StudioProperty(defaultValue="true") public StockGraph setCompareGraphVisibleInLegend(Boolean compareGraphVisibleInLegend)
      Set compareGraphVisibleInLegend to false if compare graph shouldn't be visible in legend. If not set the default value is true.
      Parameters:
      compareGraphVisibleInLegend - compareGraphVisibleInLegend option
      Returns:
      stock graph
    • getPeriodValue

      public StockGraphValue getPeriodValue()
      Returns:
      period value
    • setPeriodValue

      @StudioProperty(type=ENUMERATION) public StockGraph setPeriodValue(StockGraphValue periodValue)
      Sets period value. When data is grouped to periods, the graph must know which period value should be used.
      Parameters:
      periodValue - period value
      Returns:
      stock graph
    • getRecalculateValue

      public StockGraphValue getRecalculateValue()
      Returns:
      recalculate value
    • setRecalculateValue

      @StudioProperty(type=ENUMERATION) public StockGraph setRecalculateValue(StockGraphValue recalculateValue)
      Sets recalculate value. Possible values are "open", "close", "high", "low", "average" and "sum". There is no default value set – graph uses its 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.
      Parameters:
      recalculateValue - recalculate value
      Returns:
      stock graph
    • getShowEventsOnComparedGraphs

      public Boolean getShowEventsOnComparedGraphs()
      Returns:
      true if events of compared graphs is shown
    • setShowEventsOnComparedGraphs

      @StudioProperty(defaultValue="false") public StockGraph setShowEventsOnComparedGraphs(Boolean showEventsOnComparedGraphs)
      Set showEventsOnComparedGraphs to true if events of compared graphs should be shown. If not set the default value is false.
      Parameters:
      showEventsOnComparedGraphs - showEventsOnComparedGraphs option
      Returns:
      stock graph
    • getUseDataSetColors

      public Boolean getUseDataSetColors()
      Returns:
      true if data set color is used as this graph's lineColor
    • setUseDataSetColors

      @StudioProperty(defaultValue="true") public StockGraph setUseDataSetColors(Boolean useDataSetColors)
      Specifies 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. If not set the default value is true.
      Parameters:
      useDataSetColors - useDataSetColors option
      Returns:
      stock graph
    • getWiredFields

      public List<String> getWiredFields()
      Overrides:
      getWiredFields in class AbstractGraph<StockGraph>
      Returns:
      fields of the DataItem that are bound to the graph