Class Plot

java.lang.Object
com.motivewave.platform.sdk.study.Plot
All Implemented Interfaces:
Cloneable

public class Plot extends Object implements Cloneable
Represents a plot area within the chart where lines, bars, figures etc may be drawn. A plot may have a label as well as top and bottom insets.
  • Field Details

    • PRICE

      public static final String PRICE
      Plot for the Price Graph. This may be used for overlays. Note: If the study is an overlay, this will be the default plot.
      See Also:
    • DEFAULT

      public static final String DEFAULT
      Default plot for studies that are not overlays. If the study is an overlay, this will point to the PRICE_PLOT.
      See Also:
  • Constructor Details

    • Plot

      public Plot()
  • Method Details

    • getName

      public String getName()
      Gets the name of this plot (human readable).
      Returns:
      name of the plot
    • setName

      public void setName(String name)
      Sets the name of this plot (human readable).
      Parameters:
      name - name of this plot
    • getLabelPrefix

      public String getLabelPrefix()
      Gets the label prefix.
      Returns:
      label prefix
    • setLabelPrefix

      public void setLabelPrefix(String label)
      Sets the label prefix for this plot.
      Parameters:
      label - label prefix
    • setLabelSettings

      public void setLabelSettings(String... vals)
      Use this method to identify which settings should be part of the plot label (and to identify the study).
      Parameters:
      vals - label setting values
    • getLabelSettings

      public List<String> getLabelSettings()
      Gets the set of settings that are part of the label for the plot.
      Returns:
      set of label settings
    • setIDSettings

      public void setIDSettings(String... vals)
      Use this method to identify which settings should be part of the plot identifier. By default, the label settings will be used. Use this to override the label settings.
      Parameters:
      vals - ID setting values
    • getIDSettings

      public List<String> getIDSettings()
      Gets the set of settings that are part of the ID for the plot. By default, this will return the label settings.
      Returns:
      set of ID settings
    • getTabName

      public String getTabName()
      Gets the name to display in the tab for this plot.
      Returns:
      tab name
    • setTabName

      public void setTabName(String name)
      Sets the name to display in the tab for this plot.
      Parameters:
      name - tab name
    • isShowLabel

      public boolean isShowLabel()
      Determins if the labe should be shown for this plot.
      Returns:
      true if the label should be shown for this plot.
    • setShowLabel

      public void setShowLabel(boolean b)
      Sets the flag for showing the label for this plot.
      Parameters:
      b - true if the label should be shown
    • setRangeKeys

      public void setRangeKeys(Object... keys)
      Use this method to identify the numeric values generated by this study that are to affect the vertical range of the plot (when auto scale is turned on).
      Parameters:
      keys - range keys
    • getRangeKeys

      public List<Object> getRangeKeys()
      Gets the keys of the values used to affect the vertical range of the plot.
      Returns:
      list of range key objects
    • declarePath

      public void declarePath(Object valueKey, String pathSettingsKey)
      Declare a path associated with the given value key. Settings for the path are resolved using the pathSettingsKey. At runtime a path will be drawn (if enabled) using the values defined by the valueKey.
      Parameters:
      valueKey - key of the series of values for the path
      pathSettingsKey - settings key of the path
    • clearPaths

      public void clearPaths()
      Clears the declared paths.
    • declarePriceBar

      public void declarePriceBar(Object valueKey, String priceBarKey)
      Declare a price bar associated with the given value key. Settings for the path are resolved using the priceBarKey. At runtime price bars will be drawn (if enabled) using the values defined by the valueKey.
      Parameters:
      valueKey - key of the series of values for the price bar
      priceBarKey - settings key of the price bar
    • clearPriceBars

      public void clearPriceBars()
      Clears the declared price bars.
    • declareIndicator

      public void declareIndicator(Object valueKey, String indicatorKey)
      Associates a value key to an indicator.
      Parameters:
      valueKey - key of the value for the indicator
      indicatorKey - settings key for the indicator
    • clearIndicators

      public void clearIndicators()
      Clears the declared indicators.
    • declareBars

      public void declareBars(Object valueKey, String settingsKey)
      Declare a bar sequence associated with the given value key. Settings for the bars are resolved using the pathSettingsKey. At runtime a set of bars will be drawn (if enabled) using the values defined by the valueKey.
      Parameters:
      valueKey - key of the series of values for the bars
      settingsKey - settings key for the bars
    • declareBars

      public void declareBars(Object valueKey)
      Declare bar sequence using the default settings for drawing bars.
      Parameters:
      valueKey - key of the series of values for the bars
    • clearBars

      public void clearBars()
      Clears the declared bars.
    • declareGuide

      public void declareGuide(String settingsKey)
      Declare a guide to be displayed on this plot.
      Parameters:
      settingsKey - setting key for the guide
    • clearGuides

      public void clearGuides()
      Clears the declared guides.
    • addHorizontalLine

      public void addHorizontalLine(LineInfo info)
      Adds a horizontal line to the graph using the information defined in LineInfo.
      Parameters:
      info - line info object
    • clearHorizontalLines

      public void clearHorizontalLines()
      Removes all of the horizontal lines.
    • getTopInsetPixels

      public int getTopInsetPixels()
      Gets the top inset for the graph (in pixels).
      Returns:
      top inset pixels
    • setTopInsetPixels

      public void setTopInsetPixels(int pixels)
      Sets the top inset for the graph (in pixels).
      Parameters:
      pixels - pixels for the top inset
    • getBottomInsetPixels

      public int getBottomInsetPixels()
      Gets the bottom inset for the graph (in pixels).
      Returns:
      bottom inset pixels
    • setBottomInsetPixels

      public void setBottomInsetPixels(int pixels)
      Sets the bottom inset for the graph (in pixels).
      Parameters:
      pixels - pixels for the bottom inset
    • getFixedBottomValue

      public Integer getFixedBottomValue()
      Gets the 'fixed' bottom value (null if not defined). This value is used to determine the range of the graph (bottom of the vertical axis).
      Returns:
      fixed bottom value
    • setFixedBottomValue

      public void setFixedBottomValue(Integer value)
      Sets the 'fixed' bottom value (null if not defined). This value is used to determine the range of the graph (bottom of the vertical axis).
      Parameters:
      value - fixed bottom value
    • getFixedTopValue

      public Integer getFixedTopValue()
      Gets the 'fixed' top value (null if not defined). This value is used to determine the range of the graph (top of the vertical axis).
      Returns:
      fixed top value
    • setFixedTopValue

      public void setFixedTopValue(Integer value)
      Sets the 'fixed' top value (null if not defined). This value is used to determine the range of the graph (top of the vertical axis).
      Parameters:
      value - fixed top value
    • getMaxBottomValue

      public Integer getMaxBottomValue()
      Gets the 'maximum' bottom value (null if not defined). This value is used to determine the range of the graph (bottom of the vertical axis).
      Returns:
      maximum bottom value
    • setMaxBottomValue

      public void setMaxBottomValue(Integer value)
      Sets the 'maximum' bottom value (null if not defined). This value is used to determine the range of the graph (bottom of the vertical axis).
      Parameters:
      value - maximum bottom value
    • getMinTopValue

      public Integer getMinTopValue()
      Gets the 'minimum' top value (null if not defined). This value is used to determine the range of the graph (top of the vertical axis).
      Returns:
      minimum top value
    • setMinTopValue

      public void setMinTopValue(Integer value)
      Sets the 'minimum' top value (null if not defined). This value is used to determine the range of the graph (top of the vertical axis).
      Parameters:
      value - minimum top value
    • getMinTick

      public Double getMinTick()
      Gets the minimum tick value for the vertical axis (if this is not an overlay). Null is return if this value should be calculated automatically
      Returns:
      minimum tick
    • setMinTick

      public void setMinTick(Double minTick)
      Sets the minimum tick for the vertical axis (if this is not an overlay). Set to null (default) to automatically detect the min value.
      Parameters:
      minTick - minimum tick
    • getHorizontalLines

      public List<LineInfo> getHorizontalLines()
      Gets the list of horizontal lines declared for this plot.
      Returns:
      list of horizontal lines declared for this plot.
    • getPaths

      public Map<Object,String> getPaths()
      Gets the set of declared paths (a map of value key to settings key).
      Returns:
      map of declared paths
    • getPriceBars

      public Map<Object,String> getPriceBars()
      Gets the set of declared price bars (a map of value key to settings key).
      Returns:
      map of declared price bars
    • getIndicators

      public Map<Object,String> getIndicators()
      Gets the set of declared indicators (a map of value key to settings key).
      Returns:
      map of declared indicators
    • getBars

      public Map<Object,String> getBars()
      Gets the set of declared bars (a map of value key to settings key).
      Returns:
      map of declared bars
    • getGuides

      public Set<String> getGuides()
      Gets the set of declared guides (a map of value key to settings key).
      Returns:
      set of declared guides
    • isFormatMK

      public boolean isFormatMK()
      Determines if this study allows formatting values using shortened versions (ie: 10000 is 10K, 10000000 is 10M).
      Returns:
      true if this study allows formatting values using shortened versions (ie: 10000 is 10K, 10000000 is 10M).
    • setFormatMK

      public void setFormatMK(boolean b)
      Sets the flag for formatting shortened version of values (ie: 10000 is 10K, 10000000 is 10M).
      Parameters:
      b - true if MK formatting should be used
    • isAllowInsetModification

      public boolean isAllowInsetModification()
      Determines if the user is allowed to modify insets for this study (non-overlays only, true by default).
      Returns:
      true if the user is allowed to modify insets for this study (non-overlays only, true by default).
    • setAllowInsetModification

      public void setAllowInsetModification(boolean b)
      Sets the flag for determining if the user can modify the insets for this study (non-overlays only).
      Parameters:
      b - true if the use can modify insets.
    • isAllowDisable

      public boolean isAllowDisable()
      Determines if the user is allowed to disable (hide) this plot.
      Returns:
      true if the user is allowed to disable (hide) this plot.
    • setAllowDisable

      public void setAllowDisable(boolean b)
      Sets the the ability for the user to disable (hide) this plot.
      Parameters:
      b - true if the user is allowed to disable this plot.
    • isEnabled

      public boolean isEnabled()
      Determines if this plot is enabled.
      Returns:
      true if this plot is enabled (displayed to the user).
    • setEnabled

      public void setEnabled(boolean b)
      Sets the flag for enabling this plot. If false, this plot will not be displayed.
      Parameters:
      b - true if this plot is enabled
    • clone

      public Plot clone()
      Creates a clone (copy) of this object.
      Overrides:
      clone in class Object
      Returns:
      clone of this object