ExtReact Docs Help

Introduction

The documentation for the ExtReact product diverges somewhat from the documentation of other Sencha products. The sections below describe documentation for all products except where indicated as unique to ExtReact.

Terms, Icons, and Labels

Many classes have shortcut names used when creating (instantiating) a class with a configuration object. The shortcut name is referred to as an alias (or xtype if the class extends Ext.Component). The alias/xtype is listed next to the class name of applicable classes for quick reference.

ExtReact component classes list the configurable name prominently at the top of the API class doc followed by the fully-qualified class name.

Access Levels

Framework classes or their members may be specified as private or protected. Else, the class / member is public. Public, protected, and private are access descriptors used to convey how and when the class or class member should be used.

Member Types

Member Syntax

Below is an example class member that we can disect to show the syntax of a class member (the lookupComponent method as viewed from the Ext.button.Button class in this case).

lookupComponent ( item ) : Ext.Component
protected

Called when a raw config object is added to this container either during initialization of the items config, or when new items are added), or {@link #insert inserted.

This method converts the passed object into an instanced child component.

This may be overridden in subclasses when special processing needs to be applied to child creation.

Parameters

item :  Object

The config object being added.

Returns
Ext.Component

The component to be added.

Let's look at each part of the member row:

Member Flags

The API documentation uses a number of flags to further commnicate the class member's function and intent. The label may be represented by a text label, an abbreviation, or an icon.

Class Icons

- Indicates a framework class

- A singleton framework class. *See the singleton flag for more information

- A component-type framework class (any class within the Ext JS framework that extends Ext.Component)

- Indicates that the class, member, or guide is new in the currently viewed version

Member Icons

- Indicates a class member of type config

Or in the case of an ExtReact component class this indicates a member of type prop

- Indicates a class member of type property

- Indicates a class member of type method

- Indicates a class member of type event

- Indicates a class member of type theme variable

- Indicates a class member of type theme mixin

- Indicates that the class, member, or guide is new in the currently viewed version

Class Member Quick-Nav Menu

Just below the class name on an API doc page is a row of buttons corresponding to the types of members owned by the current class. Each button shows a count of members by type (this count is updated as filters are applied). Clicking the button will navigate you to that member section. Hovering over the member-type button will reveal a popup menu of all members of that type for quick navigation.

Getter and Setter Methods

Getting and setter methods that correlate to a class config option will show up in the methods section as well as in the configs section of both the API doc and the member-type menus just beneath the config they work with. The getter and setter method documentation will be found in the config row for easy reference.

ExtReact component classes do not hoist the getter / setter methods into the prop. All methods will be described in the Methods section

History Bar

Your page history is kept in localstorage and displayed (using the available real estate) just below the top title bar. By default, the only search results shown are the pages matching the product / version you're currently viewing. You can expand what is displayed by clicking on the button on the right-hand side of the history bar and choosing the "All" radio option. This will show all recent pages in the history bar for all products / versions.

Within the history config menu you will also see a listing of your recent page visits. The results are filtered by the "Current Product / Version" and "All" radio options. Clicking on the button will clear the history bar as well as the history kept in local storage.

If "All" is selected in the history config menu the checkbox option for "Show product details in the history bar" will be enabled. When checked, the product/version for each historic page will show alongside the page name in the history bar. Hovering the cursor over the page names in the history bar will also show the product/version as a tooltip.

Search and Filters

Both API docs and guides can be searched for using the search field at the top of the page.

On API doc pages there is also a filter input field that filters the member rows using the filter string. In addition to filtering by string you can filter the class members by access level, inheritance, and read only. This is done using the checkboxes at the top of the page.

The checkbox at the bottom of the API class navigation tree filters the class list to include or exclude private classes.

Clicking on an empty search field will show your last 10 searches for quick navigation.

API Doc Class Metadata

Each API doc page (with the exception of Javascript primitives pages) has a menu view of metadata relating to that class. This metadata view will have one or more of the following:

Expanding and Collapsing Examples and Class Members

Runnable examples (Fiddles) are expanded on a page by default. You can collapse and expand example code blocks individually using the arrow on the top-left of the code block. You can also toggle the collapse state of all examples using the toggle button on the top-right of the page. The toggle-all state will be remembered between page loads.

Class members are collapsed on a page by default. You can expand and collapse members using the arrow icon on the left of the member row or globally using the expand / collapse all toggle button top-right.

Desktop -vs- Mobile View

Viewing the docs on narrower screens or browsers will result in a view optimized for a smaller form factor. The primary differences between the desktop and "mobile" view are:

Viewing the Class Source

The class source can be viewed by clicking on the class name at the top of an API doc page. The source for class members can be viewed by clicking on the "view source" link on the right-hand side of the member row.

ExtReact 6.6.0


top

boxplot Ext.chart.series.BoxPlot premium

NPM Package

@sencha/ext-charts

Summary

A box plot chart is a useful tool for visualizing data distribution within data-sets. For example, salary ranges for a set of occupations, or life expectancy for a set of countries. A single box with whiskers displays the following values for a data-set:

  • minimum
  • lower quartile (Q1)
  • median (Q2)
  • higher quartile (Q3)
  • maximum

For example:

No members found using the current filters

properties

Optional Properties

animation : Object
immutable imm

The series animation configuration.

Defaults to:

null

background : Object
immutable imm

Sets the background of the surface the series is attached.

Defaults to:

null

colors : Array
immutable imm

An array of color values which is used, in order of appearance, by the series. Each series can request one or more colors from the array. Radar, Scatter or Line charts require just one color each. Candlestick and OHLC require two (1 for drops + 1 for rises). Pie charts and Stacked charts (like Bar or Pie charts) require one color for each data category they represent, so one color for each slice of a Pie chart or each segment (not bar) of a Bar chart. It overrides the colors that are provided by the current theme.

Defaults to:

null

hidden : Boolean / Array
immutable imm

Defaults to:

false

highField : String
immutable imm

The name of the store record field that represents the largest value of a dataset.

Defaults to:

'high'

highlight : Boolean / Object
immutable imm

The sprite attributes that will be applied to the highlighted items in the series. If set to 'true', the default highlight style from highlightCfg will be used. If the value of this config is an object, it will be merged with the highlightCfg. In case merging of 'highlight' and 'highlightCfg' configs in not the desired behavior, provide the 'highlightCfg' instead.

Defaults to:

false

label : Object
immutable imm

Object with the following properties:

Defaults to:

{}

Properties

display : String

Specifies the presence and position of the labels. The possible values depend on the series type. For Line and Scatter series: 'under' | 'over' | 'rotate'. For Bar and 3D Bar series: 'insideStart' | 'insideEnd' | 'outside'. For Pie series: 'outside' | 'rotate' | 'horizontal' | 'vertical'. Area, Radar and Candlestick series don't support labels. For Area and Radar series please consider using tooltips instead. 3D Pie series currently always display labels 'outside'. For all series: 'none' hides the labels.

Default value: 'none'.

color : String

The color of the label text.

Default value: '#000' (black).

field : String/String[]

The name(s) of the field(s) to be displayed in the labels. If your chart has 3 series that correspond to the fields 'a', 'b', and 'c' of your model, and you only want to display labels for the series 'c', you must still provide an array [null, null, 'c'].

Default value: null.

font : String

The font used for the labels.

Default value: '14px Helvetica'.

orientation : String

Either 'horizontal' or 'vertical'. If not set (default), the orientation is inferred from the value of the flipXY property of the series.

Default value: ''.

renderer : Function

Optional function for formatting the label into a displayable value.

The arguments to the method are:

  • text, sprite, config, rendererData, index

    Label's renderer is passed the same arguments as renderer plus one extra 'text' argument which comes first.

Returns

:Object/String

The attributes that have been changed or added, or the text for the label. Example to enclose every other label in parentheses:

 renderer: function (text) {
     if (index % 2 == 0) {
         return '(' + text + ')'
     }
 }

Default value: null

labelOverflowPadding : Number
immutable imm

Extra distance value for which the labelOverflow listener is triggered.

Defaults to:

null

lowField : String
immutable imm

The name of the store record field that represents the smallest value of a dataset.

Defaults to:

'low'

marker : Object / Boolean
immutable imm

The sprite template used by marker instances on the series. If the value of the marker config is set to true or the type of the sprite instance is not specified, the Ext.draw.sprite.Circle sprite will be used.

Examples:

marker: true

marker: {
    radius: 8
}

marker: {
    type: 'arrow',
    animation: {
        duration: 200,
        easing: 'backOut'
    }
}

Defaults to:

null

markerSubStyle : Object
immutable imm

This is cyclic used if series have multiple marker sprites.

Defaults to:

null

medianField : String
immutable imm

The name of the store record field that represents the median of a dataset.

Defaults to:

'median'

q1Field : String
immutable imm

The name of the store record field that represents the lower (1-st) quartile value of a dataset.

Defaults to:

'q1'

q3Field : String
immutable imm

The name of the store record field that represents the upper (3-rd) quartile value of a dataset.

Defaults to:

'q3'

renderer : Function
immutable imm

A function that can be provided to set custom styling properties to each rendered element. It receives (sprite, config, rendererData, index) as parameters.

Defaults to:

null

Parameters

sprite :  Object

The sprite affected by the renderer. The visual attributes are in sprite.attr. The data field is available in sprite.getField().

config :  Object

The sprite configuration. It varies with the series and the type of sprite: for instance, a Line chart sprite might have just the x and y properties while a Bar chart sprite also has width and height. A type might be present too. For instance to draw each marker and each segment of a Line chart, the renderer is called with the config.type set to either marker or line.

rendererData :  Object

A record with different properties depending on the type of chart. The only guaranteed property is rendererData.store, the store used by the series. In some cases, a store may not exist: for instance a Gauge chart may read its value directly from its configuration; in this case rendererData.store is null and the value is available in rendererData.value.

index :  Number

The index of the sprite. It is usually the index of the store record associated with the sprite, in which case the record can be obtained with store.getData().items[index]. If the chart is not associated with a store, the index represents the index of the sprite within the series. For instance a Gauge chart may have as many sprites as there are sectors in the background of the gauge, plus one for the needle.

Returns

:Object

The attributes that have been changed or added. Note: it is usually possible to add or modify the attributes directly into the config parameter and not return anything, but returning an object with only those attributes that have been changed may allow for optimizations in the rendering of some series. Example to draw every other marker in red:

 renderer: function (sprite, config, rendererData, index) {
     if (config.type === 'marker') {
         return { strokeStyle: (index % 2 === 0 ? 'red' : 'black') };
     }
 }

seriesType : String
readonly ro

Default series sprite type.

Defaults to:

'sprite'

showInLegend : Boolean
immutable imm

Whether to show this series in the legend.

Defaults to:

true

showMarkers : Boolean
immutable imm

Whether markers should be displayed at the data points along the line. If true, then the marker config item will determine the markers' styling.

Defaults to:

true

store : Object
immutable imm

The store to use for this series. If not specified, the series will use the chart's store.

Defaults to:

null

style : Object
immutable imm

Custom style configuration for the sprite used in the series. It overrides the style that is provided by the current theme.

Defaults to:

{}

subStyle : Object
immutable imm

This is the cyclic used if the series has multiple sprites.

Defaults to:

{}

title : String / String[]
immutable imm

The human-readable name of the series (displayed in the legend). If the series is stacked (has multiple components in it) this should be an array, where each string corresponds to a stacked component.

Defaults to:

null

tooltip : Object
immutable imm

Add tooltips to the visualization's markers. The config options for the tooltip are the same configuration used with ToolTip plus a renderer config option and a scope for the renderer. For example:

tooltip: {
  trackMouse: true,
  width: 140,
  height: 28,
  renderer: function (toolTip, record, ctx) {
      toolTip.setHtml(record.get('name') + ': ' + record.get('data1') + ' views');
  }
}

Note that tooltips are shown for series markers and won't work if the marker is not configured.

Defaults to:

null

Properties

scope : Object

The scope to use when the renderer function is called. Defaults to the Series instance.

renderer : Function

An 'interceptor' method which can be used to modify the tooltip attributes before it is shown. The renderer function is passed the following params:

toolTip :  ToolTip

The tooltip instance

record :  Ext.data.Model

The record instance for the chart item (sprite) currently targeted by the tooltip.

ctx :  Object

A data object with values relating to the currently targeted chart sprite

category :  String

The type of sprite passed to the renderer function (will be "items", "markers", or "labels" depending on the target sprite of the tooltip)

field :  String

The yField for the series

index :  Number

The target sprite's index within the series' items

record :  Ext.data.Model

The record instance for the chart item (sprite) currently targeted by the tooltip.

series :  Ext.chart.series.Series

The series instance containing the tooltip's target sprite

sprite :  Ext.draw.sprite.Sprite

The sprite (item) target of the tooltip

useDarkerStrokeColor : Boolean / Number
immutable imm

Colors for the series can be set directly through the 'colors' config, or indirectly with the current theme or the 'colors' config that is set onto the chart. These colors are used as "fill color". Set this config to true, if you want a darker color for the strokes. Set it to false if you want to use the same color as the fill color. Alternatively, you can set it to a number between 0 and 1 to control how much darker the strokes should be.

Note: this should be initial config and cannot be changed later on.

Defaults to:

true

xAxis : Ext.chart.axis.Axis / Number / String
immutable imm

xAxis The chart axis the series is bound to in the 'X' direction. Normally, this would be set automatically by the series. For charts with multiple x-axes, this defines which x-axis is used by the series. It refers to either axis' ID or the (zero-based) index of the axis in the chart's axes config.

Defaults to:

null

xField : String
immutable imm

The field used to access the x axis value from the items from the data source.

Defaults to:

null

yAxis : Ext.chart.axis.Axis / Number / String
immutable imm

yAxis The chart axis the series is bound to in the 'Y' direction. Normally, this would be set automatically by the series. For charts with multiple y-axes, this defines which y-axis is used by the series. It refers to either axis' ID or the (zero-based) index of the axis in the chart's axes config.

Defaults to:

null

yField : String / String[]
immutable imm

The field(s) used to access the y-axis value(s) of the items from the data source.

Defaults to:

null

methods

Instance Methods

setAnimation ( animation )

Returns the value of animation

setBackground ( background )

Returns the value of background

setColors ( colors )

Returns the value of colors

setHidden ( hidden )

Returns the value of hidden

setHighField ( highField )

Returns the value of highField

setHighlight ( highlight )

Returns the value of highlight

setLabel ( label )

Returns the value of label

setLowField ( lowField )

Returns the value of lowField

setMarker ( marker )

Returns the value of marker

setMarkerSubStyle ( markerSubStyle )

Returns the value of markerSubStyle

setMedianField ( medianField )

Returns the value of medianField

setQ1Field ( q1Field )

Returns the value of q1Field

setQ3Field ( q3Field )

Returns the value of q3Field

setRenderer ( renderer )

Returns the value of renderer

setShowInLegend ( showInLegend )

Returns the value of showInLegend

setShowMarkers ( showMarkers )

Returns the value of showMarkers

setStore ( store )

Returns the value of store

setStyle ( style )

Returns the value of style

setSubStyle ( subStyle )

Returns the value of subStyle

setTitle ( title )

Returns the value of title

setTooltip ( tooltip )

Returns the value of tooltip

setXAxis ( xAxis )

Returns the value of xAxis

setXField ( xField )

Returns the value of xField

setYAxis ( yAxis )

Returns the value of yAxis

setYField ( yField )

Returns the value of yField

Static Methods

override ( members ) : Ext.Base
static sta

Override members of this class. Overridden methods can be invoked via Ext.Base#callParent.

Ext.define('My.Cat', {
    constructor: function() {
        alert("I'm a cat!");
    }
});

My.Cat.override({
    constructor: function() {
        alert("I'm going to be a cat!");

        this.callParent(arguments);

        alert("Meeeeoooowwww");
    }
});

var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
                          // alerts "I'm a cat!"
                          // alerts "Meeeeoooowwww"

Direct use of this method should be rare. Use Ext.define instead:

Ext.define('My.CatOverride', {
    override: 'My.Cat',
    constructor: function() {
        alert("I'm going to be a cat!");

        this.callParent(arguments);

        alert("Meeeeoooowwww");
    }
});

The above accomplishes the same result but can be managed by the Ext.Loader which can properly order the override and its target class and the build process can determine whether the override is needed based on the required state of the target class (My.Cat).

Parameters

members :  Object

The properties to add to this class. This should be specified as an object literal containing one or more properties.

Returns

:Ext.Base

this class

events

onChartattached : function ( chart, series, eOpts )

Fires when the Ext.chart.AbstractChart has been attached to this series.

Parameters

chart :  Ext.chart.AbstractChart

series :  Ext.chart.series.Series

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onChartdetached : function ( chart, series, eOpts )

Fires when the Ext.chart.AbstractChart has been detached from this series.

Parameters

chart :  Ext.chart.AbstractChart

series :  Ext.chart.series.Series

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onItemClick : function ( series, item, event, eOpts )

Fires when a click event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.

Parameters

series :  Ext.chart.series.Series

item :  Object

event :  Event

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onItemDblClick : function ( series, item, event, eOpts )

Fires when a double click event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.

Parameters

series :  Ext.chart.series.Series

item :  Object

event :  Event

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onItemMouseDown : function ( series, item, event, eOpts )

Fires when a mousedown event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.

Parameters

series :  Ext.chart.series.Series

item :  Object

event :  Event

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onItemMouseMove : function ( series, item, event, eOpts )

Fires when the mouse is moved on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.

Parameters

series :  Ext.chart.series.Series

item :  Object

event :  Event

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onItemMouseOut : function ( series, item, event, eOpts )

Fires when the mouse exits a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.

Parameters

series :  Ext.chart.series.Series

item :  Object

event :  Event

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onItemMouseOver : function ( series, item, event, eOpts )

Fires when the mouse enters a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.

Parameters

series :  Ext.chart.series.Series

item :  Object

event :  Event

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onItemMouseUp : function ( series, item, event, eOpts )

Fires when a mouseup event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.

Parameters

series :  Ext.chart.series.Series

item :  Object

event :  Event

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onItemTap : function ( series, item, event, eOpts )

Fires when a tap event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.

Parameters

series :  Ext.chart.series.Series

item :  Object

event :  Event

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

onStoreChange : function ( series, newStore, oldStore, eOpts )

Fires when the store of the series changes.

Parameters

series :  Ext.chart.series.Series

newStore :  Ext.data.Store

oldStore :  Ext.data.Store

eOpts : Object

The options object passed to Ext.util.Observable.addListener.

ExtReact 6.6.0