Interface: SeriesOptionsCommon
Represents options common for all types of series
Properties
lastValueVisible
• lastValueVisible: boolean
Visibility of the label with the latest visible price on the price scale.
defaultvalue true
title
• title: string
You can name series when adding it to a chart. This name will be displayed on the label next to the last value label.
defaultvalue ''
priceScaleId
• Optional priceScaleId: string
Target price scale to bind new series to.
defaultvalue 'right' if right scale is visible and 'left' otherwise
visible
• visible: boolean
Visibility of the series. If the series is hidden, everything including price lines, baseline, price labels and markers, will also be hidden. Please note that hiding a series is not equivalent to deleting it, since hiding does not affect the timeline at all, unlike deleting where the timeline can be changed (some points can be deleted).
defaultvalue true
priceLineVisible
• priceLineVisible: boolean
Show the price line. Price line is a horizontal line indicating the last price of the series.
defaultvalue true
priceLineSource
• priceLineSource: PriceLineSource
The source to use for the value of the price line.
defaultvalue PriceLineSource.LastBar
priceLineWidth
• priceLineWidth: LineWidth
Width of the price line.
defaultvalue 1
priceLineColor
• priceLineColor: string
Color of the price line. By default, its color is set by the last bar color (or by line color on Line and Area charts).
defaultvalue ''
priceLineStyle
• priceLineStyle: LineStyle
Price line style.
defaultvalue LineStyle.Dashed
priceFormat
• priceFormat: PriceFormat
Price format.
defaultvalue { type: 'price', precision: 2, minMove: 0.01 }
baseLineVisible
• baseLineVisible: boolean
Visibility of base line. Suitable for percentage and IndexedTo100 scales.
defaultvalue true
baseLineColor
• baseLineColor: string
Color of the base line in IndexedTo100 mode.
defaultvalue '#B2B5BE'
baseLineWidth
• baseLineWidth: LineWidth
Base line width. Suitable for percentage and IndexedTo10 scales.
defaultvalue 1
baseLineStyle
• baseLineStyle: LineStyle
Base line style. Suitable for percentage and indexedTo100 scales.
defaultvalue LineStyle.Solid
autoscaleInfoProvider
• Optional autoscaleInfoProvider: AutoscaleInfoProvider
Override the default AutoscaleInfo provider. By default, the chart scales data automatically based on visible data range. However, for some reasons one could require overriding this behavior.
defaultvalue undefined
example Use price range from 0 to 100 regardless the current visible range
const firstSeries = chart.addLineSeries({
autoscaleInfoProvider: () => ({
priceRange: {
minValue: 0,
maxValue: 100,
},
}),
});
example Adding a small pixel margins to the price range
const firstSeries = chart.addLineSeries({
autoscaleInfoProvider: () => ({
priceRange: {
minValue: 0,
maxValue: 100,
},
margins: {
above: 10,
below: 10,
},
}),
});
example Using the default implementation to adjust the result
const firstSeries = chart.addLineSeries({
autoscaleInfoProvider: original => {
const res = original();
if (res !== null) {
res.priceRange.minValue -= 10;
res.priceRange.maxValue += 10;
}
return res;
},
});