Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/tradingview/lightweight-charts
/ functions
Functions
4,839 in github.com/tradingview/lightweight-charts
⨍
Functions
4,839
◇
Types & classes
1,320
↓ 824 callers
Method
setData
* Sets or replaces series data. * * @param data - Ordered (earlier time point goes first) array of data items. Old data is fully replaced with the
src/api/iseries-api.ts:163
↓ 720 callers
Method
addSeries
* Creates a series with specified parameters. * * @param definition - A series definition. * @param options - Customization parameters of the se
src/api/ipane-api.ts:149
↓ 388 callers
Method
timeScale
* Returns API to manipulate the time scale * * @returns Target API
src/api/ichart-api.ts:295
↓ 225 callers
Method
applyOptions
* Applies new options to the chart * * @param options - Any subset of options.
src/api/create-chart.ts:58
↓ 190 callers
Method
update
* Adds new data item to the existing set (or updates the latest item if times of the passed/latest items are equal). * * @param bar - A single dat
src/api/iseries-api.ts:190
↓ 164 callers
Method
fitContent
* Automatically calculates the visible range to fit all data from all series.
src/api/itime-scale-api.ts:95
↓ 132 callers
Function
ensureNotNull
(value: T | null)
src/helpers/assertions.ts:39
↓ 102 callers
Method
priceToCoordinate
* Converts specified series price to pixel coordinate according to the series price scale * * @param price - Input price to be converted * @retu
src/api/iseries-api.ts:76
↓ 100 callers
Method
priceScale
()
src/model/iseries.ts:80
↓ 98 callers
Function
createChart
(container: string | HTMLElement, options?: Parameters<typeof module.createChart>[1])
website/plugins/enhanced-codeblock/theme/CodeBlock/import-lightweight-charts-version.ts:62
↓ 98 callers
Method
get
(scope: BitmapCoordinatesRenderingScope, params: GradientCacheParams)
src/renderers/gradient-style-cache.ts:22
↓ 86 callers
Function
dataItemAt
(time: Time)
tests/unittests/data-layer.spec.ts:42
↓ 84 callers
Method
options
()
src/model/iseries.ts:78
↓ 75 callers
Method
attachPrimitive
* Attaches additional drawing primitive to the pane * * @param primitive - any implementation of IPanePrimitive interface
src/api/ipane-api.ts:61
↓ 71 callers
Method
model
()
src/gui/chart-widget.ts:52
↓ 70 callers
Method
moveTo
* Moves the pane to a new position. * * @param paneIndex - The target index of the pane. Should be a number between 0 and the total number of pane
src/api/ipane-api.ts:33
↓ 63 callers
Method
restore
()
tests/unittests/text-width-cache.spec.ts:19
↓ 61 callers
Method
save
()
tests/unittests/text-width-cache.spec.ts:17
↓ 58 callers
Method
setSeriesData
(series: Series<TSeriesType>, data: SeriesDataItemTypeMap<HorzScaleItem>[TSeriesType][])
src/model/data-layer.ts:153
↓ 56 callers
Method
createPriceLine
* Creates a new price line * * @param options - Any subset of options, however `price` is required. * @example * ```js * const priceLine = s
src/api/iseries-api.ts:273
↓ 53 callers
Method
dataByIndex
* Returns a bar data by provided logical index. * * @param logicalIndex - Logical index * @param mismatchDirection - Search direction if no data
src/api/iseries-api.ts:216
↓ 53 callers
Method
timeToCoordinate
* Converts a time to local x coordinate. * * @param time - Time needs to be converted * @returns X coordinate of that time or `null` if no time
src/api/itime-scale-api.ts:127
↓ 45 callers
Function
createSeriesMock
(seriesType?: T)
tests/unittests/data-layer.spec.ts:21
↓ 44 callers
Method
options
()
src/gui/chart-widget.ts:54
↓ 43 callers
Method
format
* Formatting function * * @param price - Original price to be formatted * @returns Formatted price
src/formatters/iprice-formatter.ts:9
↓ 41 callers
Method
destroy
()
src/model/idata-source.ts:60
↓ 41 callers
Method
removeSeries
* Removes a series of any type. This is an irreversible operation, you cannot do anything with the series after removing it. * * @example * ```j
src/api/ichart-api.ts:189
↓ 38 callers
Method
panes
* Returns array of panes' API * * @returns array of pane's Api
src/api/ichart-api.ts:332
↓ 35 callers
Function
generateAlternativeCandleData
( numberOfPoints: number = 250, startDate: Date )
indicator-examples/src/sample-data.ts:90
↓ 35 callers
Function
timePoint
(val: number)
tests/unittests/plot-list.spec.ts:12
↓ 34 callers
Method
conflateByFactor
( data: readonly SeriesPlotRow<T>[], barsToMerge: number, customReducer?: CustomConflationReducer<HorzSc
src/model/data-conflater.ts:55
↓ 34 callers
Function
generateLineData
(count)
tests/e2e/graphics/test-cases/time-scale/conflation-smoothing-factor.js:1
↓ 34 callers
Method
measureText
(text: string)
tests/unittests/text-width-cache.spec.ts:12
↓ 34 callers
Method
subscribe
(callback: Callback<T1, T2, T3>, linkedObject?: unknown, singleshot?: boolean)
src/helpers/isubscription.ts:4
↓ 34 callers
Method
width
()
src/model/time-scale.ts:297
↓ 33 callers
Method
addCustomSeries
* Creates a custom series with specified parameters. * * A custom series is a generic series which can be extended with a custom renderer to * i
src/api/ipane-api.ts:133
↓ 33 callers
Method
key
* Returns the key for the specified horizontal scale item. * * @param internalItem - horizontal scale item for which the key should be returned
src/model/ihorz-scale-behavior.ts:77
↓ 33 callers
Method
setVisibleLogicalRange
* Sets visible [logical range](/time-scale.md#logical-range) of data. * * @param range - Target visible logical range of data. * @example * ``
src/api/itime-scale-api.ts:85
↓ 32 callers
Function
plotRow
(index: TimePointIndex, time: TimePoint, value: PlotRowValue)
tests/unittests/plot-list.spec.ts:16
↓ 29 callers
Method
data
* Returns all the bar data for the series. * * @returns Original data items provided via setData or update methods. * @example * ```js * con
src/api/iseries-api.ts:227
↓ 28 callers
Method
coordinateToPrice
* Converts specified coordinate to price value according to the series price scale * * @param coordinate - Input coordinate to be converted * @r
src/api/iseries-api.ts:84
↓ 28 callers
Method
isEmpty
()
src/model/time-scale.ts:296
↓ 28 callers
Method
timeScale
()
src/model/chart-model.ts:436
↓ 28 callers
Method
unsubscribeAll
(linkedObject: unknown)
src/helpers/isubscription.ts:6
↓ 26 callers
Function
positionsLine
( positionMedia: number, pixelRatio: number, desiredWidthMedia: number = 1, widthIsBitmap?: boolean )
plugin-examples/src/helpers/dimensions/positions.ts:15
↓ 25 callers
Method
fire
(param1: T1, param2: T2, param3: T3)
src/helpers/delegate.ts:32
↓ 25 callers
Function
size
(barSpacing: number, coeff: number)
src/plugins/series-markers/utils.ts:11
↓ 24 callers
Method
_updateData
()
indicator-examples/src/indicators/ratio/ratio-indicator.ts:76
↓ 24 callers
Method
priceFormatter
* Returns current price formatter * * @returns Interface to the price formatter object that can be used to format prices in the same way as the ch
src/api/iseries-api.ts:68
↓ 24 callers
Method
seriesOrder
* Gets the zero-based index of this series within the list of all series on the current pane. * * @returns The current index of the series in the
src/api/iseries-api.ts:352
↓ 24 callers
Method
seriesType
* Return current series type. * * @returns Type of the series. * @example * ```js * const lineSeries = chart.addSeries(LineSeries); * cons
src/api/iseries-api.ts:305
↓ 23 callers
Function
assert
(condition: boolean, message?: string)
src/helpers/assertions.ts:7
↓ 23 callers
Method
firstValue
()
src/model/iprice-data-source.ts:15
↓ 23 callers
Function
generateLineData
(numberOfPoints: number = 500)
plugin-examples/src/sample-data.ts:26
↓ 23 callers
Method
logicalToCoordinate
* Converts a logical index to local x coordinate. * * @param logical - Logical index needs to be converted * @returns x coordinate of that time
src/api/itime-scale-api.ts:103
↓ 23 callers
Method
measureText
(ctx: CanvasCtxLike, text: string, optimizationReplacementRe?: RegExp)
src/model/text-width-cache.ts:27
↓ 23 callers
Method
model
()
src/model/iprice-data-source.ts:20
↓ 23 callers
Method
setVisibleRange
* Sets visible range of data. * * Note that this method cannot extrapolate time and will use the only currently existent data. * Thus, for examp
src/api/itime-scale-api.ts:67
↓ 23 callers
Method
subscribeDataChanged
* Subscribe to the data changed event. This event is fired whenever the `update` or `setData` method is evoked * on the series. * * @param handl
src/api/iseries-api.ts:244
↓ 23 callers
Method
updateSeriesData
(series: Series<TSeriesType>, data: SeriesDataItemTypeMap<HorzScaleItem>[TSeriesType], historicalUpdate: boole
src/model/data-layer.ts:247
↓ 22 callers
Method
addPane
* Add a pane to the chart * @param preserveEmptyPane - Whether to preserve the empty pane * @returns The pane API
src/api/ichart-api.ts:325
↓ 22 callers
Function
addResizeHandler
(window: Window, container: HTMLElement, resize: (width: number, height: number) => void)
website/plugins/enhanced-codeblock/theme/CodeBlock/import-lightweight-charts-version.ts:49
↓ 22 callers
Function
convertToLineData
(candleData: CandleData[])
indicator-examples/src/sample-data.ts:137
↓ 22 callers
Method
move
()
plugin-examples/src/plugins/delta-tooltip/multi-touch-chart-events.ts:126
↓ 22 callers
Method
search
(index: TimePointIndex, searchMode: MismatchDirection = MismatchDirection.None)
src/model/plot-list.ts:75
↓ 22 callers
Method
state
()
src/gui/pane-widget.ts:172
↓ 21 callers
Method
length
()
src/model/price-range-impl.ts:49
↓ 21 callers
Function
merge
(dst: Record<string, any>, ...sources: Record<string, any>[])
src/helpers/strict-type-checks.ts:13
↓ 21 callers
Method
subscribeClick
* Subscribe to the chart click event. * * @param handler - Handler to be called on mouse click. * @example * ```js * function myClickHandler
src/api/ichart-api.ts:208
↓ 21 callers
Method
subscribeCrosshairMove
* Subscribe to the crosshair move event. * * @param handler - Handler to be called on crosshair move. * @example * ```js * function myCrossh
src/api/ichart-api.ts:268
↓ 20 callers
Method
getHTMLElement
* Retrieves the HTML element of the pane. * * @returns The HTML element of the pane or null if pane wasn't created yet.
src/api/ipane-api.ts:54
↓ 20 callers
Function
positionsBox
( position1Media: number, position2Media: number, pixelRatio: number )
plugin-examples/src/helpers/dimensions/positions.ts:37
↓ 19 callers
Function
ensureDefined
(value: T | undefined)
src/helpers/assertions.ts:22
↓ 19 callers
Function
formatDate
(date: Date, format: string, locale: string)
src/formatters/format-date.ts:16
↓ 19 callers
Function
getSeriesDataCreator
(seriesType: TSeriesType)
src/api/get-series-data-creator.ts:140
↓ 19 callers
Method
getVisibleLogicalRange
* Returns the current visible [logical range](/time-scale.md#logical-range) of the chart as an object with the first and last time points of the logic
src/api/itime-scale-api.ts:74
↓ 19 callers
Method
paneIndex
* Retrieves the index of the pane. * * @returns The index of the pane. It is a number between 0 and the total number of panes - 1.
src/api/ipane-api.ts:40
↓ 19 callers
Method
unsubscribeDataChanged
* Unsubscribe a handler that was previously subscribed using {@link subscribeDataChanged}. * * @param handler - Previously subscribed handler *
src/api/iseries-api.ts:255
↓ 18 callers
Method
generateContrastColors
(background: string)
src/model/colors.ts:122
↓ 18 callers
Function
generateRgba
(rgba: SimpleRgba)
tests/unittests/color.spec.ts:9
↓ 18 callers
Method
visible
()
src/model/iseries.ts:77
↓ 17 callers
Method
_invalidate
(mask: InvalidateMask)
src/model/chart-model.ts:1245
↓ 17 callers
Method
minValue
()
src/model/price-range-impl.ts:41
↓ 17 callers
Method
update
* This method will be called with the latest data for the renderer to use * during the next paint.
src/model/icustom-series.ts:247
↓ 16 callers
Method
_model
()
src/gui/pane-widget.ts:677
↓ 16 callers
Method
height
* Returns a height of the time scale.
src/api/itime-scale-api.ts:145
↓ 15 callers
Method
barSpacing
()
src/model/time-scale.ts:304
↓ 15 callers
Function
clone
(object: T)
src/helpers/strict-type-checks.ts:53
↓ 15 callers
Method
lightUpdate
()
src/model/chart-model.ts:449
↓ 15 callers
Method
maxValue
()
src/model/price-range-impl.ts:45
↓ 15 callers
Method
scrollToPosition
* Scrolls the chart to the specified position. * * @param position - Target data position * @param animated - Setting this to true makes the cha
src/api/itime-scale-api.ts:33
↓ 14 callers
Method
fire
(param1: T1)
plugin-examples/src/helpers/delegate.ts:50
↓ 14 callers
Method
timeToIndex
(time: InternalHorzScaleItem, findNearest: boolean)
src/model/time-scale.ts:302
↓ 13 callers
Function
generateBars
(count = 500, startDay = 15)
tests/e2e/memleaks/test-cases/series.js:38
↓ 13 callers
Method
getElement
()
src/gui/pane-widget.ts:202
↓ 13 callers
Method
gradientColorAtPercent
( topColor: string, bottomColor: string, percent: number )
src/model/colors.ts:134
↓ 13 callers
Method
left
()
src/model/range-impl.ts:14
↓ 13 callers
Method
minMaxOnRangeCached
(start: TimePointIndex, end: TimePointIndex, plots: readonly PlotRowValueIndex[])
src/model/plot-list.ts:91
↓ 12 callers
Method
_makeCompatEvent
(event: MouseEvent | TouchEvent, touch?: Touch)
src/gui/mouse-event-handler.ts:798
↓ 12 callers
Method
calculateConflationLevelWithSmoothing
(barSpacing: number, devicePixelRatio: number, smoothingFactor: number)
src/model/data-conflater.ts:40
next →
1–100 of 4,839, ranked by callers