ChartPanelLegend¶
Definition¶
Extends¶
Extended By¶
None
Description¶
A legend overlay layer within a ChartPanel that maps series labels to their visual styles.
Method Summary¶
| Owner | Name | Return Type | Description |
|---|---|---|---|
| DashboardResource | commit() | Object | Commits transient changes, promoting overrides to persisted values. If transient, makes permanent. |
| DashboardResource | getCallback(callbackName) | Callback | Returns a callback by name |
| DashboardResource | getCallbackNames() | List | Returns the callback names defined for this dashboard resource. Use session.getDevTools().getCallbackEditor(resource, callbackName) to edit one, and call editor.open() when you want to show the UI. |
| DashboardResource | getCallbacks() | Map | Returns a map of all callback definitions. |
| ChartPanelLayer | getCategoryCount() | Integer | Returns the number of category slots on this layer's category axis, or 0 if neither axis is a category axis. Pair with getGroupingPosition to spot the last (or first) category from a per-row formula |
| ChartPanelLayer | getChart() | ChartPanel | Returns the chart panel this layer belongs to. |
| DashboardResource | getChildren() | List | Returns a list of the child dashboard resources. |
| Object | getClassName() | String | Returns the string name of this object's class type. |
| DashboardResource | getDRI() | String | Returns the Dashboard Resource Indicator (DRI) as a string. DRI is the unique identifier of an object within the entire dashboard. |
| DashboardResource | getDashboardResourceType() | String | Returns the Dashboard Resource Type as a string |
| ChartPanelLayer | getDatamodel() | Datamodel | Returns the underlying datamodel used by the layer. |
| ChartPanelLayer | getFormula(fieldname) | String | Returns the formula for the given field. |
| DashboardResource | getFormulaNames() | Set | Returns a set of the names of all formulas for this object. |
| DashboardResource | getFormulas() | Map | Returns a map of all available formulas for this object. The key is the formula name. |
| ChartPanelLayer | getGroupingPosition(categoryValue) | Double | Returns the ORDINAL (0-based slot index) of a category value on this layer's category axis, or NaN if it is not a category. Add 1 for the next category / subtract 1 for the previous. Use as the X (or Y) value of a layer in "Category Ordinal Positions" mode to place a point/segment at a category - e.g. a waterfall connector: X=this.getGroupingPosition(cat), X2=this.getGroupingPosition(cat)+1. |
| ChartPanelLayer | getGroupingSeriesNumber(groupingName) | Double | Returns the series number (0-based index into this layer's groupings - the same value the __series_num variable carries) of the grouping with the given name, or NaN if this layer has no such grouping. Use it to reach another series' identity from a row that only knows that series' name |
| ChartPanelLegend | getHeight() | Integer | Gets the height of the legend |
| DashboardResource | getLRI() | String | Returns the Localized Resource Indicator (LRI) as a string. LRI is the unique identifier of this resource with the parent element. |
| ChartPanelLayer | getOwner() | ChartPanelPlot | Returns the ChartPanelPlot that owns this object. |
| ChartPanelLayer | getPlot() | ChartPanelPlot | Returns the plot this layer belongs to. |
| ChartPanelLayer | getPositionForOrdinal(ordinal) | Double | Returns the pre-zoom pixel position of a (fractional) category ordinal on this layer's category axis (ordinal N -> slot N center), or NaN if neither axis is a category axis. Advanced/manual use - "Category Ordinal Positions" mode already applies this at render, so do NOT feed the result back into an X/Y field in that mode (it would be mapped twice). Pair with getGroupingPosition. |
| ChartPanelLegend | getReferencedSeries() | Set | Returns the referenced series from the legend |
| ChartPanelLayer | getSelected() | Table | get the rows from underlying data that are represented by selected items in this layer |
| ChartPanelLayer | getSeriesColor(seriesNumber) | String | Returns the chart's palette color for a series number as a #rrggbb / #rrggbbaa string, ready to return from a color formula. The palette is indexed with wrap-around exactly as the renderer does, so this is the colour that series is actually drawn in. To derive a related-but-distinct colour, wrap it in brighten(), whose pct is signed: brighten(this.getSeriesColor(n), .3) lightens, brighten(..., -.3) darkens. contrast() instead returns black or white, whichever stays legible ON that colour. |
| ChartPanelLayer | getStyle(styleKey, index) | String | Returns the value associated with the supplied style key in this panel's style as a string. Returns Null if key not found. |
| ChartPanelLayer | getStyle(styleKey) | String | Returns the value for a particular style given the style code, which can be obtained by clicking on the style name. Returns Null if key not found. |
| ChartPanelLegend | getTitle() | String | Gets the title of the legend |
| ChartPanelLegend | getWidth() | Integer | Gets the width of the legend |
| ChartPanelLayer | getXAxis() | ChartPanelAxis | Returns the x-axis of the layer. |
| ChartPanelLayer | getYAxis() | ChartPanelAxis | Returns the y-axis of the layer. |
| ChartPanelLayer | getZPosition() | Integer | Returns the z-position of the layer. |
| ChartPanelLayer | hasEntryAt(x, y) | Boolean | Returns true when a bar / marker / box is drawn at the given plot pixel - the "is there an entry at (x,y)?" query for bar and event-strip charts. |
| ChartPanelLayer | hitTestAt(x, y) | Map | Point hit-test for bar / event-strip charts: returns the {xValue, yValue, groupId, rowNum, exact, intersects, isXDomain} value pair (a Map) of the bar/marker/box covering the pixel, or Null if nothing is drawn there. Use groupId+rowNum to read the entry's source row. |
| DashboardResource | invokeCallback(callbackName, args) | Object | Executes the specified callback definition and returns the result from the callback. |
| DashboardResource | isTransient() | Boolean | Returns true if this is transient, false otherwise. Transient objects are not saved to the layout. |
| ChartPanelLayer | resetFormulas() | Boolean | Resets the formulas to the default (as set in the layer editor). |
| ChartPanelLayer | sampleAt(x, y) | Map | Samples the layer's rendered curve at a plot pixel and returns the interpolated {xValue, yValue, groupId, rowNum, exact, intersects, isXDomain} value pair (a Map), or Null if the layer has no line spanning that domain axis (X if isXDomain is true, Y otherwise). If intersects is false, the other value (Y if isXDomain is true, X otherwise) is interpolated between the two bracketing data points to match the drawn line. "exact" is true when the sample matches the pixel along the domain axis, while "intersects" is true when the sample matches the pixel along both axes. |
| ChartPanelLayer | setFormula(fieldname, value) | Boolean | Sets the formula for the given field. For field name, use xLbl for X Groupings, yLbl for Y Groupings, name for Group By, and where for Where clause. |
| Object | toJson() | String | Returns a string of a json representation of this object. |
Method Definitions¶
commit()¶
Object DashboardResource::commit()
Description¶
Commits transient changes, promoting overrides to persisted values. If transient, makes permanent.
getCallback(callbackName)¶
Callback DashboardResource::getCallback(String callbackName)
Description¶
Returns a callback by name
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| callbackName | String | method name of callback |
getCallbackNames()¶
List DashboardResource::getCallbackNames()
Description¶
Returns the callback names defined for this dashboard resource. Use session.getDevTools().getCallbackEditor(resource, callbackName) to edit one, and call editor.open() when you want to show the UI.
getCallbacks()¶
Map DashboardResource::getCallbacks()
Description¶
Returns a map of all callback definitions.
getCategoryCount()¶
Integer ChartPanelLayer::getCategoryCount()
Description¶
Returns the number of category slots on this layer's category axis, or 0 if neither axis is a category axis. Pair with getGroupingPosition to spot the last (or first) category from a per-row formula
getChart()¶
ChartPanel ChartPanelLayer::getChart()
Description¶
Returns the chart panel this layer belongs to.
getChildren()¶
List DashboardResource::getChildren()
Description¶
Returns a list of the child dashboard resources.
getClassName()¶
Description¶
Returns the string name of this object's class type.
getDRI()¶
String DashboardResource::getDRI()
Description¶
Returns the Dashboard Resource Indicator (DRI) as a string. DRI is the unique identifier of an object within the entire dashboard.
getDashboardResourceType()¶
String DashboardResource::getDashboardResourceType()
Description¶
Returns the Dashboard Resource Type as a string
getDatamodel()¶
Datamodel ChartPanelLayer::getDatamodel()
Description¶
Returns the underlying datamodel used by the layer.
getFormula(fieldname)¶
String ChartPanelLayer::getFormula(String fieldname)
Description¶
Returns the formula for the given field.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| fieldname | String | Field Name in the layer |
getFormulaNames()¶
Set DashboardResource::getFormulaNames()
Description¶
Returns a set of the names of all formulas for this object.
getFormulas()¶
Map DashboardResource::getFormulas()
Description¶
Returns a map of all available formulas for this object. The key is the formula name.
getGroupingPosition(categoryValue)¶
Double ChartPanelLayer::getGroupingPosition(Object categoryValue)
Description¶
Returns the ORDINAL (0-based slot index) of a category value on this layer's category axis, or NaN if it is not a category. Add 1 for the next category / subtract 1 for the previous. Use as the X (or Y) value of a layer in "Category Ordinal Positions" mode to place a point/segment at a category - e.g. a waterfall connector: X=this.getGroupingPosition(cat), X2=this.getGroupingPosition(cat)+1.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| categoryValue | Object | A category value on this layer's category axis |
getGroupingSeriesNumber(groupingName)¶
Double ChartPanelLayer::getGroupingSeriesNumber(Object groupingName)
Description¶
Returns the series number (0-based index into this layer's groupings - the same value the __series_num variable carries) of the grouping with the given name, or NaN if this layer has no such grouping. Use it to reach another series' identity from a row that only knows that series' name
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| groupingName | Object | A grouping/series name on this layer (a value of the series Name formula) |
getHeight()¶
Integer ChartPanelLegend::getHeight()
Description¶
Gets the height of the legend
getLRI()¶
String DashboardResource::getLRI()
Description¶
Returns the Localized Resource Indicator (LRI) as a string. LRI is the unique identifier of this resource with the parent element.
getOwner()¶
ChartPanelPlot ChartPanelLayer::getOwner()
Description¶
Returns the ChartPanelPlot that owns this object.
getPlot()¶
ChartPanelPlot ChartPanelLayer::getPlot()
Description¶
Returns the plot this layer belongs to.
getPositionForOrdinal(ordinal)¶
Double ChartPanelLayer::getPositionForOrdinal(Number ordinal)
Description¶
Returns the pre-zoom pixel position of a (fractional) category ordinal on this layer's category axis (ordinal N -> slot N center), or NaN if neither axis is a category axis. Advanced/manual use - "Category Ordinal Positions" mode already applies this at render, so do NOT feed the result back into an X/Y field in that mode (it would be mapped twice). Pair with getGroupingPosition.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| ordinal | Number | A (fractional) category slot ordinal |
getReferencedSeries()¶
Set ChartPanelLegend::getReferencedSeries()
Description¶
Returns the referenced series from the legend
getSelected()¶
Table ChartPanelLayer::getSelected()
Description¶
get the rows from underlying data that are represented by selected items in this layer
getSeriesColor(seriesNumber)¶
String ChartPanelLayer::getSeriesColor(Number seriesNumber)
Description¶
Returns the chart's palette color for a series number as a #rrggbb / #rrggbbaa string, ready to return from a color formula. The palette is indexed with wrap-around exactly as the renderer does, so this is the colour that series is actually drawn in. To derive a related-but-distinct colour, wrap it in brighten(), whose pct is signed: brighten(this.getSeriesColor(n), .3) lightens, brighten(..., -.3) darkens. contrast() instead returns black or white, whichever stays legible ON that colour.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| seriesNumber | Number | A 0-based series index - typically __series_num or getGroupingSeriesNumber(name) |
getStyle(styleKey,index)¶
String ChartPanelLayer::getStyle(String styleKey, Number index)
Description¶
Returns the value associated with the supplied style key in this panel's style as a string. Returns Null if key not found.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| styleKey | String | the key associated with this portlets style |
| index | Number | If the style is a list, which element in the list to return |
getStyle(styleKey)¶
String ChartPanelLayer::getStyle(String styleKey)
Description¶
Returns the value for a particular style given the style code, which can be obtained by clicking on the style name. Returns Null if key not found.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| styleKey | String | the key associated with this portlet's style |
getTitle()¶
String ChartPanelLegend::getTitle()
Description¶
Gets the title of the legend
getWidth()¶
Integer ChartPanelLegend::getWidth()
Description¶
Gets the width of the legend
getXAxis()¶
ChartPanelAxis ChartPanelLayer::getXAxis()
Description¶
Returns the x-axis of the layer.
getYAxis()¶
ChartPanelAxis ChartPanelLayer::getYAxis()
Description¶
Returns the y-axis of the layer.
getZPosition()¶
Integer ChartPanelLayer::getZPosition()
Description¶
Returns the z-position of the layer.
hasEntryAt(x,y)¶
Boolean ChartPanelLayer::hasEntryAt(Number x, Number y)
Description¶
Returns true when a bar / marker / box is drawn at the given plot pixel - the "is there an entry at (x,y)?" query for bar and event-strip charts.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| x | Number | Plot pixel X |
| y | Number | Plot pixel Y |
hitTestAt(x,y)¶
Map ChartPanelLayer::hitTestAt(Number x, Number y)
Description¶
Point hit-test for bar / event-strip charts: returns the {xValue, yValue, groupId, rowNum, exact, intersects, isXDomain} value pair (a Map) of the bar/marker/box covering the pixel, or Null if nothing is drawn there. Use groupId+rowNum to read the entry's source row.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| x | Number | Plot pixel X |
| y | Number | Plot pixel Y |
invokeCallback(callbackName,args)¶
Object DashboardResource::invokeCallback(String callbackName, Object ... args)
Description¶
Executes the specified callback definition and returns the result from the callback.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| callbackName | String | method name of callback |
| args | Object ... | arguments |
isTransient()¶
Boolean DashboardResource::isTransient()
Description¶
Returns true if this is transient, false otherwise. Transient objects are not saved to the layout.
resetFormulas()¶
Boolean ChartPanelLayer::resetFormulas()
Description¶
Resets the formulas to the default (as set in the layer editor).
sampleAt(x,y)¶
Map ChartPanelLayer::sampleAt(Number x, Number y)
Description¶
Samples the layer's rendered curve at a plot pixel and returns the interpolated {xValue, yValue, groupId, rowNum, exact, intersects, isXDomain} value pair (a Map), or Null if the layer has no line spanning that domain axis (X if isXDomain is true, Y otherwise). If intersects is false, the other value (Y if isXDomain is true, X otherwise) is interpolated between the two bracketing data points to match the drawn line. "exact" is true when the sample matches the pixel along the domain axis, while "intersects" is true when the sample matches the pixel along both axes.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| x | Number | Plot pixel X |
| y | Number | Plot pixel Y (disambiguates which line when several are present) |
setFormula(fieldname,value)¶
Boolean ChartPanelLayer::setFormula(String fieldname, String value)
Description¶
Sets the formula for the given field. For field name, use xLbl for X Groupings, yLbl for Y Groupings, name for Group By, and where for Where clause.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| fieldname | String | Field Name in the layer. See description for a list of fields. |
| value | String |
toJson()¶
Description¶
Returns a string of a json representation of this object.