Class Plot
java.lang.Object
com.motivewave.platform.sdk.study.Plot
- All Implemented Interfaces:
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addHorizontalLine
(LineInfo info) Adds a horizontal line to the graph using the information defined in LineInfo.void
Clears the declared bars.void
Clears the declared guides.void
Removes all of the horizontal lines.void
Clears the declared indicators.void
Clears the declared paths.void
Clears the declared price bars.clone()
Creates a clone (copy) of this object.void
declareBars
(Object valueKey) Declare bar sequence using the default settings for drawing bars.void
declareBars
(Object valueKey, String settingsKey) Declare a bar sequence associated with the given value key.void
declareGuide
(String settingsKey) Declare a guide to be displayed on this plot.void
declareIndicator
(Object valueKey, String indicatorKey) Associates a value key to an indicator.void
declarePath
(Object valueKey, String pathSettingsKey) Declare a path associated with the given value key.void
declarePriceBar
(Object valueKey, String priceBarKey) Declare a price bar associated with the given value key.getBars()
Gets the set of declared bars (a map of value key to settings key).int
Gets the bottom inset for the graph (in pixels).Gets the 'fixed' bottom value (null if not defined).Gets the 'fixed' top value (null if not defined).Gets the set of declared guides (a map of value key to settings key).Gets the list of horizontal lines declared for this plot.Gets the set of settings that are part of the ID for the plot.Gets the set of declared indicators (a map of value key to settings key).Gets the label prefix.Gets the set of settings that are part of the label for the plot.Gets the 'maximum' bottom value (null if not defined).Gets the minimum tick value for the vertical axis (if this is not an overlay).Gets the 'minimum' top value (null if not defined).getName()
Gets the name of this plot (human readable).getPaths()
Gets the set of declared paths (a map of value key to settings key).Gets the set of declared price bars (a map of value key to settings key).Gets the keys of the values used to affect the vertical range of the plot.Gets the name to display in the tab for this plot.int
Gets the top inset for the graph (in pixels).boolean
Determines if the user is allowed to disable (hide) this plot.boolean
Determines if the user is allowed to modify insets for this study (non-overlays only, true by default).boolean
Determines if this plot is enabled.boolean
Determines if this study allows formatting values using shortened versions (ie: 10000 is 10K, 10000000 is 10M).boolean
Determins if the labe should be shown for this plot.void
setAllowDisable
(boolean b) Sets the the ability for the user to disable (hide) this plot.void
setAllowInsetModification
(boolean b) Sets the flag for determining if the user can modify the insets for this study (non-overlays only).void
setBottomInsetPixels
(int pixels) Sets the bottom inset for the graph (in pixels).void
setEnabled
(boolean b) Sets the flag for enabling this plot.void
setFixedBottomValue
(Integer value) Sets the 'fixed' bottom value (null if not defined).void
setFixedTopValue
(Integer value) Sets the 'fixed' top value (null if not defined).void
setFormatMK
(boolean b) Sets the flag for formatting shortened version of values (ie: 10000 is 10K, 10000000 is 10M).void
setIDSettings
(String... vals) Use this method to identify which settings should be part of the plot identifier.void
setLabelPrefix
(String label) Sets the label prefix for this plot.void
setLabelSettings
(String... vals) Use this method to identify which settings should be part of the plot label (and to identify the study).void
setMaxBottomValue
(Integer value) Sets the 'maximum' bottom value (null if not defined).void
setMinTick
(Double minTick) Sets the minimum tick for the vertical axis (if this is not an overlay).void
setMinTopValue
(Integer value) Sets the 'minimum' top value (null if not defined).void
Sets the name of this plot (human readable).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).void
setShowLabel
(boolean b) Sets the flag for showing the label for this plot.void
setTabName
(String name) Sets the name to display in the tab for this plot.void
setTopInsetPixels
(int pixels) Sets the top inset for the graph (in pixels).
-
Field Details
-
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
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
Gets the name of this plot (human readable).- Returns:
- name of the plot
-
setName
Sets the name of this plot (human readable).- Parameters:
name
- name of this plot
-
getLabelPrefix
Gets the label prefix.- Returns:
- label prefix
-
setLabelPrefix
Sets the label prefix for this plot.- Parameters:
label
- label prefix
-
setLabelSettings
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
Gets the set of settings that are part of the label for the plot.- Returns:
- set of label settings
-
setIDSettings
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
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
Gets the name to display in the tab for this plot.- Returns:
- tab name
-
setTabName
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
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
Gets the keys of the values used to affect the vertical range of the plot.- Returns:
- list of range key objects
-
declarePath
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 pathpathSettingsKey
- settings key of the path
-
clearPaths
public void clearPaths()Clears the declared paths. -
declarePriceBar
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 barpriceBarKey
- settings key of the price bar
-
clearPriceBars
public void clearPriceBars()Clears the declared price bars. -
declareIndicator
Associates a value key to an indicator.- Parameters:
valueKey
- key of the value for the indicatorindicatorKey
- settings key for the indicator
-
clearIndicators
public void clearIndicators()Clears the declared indicators. -
declareBars
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 barssettingsKey
- settings key for the bars
-
declareBars
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
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
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
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
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
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
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
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
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
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
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
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
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
Gets the list of horizontal lines declared for this plot.- Returns:
- list of horizontal lines declared for this plot.
-
getPaths
Gets the set of declared paths (a map of value key to settings key).- Returns:
- map of declared paths
-
getPriceBars
Gets the set of declared price bars (a map of value key to settings key).- Returns:
- map of declared price bars
-
getIndicators
Gets the set of declared indicators (a map of value key to settings key).- Returns:
- map of declared indicators
-
getBars
Gets the set of declared bars (a map of value key to settings key).- Returns:
- map of declared bars
-
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
Creates a clone (copy) of this object.
-