Sencha Documentation

Creates a Line Chart. A Line Chart is a useful visualization technique to display quantitative information for different categories or other real values (as opposed to the bar chart), that can show some progression (or regression) in the dataset. As with all other series, the Line Series must be appended in the *series* Chart array configuration. See the Chart documentation for more information. A typical configuration object for the line series could be:
series: [{
        type: 'line',
        highlight: {
            size: 7,
            radius: 7
        },
        axis: 'left',
        xField: 'name',
        yField: 'data1',
        markerCfg: {
            type: 'cross',
            size: 4,
            radius: 4,
            'stroke-width': 0
        }
    }, {
        type: 'line',
        highlight: {
            size: 7,
            radius: 7
        },
        axis: 'left',
        fill: true,
        xField: 'name',
        yField: 'data3',
        markerCfg: {
            type: 'circle',
            size: 4,
            radius: 4,
            'stroke-width': 0
        }
    }]
In this configuration we're adding two series (or lines), one bound to the `data1` property of the store and the other to `data3`. The type for both configurations is `line`. The `xField` for both series is the same, the name propert of the store. Both line series share the same axis, the left axis. You can set particular marker configuration by adding properties onto the markerCfg object. Both series have an object as highlight so that markers animate smoothly to the properties in highlight when hovered. The second series has `fill=true` which means that the line will also have an area below it of the same color.

Config Options

 
dash : String
Optional dash array for the line.
Optional dash array for the line.
 
fill : Boolean
If true, the area below the line will be filled in using the style.eefill and style.opacity config properties. Defaul...
If true, the area below the line will be filled in using the style.eefill and style.opacity config properties. Defaults to false.
 
listeners : Object
An (optional) object with event callbacks. All event callbacks get the target *item* as first parameter. The callback...
An (optional) object with event callbacks. All event callbacks get the target *item* as first parameter. The callback functions are:
  • itemmouseover
  • itemmouseout
  • itemmousedown
  • itemmouseup
 
markerCfg : Object
The display style for the markers. Only used if showMarkers is true.
The display style for the markers. Only used if showMarkers is true.
 
renderer : Function
A function that can be overridden to set custom styling properties to each rendered element. Passes in (sprite, recor...
A function that can be overridden to set custom styling properties to each rendered element. Passes in (sprite, record, attributes, index, store) to the function.
 
The offset distance from the cursor position to the line series to trigger events (then used for highlighting series,...
The offset distance from the cursor position to the line series to trigger events (then used for highlighting series, etc).
 
An array with shadow attributes
An array with shadow attributes
 
showInLegend : Boolean
Whether to show this series in the legend.
Whether to show this series in the legend.
 
showMarkers : Boolean
Whether markers should be displayed at the date points along the line. If true, then the markerCfg config item will d...
Whether markers should be displayed at the date points along the line. If true, then the markerCfg config item will determine the markers' styling.
 
smooth : Boolean
If true, the line will be smoothed/rounded around its points, otherwise straight line segments will be drawn. Default...
If true, the line will be smoothed/rounded around its points, otherwise straight line segments will be drawn. Defaults to false.
 
style : Object
An object containing styles for the visualization lines. These styles will override the theme styles. Some options c...
An object containing styles for the visualization lines. These styles will override the theme styles. Some options contained within the style object will are described next.
 
title : String
The human-readable name of the series.
The human-readable name of the series.
 
type : String
The type of series. Set in subclasses.
The type of series. Set in subclasses.

Properties

 
axis : String
Indicates which axis the series will bind to
Indicates which axis the series will bind to
 
xField : String
The field used to access the x axis value from the items from the data source.
The field used to access the x axis value from the items from the data source.
 
yField : String
The field used to access the y-axis value from the items from the data source.
The field used to access the y-axis value from the items from the data source.

Methods

 
drawSeries : Void
Draws the series for the current chart.
Draws the series for the current chart.
 
getItemForPoint( Number x, Number y ) : Object
For a given x/y point relative to the Surface, find a corresponding item from this series, if any. For Line series, t...
For a given x/y point relative to the Surface, find a corresponding item from this series, if any. For Line series, this snaps to the nearest vertex if the target point is within a certain vertical distance from the line.

Parameters

  • x : Number
  • y : Number

Returns

  • Object   undefined
 
Returns a string with the color to be used for the series legend item.
Returns a string with the color to be used for the series legend item.
 
hideAll : Void
Hides all the elements in the series.
Hides all the elements in the series.
 
showAll : Void
Shows all the elements in the series.
Shows all the elements in the series.