StockChartComponent
The root StockChart component.
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<kendo-stockchart>
<kendo-chart-series>
<kendo-chart-series-item type="line" [data]="data" field="value" categoryField="date">
</kendo-chart-series-item>
</kendo-chart-series>
<kendo-chart-navigator>
<kendo-chart-navigator-select to="2017/02/01">
</kendo-chart-navigator-select>
<kendo-chart-navigator-series>
<kendo-chart-navigator-series-item type="area" [data]="data" field="value" categoryField="date">
</kendo-chart-navigator-series-item>
</kendo-chart-navigator-series>
</kendo-chart-navigator>
</kendo-stockchart>
`
})
class AppComponent {
public data: any[] = [];
constructor() {
for (let idx = 0; idx < 100; idx++) {
this.data.push({
date: new Date(2017, 0, idx),
value: Math.random() * 100
});
}
}
}
Selector
kendo-stockchart
Export Name
Accessible in templates as #kendoStockChartInstance="kendoStockChart"
Inputs
NAME | TYPE | DEFAULT | DESCRIPTION |
---|---|---|---|
axisDefaults | The default options for all Chart axes. Accepts the options which are supported by
| ||
categoryAxis | The configuration options of the category axis. | ||
chartArea | The configuration options of the Chart area. Represents the entire visible area of the Chart. | ||
legend | The configuration options of the Chart legend. | ||
navigator | The configuration options for the data navigator. | ||
paneDefaults | The default options of all panes. | ||
panes | Pane[] | The configuration of the Chart panes.
Panes are used to split the Chart into two or more parts. The panes are ordered from top to bottom.
To associate each axis with a pane, set its | |
plotArea | The configuration options of the plot area. The plot area is the area which displays the series. | ||
popupSettings | The settings for the tooltip popup. | ||
renderAs | "svg" | "canvas" | Sets the preferred rendering engine. If not supported by the browser, the Chart switches to the first available mode. The supported values are:
| |
resizeRateLimit | number | Limits the automatic resizing of the Chart. Sets the maximum number of times per second
that the component redraws its content when the size of its container changes.
Defaults to
| |
series | Series[] | The configuration of the Chart series.
The series type is determined by the value of the type field.
If a type value is missing, the Chart renders the type that is
specified in | |
seriesColors | string[] | The default colors for the Chart series. When all colors are used, new colors are pulled from the start again. | |
seriesDefaults | The default options of all series. | ||
title | string | Title | The configuration options or the text of the Chart title. | |
tooltip | The configuration options of the Chart series tooltips.
The tooltip of the Chart series is displayed when the
| ||
transitions | boolean | If set to | |
valueAxis | The configuration options of the value axis. | ||
xAxis | The configuration options of the Scatter Chart X-axis.
Supports all | ||
yAxis | The configuration options of the Scatter Chart Y-axis.
Supports all |
Fields
NAME | TYPE | DEFAULT | DESCRIPTION |
---|---|---|---|
surface | Surface | The Drawing |
Events
NAME | TYPE | DESCRIPTION |
---|---|---|
axisLabelClick | Fires when the user clicks an axis label (see example). | |
drag | Fires as long as the user is dragging the Chart with the mouse or through swipe gestures. | |
dragEnd | Fires when the user stops dragging the Chart. | |
dragStart | Fires when the user starts dragging the Chart. | |
legendItemClick | Fires when a legend item is clicked before the selected series visibility is toggled. Can be prevented. | |
legendItemHover | Fires when the user hovers over a legend item (see example). | |
legendItemLeave | Fires when the cursor leaves a legend item. | |
navigatorFilter | Fires when the navigator range is changed. | |
noteClick | Fires when the user clicks a note. | |
noteHover | Fires when the user hovers over a note. | |
noteLeave | Fires when the cursor leaves a note. | |
paneRender | Fires when a pane is rendered because the Chart:
| |
plotAreaClick | Fires when the user clicks the plot area (see example).
The | |
plotAreaHover | Fires when the user hovers the plot area (see example). | |
plotAreaLeave | Fires when the cursor leaves the plot area. | |
render | Fires when the Chart is ready to render on screen (see example). For example, you can use it to remove loading indicators. Any changes made to the options are ignored. | |
select | Fires when the user modifies the selection. The range units are:
| |
selectEnd | Fires when the user completes the modification of the selection. The range units are:
| |
selectStart | Fires when the user starts modifying the axis selection. The range units are:
| |
seriesClick | Fires when the user clicks the Chart series. The | |
seriesHover | Fires when the user hovers the Chart series (see example). | |
seriesLeave | Fires when the cursor leaves a series. | |
seriesOver | Fires when the cursor enters a series. | |
zoom | Fires as long as the user is zooming the Chart by using the mousewheel operation. | |
zoomEnd | Fires when the user stops zooming the Chart. | |
zoomStart | Fires when the user uses the mousewheel to zoom the Chart. |
Methods
exportImage | ||
---|---|---|
Exports the Chart as an image. The export operation is asynchronous and returns a promise. |
Parameters | ||
---|---|---|
options | ImageExportOptions | The parameters for the exported image. |
Returns | |
---|---|
Promise<string> |
|
exportSVG | ||
---|---|---|
Exports the Chart as an SVG document. The export operation is asynchronous and returns a promise. |
Parameters | ||
---|---|---|
options | The parameters for the exported file. |
Returns | |
---|---|
Promise<string> |
|
exportVisual | ||
---|---|---|
Exports the Chart as a Drawing |
Parameters | ||
---|---|---|
options | any | The parameters for the export operation. |
Returns | |
---|---|
|
findAxisByName | ||
---|---|---|
Returns the axis with the specified name. |
Parameters | ||
---|---|---|
name | string | The axis name. |
Returns | |
---|---|
|
findPaneByIndex | ||
---|---|---|
Returns the pane at the specified index. |
Parameters | ||
---|---|---|
index | number | The pane index. |
Returns | |
---|---|
|
findPaneByName | ||
---|---|---|
Returns the pane with the specified name. |
Parameters | ||
---|---|---|
name | string | The name of the pane. |
Returns | |
---|---|
|
getPlotArea | |
---|---|
Returns the plot area of the Chart. |
Returns | |
---|---|
|
hideTooltip |
---|
Hides the tooltip of the Chart. |
notifyChanges | ||
---|---|---|
Updates the component fields with the specified values and refreshes the Chart. Use this method when the configuration values cannot be set through the template.
|
Parameters | ||
---|---|---|
changes | any | An object containing the updated input fields. |
resize |
---|
Detects the size of the container and redraws the Chart.
Resizing is automatic unless you set the |
showTooltip | ||
---|---|---|
Shows the Chart tooltip of a specific point or the shared tooltip of a specific category. |
Parameters | ||
---|---|---|
filter | string | number | Date | (point: SeriesPoint) => boolean | The category for a shared tooltip or a function which will be called for each point until the function returns |
skipNavigatorRedraw |
---|
If called, the navigator pane is not redrawn the next time the StockChart options are updated. The method is useful if you need to update only the main series data for the selected period. |
toggleHighlight | ||
---|---|---|
Highlights the series points or the segments of a Pie, Donut, or Funnel charts. See Series Highlight for more details. In the following example, the callback is evaluated for each data point.
If the function returns Example View Source Edit In Stackblitz Change Theme: |
Parameters | ||
---|---|---|
show | boolean | A Boolean value that indicates whether the highlight is shown or hidden. |
filter | string | { category: string; series: string; } | (point: SeriesPoint) => boolean | A string that represents the series or category name, an object with the series and category name, or a function which will be called for each point. The function should return |