GitPedia
klinecharts

klinecharts/KLineChart

๐Ÿ“ˆLightweight k-line chart that can be highly customized. Zero dependencies. Support mobile.๏ผˆๅฏ้ซ˜ๅบฆ่‡ชๅฎšไน‰็š„่ฝป้‡็บงk็บฟๅ›พ๏ผŒๆ— ็ฌฌไธ‰ๆ–นไพ่ต–๏ผŒๆ”ฏๆŒ็งปๅŠจ็ซฏ๏ผ‰

30 Releases
Latest: 2w ago
Version 10.0.0-beta3v10.0.0-beta3Latest
liihuuliihuuยท2w agoยทJune 3, 2026
GitHub

+ ๐Ÿ†• Support custom hot keys. + ๐Ÿ†• A new continuous drawing mode is added to the cover, and a `brush` is added to the built-in cover. + ๐Ÿ‘‰ Adjust the calculation logic of the built-in indicator `RSI`. + ๐Ÿž Fix the problem that when the overlay is locked, the event falls on the overlay and the chart cannot be scrolled. + ๐Ÿž Fix the problem that overlays that are forced to end drawing cannot be restored through `createOverlay`. + ๐Ÿž Fix the issue of drawing response in overlay field weakening mode. + ๐Ÿž Fix an issue where data request method callbacks may be triggered infinitely when loading data backwards. + ๐Ÿž Fix the problem that `resize` may not take effect.

Version 10.0.0-beta2v10.0.0-beta2
liihuuliihuuยท1mo agoยทMay 19, 2026
GitHub

+ ๐Ÿ†• New Features + Support multiple y-axes. Multiple y-axes can be created in the same pane, and indicators can be bound to a specified y-axis through `yAxisId`. + Add instance methods `overrideXAxis(options)` and `overrideYAxis(options)` for independently configuring the x-axis and y-axis. + The chart now supports automatically listening to container size changes and calling `resize()`. + Add the `text` type to indicator figures, allowing indicator `figures` to draw text directly. + ๐Ÿ‘‰ Changes + In the chart method `init(ds, options)`, `options.layout` has been changed from an array structure to an object structure, with `basicParams` and `panes` added: + `basicParams` supports configuring `barSpaceLimitMin`, `barSpaceLimitMax`, `yAxisPosition`, `yAxisInside`, `paneMinHeight`, and `paneHeight`. + `panes` is used to configure pane layout, and pane content supports specifying a y-axis configuration for an indicator through `{ indicator, yAxis }`. + The instance method `createIndicator(indicator, isStack?, paneOptions?)` has been changed to `createIndicator(indicator, options?)`, and `options` supports `isStack`, `pane`, and `yAxis`. + `setPaneOptions(options)` no longer includes axis configuration. Use `overrideXAxis(options)` or `overrideYAxis(options)` for axis configuration. + Add `yAxisId` to the `filter` parameter of `convertToPixel(value, filter?)` and `convertFromPixel(coordinate, filter?)`. + ๐Ÿž Fixed the parameter type error of the instance API `setZoomAnchor`. + ๐Ÿ’„ Optimized the build process. The build tool has been changed from rollup to Vite, and `type-check` has been added.

Version 10.0.0-beta1v10.0.0-beta1
liihuuliihuuยท7mo agoยทNovember 20, 2025
GitHub

+ ๐Ÿ†• New Features + Support thousands separators and custom decimal collapse. + Support displaying future time on the x-axis. + Support dragging the y-axis on mobile devices. + Support creating multiple metrics with the same name on the same window. + Rewrote the axis module; custom y-axis supports setting the range. + Add `zoomAnchor` to the `options` method of the chart method `init(dom, options)`. + New instance methods `setZoomAnchor(anchor)`, `getZoomAnchor()`, `setDataLoader(loader)`, `setSymbol(symbol)`, `getSymbol()`, `setPeriod(period)`, `getPeriod()`, `resetData()`, `setThousandsSeparator(thousandsSeparator)` , `getThousandsSeparator()` , `setDecimalFold(decimalFold)` , `getDecimalFold()` , `getIndicators()` and `getOverlays()` . + Add style configurations: `candle.priceMark.last.extendTexts`, `candle.tooltip.title`, `candle.tooltip.legend`, `indicator.tooltip.title`, `indicator.tooltip.legend`, `crosshair.horizontal.features`, `candle.bar.compareRule`, `indicator.ohlc.compareRule`, and `candle.priceMark.last.compareRule`. + Add `onIndicatorTooltipFeatureClick` and `onCrosshairFeatureClick` to the `type` parameter in the instance methods `subscribeAction` and `unsubscribeAction`. + ๐Ÿ‘‰ Changes + In the chart method `init(dcs, options)`, the `position` sub-item of `options.layout` has been changed to `order`, `options.thousandsSeparator` has been changed to the object `{ sign, format }`, `options.decimalFoldThreshold` has been changed to `options.decimalFold`, `options.customApi` has been changed to `options.formatter`, and the parameter of `formatDate` has been changed to an object. + In the instance methods `setCustomApi` and `getCustomApi` have been changed to `getFormatter`, the return value of `getBarSpace()` has been changed to an object, the return value of `createIndicator` has been changed to return the indicator ID, and the input parameter `paneId` of `overlayIndicator` has been merged into the input parameter `indicator`. + The return value of the custom metric `createTooltipDataSource` method has been changed from `values` to `legends`, and `icons` to `features`. + The style configurations `candle.tooltip.icons` and `indicator.tooltip.icons` have been changed to `indicator.tooltip.features`. + ๐Ÿ’„ Optimizations + Optimized the `figure` element in the overlay template to ignore event types, ensuring the event name matches the event name in `overlay`. + Optimized the execution of metric calculation tasks. + Optimized the triggering of scroll events on mobile devices. + ๐Ÿ—‘ Deprecated + The following chart methods have been removed: `utils.drawArc(ctx, arc, styles)`, `utils.drawCircle(ctx, circle, styles)`, `utils.drawLine(ctx, line, styles)`, `utils.drawPolygon(ctx, polygon, styles)`, `utils.drawRect(ctx, rect, styles)`, `utils.drawText(ctx, text, styles)`, `utils.drawRectText(ctx, rectText, styles)`. Please use `getFigureClass(name)` instead. + The following instance method has been removed: `setPriceVolumePrecision(pricePrecision, volumePrecision)`. Please use `setPrecision(precision)` instead. + In the instance API, remove `setLoadMoreData`, `applyNewData`, and `updateData`. Replace them with `setDataLoader`. Remove `clearData`, `setPrecision`, and `getPrecision`. + In the instance method, remove `getIndicatorByPaneId(paneId, name)`. Replace it with `getIndicators(filter)`. + In the instance method, remove `getOverlayById(id)`. Replace it with `getOverlays(filter)`. + In the instance methods `subscribeAction` and `unsubscribeAction`, remove the parameter `onTooltipIconClick`. Replace it with `onCandleTooltipFeatureClick` and `onIndicatorTooltipFeatureClick`. + The style configuration removes `yAxis.position`, `yAxis.type`, `yAxis.inside`, and `yAxis.inside`. Please use the properties in the `axis` section of the window configuration instead. For details, see the chart API `[init(dcs, options)](/api/chart/init#parameters)`, the instance APIs `[createIndicator(value, isStack, paneOptions)](/api/instance/createIndicator#parameters)`, and `[setPaneOptions(options)](/api/instance/setPaneOptions#parameters)`. + In style configuration, remove `candle.tooltip.defaultValue` and replace `candle.tooltip.custom` with `candle.tooltip.legend`. Also remove `candle.tooltip.text`, `indicator.tooltip.showName`, and `indicator.tooltip.showParams`; use `indicator.tooltip.title` instead. Remove `indicator.tooltip.defaultValue` and replace it with `indicator.tooltip.legend`. Also remove `indicator.tooltip.text` and `overlay.rectText`. + In built-in basic graphics, remove `rectText` and replace it with `text`.

Version 10.0.0-alpha9v10.0.0-alpha9
liihuuliihuuยท9mo agoยทSeptember 1, 2025
GitHub

+ ๐Ÿ‘‰ Change the return value of the indicator method `calc` from an array to an object keyed by a timestamp. + ๐Ÿ’„ Optimize indicator calculation task execution. + ๐Ÿž Fix an issue where the instance APIs `setSymbol`, `setPeriod`, and `setDataLoader` did not reset the Y axis.

Version 10.0.0-alpha8v10.0.0-alpha8
liihuuliihuuยท1y agoยทJune 13, 2025
GitHub

+ ๐Ÿž Fix typescript reference error.

Version 10.0.0-alpha7v10.0.0-alpha7
liihuuliihuuยท1y agoยทJune 13, 2025
GitHub

+ ๐Ÿ‘‰ Chart api `init(ds, options)` , `options.customApi` changed to `options.formatter` , `formatDate` parameter changed to object. + ๐Ÿ‘‰ Instance api `setCustomApi` changed to `setFormatter` , `getCustomApi` changed to `getFormatter`. + ๐Ÿ†• Style configuration add `candle.priceMark.last.extendTexts` , `candle.tooltip.title` , `candle.tooltip.legend` , `indicator.tooltip.title` , `indicator.tooltip.legend` and `crosshair.horizontal.features` . + ๐Ÿ†• Instance api add `setDataLoader` , `setSymbol` , `getSymbol` , `setPeriod` , `getPeriod` and `resetData` . + ๐Ÿ†• Instance api `subscribeAction` and `unsubscribeAction` params add `onIndicatorTooltipFeatureClick` and `onCrosshairFeatureClick` . + ๐Ÿ—‘ Remove `candle.tooltip.defaultValue` in style configuration, replace `candle.tooltip.custom` with `candle.tooltip.legend`, remove `candle.tooltip.text`, remove `indicator.tooltip.showName`, `indicator.tooltip.showParams`, use `indicator.tooltip.title`, remove `indicator.tooltip.defaultValue`, replace with `indicator.tooltip.legend`, remove `indicator.tooltip.text`. + ๐Ÿ—‘ Remove `setLoadMoreData` , `applyNewData` , `updateData` in instance api, replace with `setDataLoader`, remove `clearData`, `setPrecision` and `getPrecision` . + ๐Ÿž Fix the confusion of overlay `onSelected` and `onDeselected` responses. + ๐Ÿž Fix the display problem when the style configuration `candle.type` is `ohlc` . + ๐Ÿ’„ Optimize the default event response of overlay events. + ๐Ÿ’„ Optimize the x-axis display.

Version 10.0.0-alpha6v10.0.0-alpha6
liihuuliihuuยท1y agoยทJune 11, 2025
GitHub

+ Error publish.

Version 10.0.0-alpha5v10.0.0-alpha5
liihuuliihuuยท1y agoยทMarch 9, 2025
GitHub

+ ๐Ÿ‘‰ Style configuration `candle.tooltip.icons` changed to `candle.tooltip.features`, `indicator.tooltip.icons` changed to `indicator.tooltip.features`. + ๐Ÿ‘‰ `icons` in the return value of the `createTooltipDataSource` method in the indicator changed to `features`. + ๐Ÿ‘‰ The instance api `subscribeAction` and `unsubscribeAction` input parameter `onTooltipIconClick` changed to `onCandleTooltipFeatureClick`, and the indicator event is replaced by `indicator.onClick`. + ๐Ÿž Fix the problem that scrolling cannot be performed in certain situations on mobile terminals. + ๐Ÿ’„ Optimize the display of overlay event response.

Version 10.0.0-alpha4v10.0.0-alpha4
liihuuliihuuยท1y agoยทFebruary 22, 2025
GitHub

+ ๐Ÿž Fix the issue that the parameter `more.backward` of `applyNewData` instance method is incorrect. + ๐Ÿž Fix the issue that a single piece of data causes a chart error.

Version 10.0.0-alpha3v10.0.0-alpha3
liihuuliihuuยท1y agoยทFebruary 18, 2025
GitHub

+ ๐Ÿ‘‰ The return value of the instance api `createIndicator` is changed to return the indicator id. + ๐Ÿ‘‰ The input parameter `paneId` of the instance api `overlayIndicator` is merged into the input parameter `indicator`. + ๐Ÿ‘‰ The return value of the instance api `getIndicators` is changed to return an array. + ๐Ÿ‘‰ The return value of the instance api `getOverlays` is changed to return an array. + ๐Ÿ†• The style configuration adds `candle.bar.compareRule`, `indicator.ohlc.compareRule` and `candle.priceMark.last.compareRule`. + ๐Ÿ†• Supports dragging the y-axis on mobile devices. + ๐Ÿ†• Supports creating multiple indicators with the same name on the same window. + ๐Ÿ’„ Optimize `figure` in `overlay` template to ignore event type, and the event name is consistent with the event name in `overlay`. + ๐Ÿž Fix the problem that the indicator custom prompt information may be wrong. + ๐Ÿž Fix the problem that the overlay being drawn may not be deleted correctly. + ๐Ÿž Fix the problem that the api `createOverlay` may not be created correctly when `points` is specified. + ๐Ÿž Fix the problem that the api `executeAction` may cause the `subscribeAction` to trigger infinitely.

Version 10.0.0-alpha2v10.0.0-alpha2
liihuuliihuuยท1y agoยทDecember 19, 2024
GitHub

+ ๐Ÿ†• The x-axis supports displaying future time. + ๐Ÿž Fix the issue that `subscribeAction` type is `ActionType.OnCandleBarClick` and it does not work.

Version 10.0.0-alpha1v10.0.0-alpha1
liihuuliihuuยท1y agoยทDecember 1, 2024
GitHub

+ ๐Ÿ†• New features + Support thousand separators and custom decimal folding. + Rewrite the axis module, and customize the y-axis to support setting ranges. + Add instance methods `setPrecision(precision)` , `getPrecision()` , `setThousandsSeparator(thousandsSeparator)` , `getThousandsSeparator()` , `setDecimalFold(decimalFold)` , `getDecimalFold()` and `setLoadMoreDataCallback(cb)` . + ๐Ÿ‘‰ Changes + Chart api `init(dcs, options)`, `position` in `options.layout` child changed to `order` , `formatDate(dateTimeFormat, timestamp, format, type)` in `options.customApi` changed to `formatDate(timestamp, format, type)` , `options.thousandsSeparator` changed to object `{ sign, format }` , `options.decimalFoldThreshold` changed to `options.decimalFold` . + Instance api `applyNewData(dataList, more, callback)` changed to `applyNewData(dataList, more)` . + Instance api `updateData(data, callback)` changed to `updateData(data)` . + Instance api `getBarSpace()` return value changed to object. + The return value of the custom indicator `createTooltipDataSource` method `values` is changed to `legends` . + ๐Ÿ—‘ Deprecated + Remove chart api `utils.drawArc(ctx, arc, styles)`, `utils.drawCircle(ctx, circle, styles)`, `utils.drawLine(ctx, line, styles)`, `utils.drawPolygon(ctx, polygon, styles)`, `utils.drawRect(ctx, rect, styles)`, `utils.drawText(ctx, text, styles)`, `utils.drawRectText(ctx, rectText, styles)`, please use `getFigureClass(name)` instead. + Remove instance api `setPriceVolumePrecision(pricePrecision, volumePrecision)`, please use `setPrecision(precision)` instead. + Remove instance api `applyMoreData(dataList, more, callback)`, `setLoadDataCallback(cb)` and `loadMore(cb)`, please use `setLoadMoreDataCallback(cb)` instead. + Remove instance api `getIndicatorByPaneId(paneId, name)`, please use `getIndicators(filter)` instead. + Remove instance api `getOverlayById(id)`, please use `getOverlays(filter)` instead. + Remove style configuration `yAxis.position` , `yAxis.type` , `yAxis.inside` and `yAxis.inside` , please use the properties in the window configuration `axis` instead. For details, refer to the chart API [init(dcs, options)](/api/chart/init#parameters), the instance API [createIndicator(value, isStack, paneOptions)](/api/instance/createIndicator#parameters) and [setPaneOptions(options)](/api/instance/setPaneOptions#parameters). + Remove `overlay.rectText` from style configuration. + Remove `rectText` from built-in basic graphics, please use `text` instead.

Version 9.8.10v9.8.10
liihuuliihuuยท2y agoยทJune 5, 2024
GitHub

+ ๐Ÿž Fix the issue of blurry drawing of basic graphics `rect`, `line`. + ๐Ÿž Fix the inaccurate zooming issue of instance methods `zoomAtCoordinate`, `zoomAtDataIndex` and `zoomAtTimestamp`. + ๐Ÿž Fix the issue of possible error in x-axis zooming. + ๐Ÿ’„ Optimize the instance method `subscribeAction`. When `type` is 'onScroll' and 'onZoom', the callback method adds a new parameter. + ๐Ÿ’„ Optimize the sub-item `attrs` in the indicator attribute `figures`. Add callback parameter `data`.

Version 9.8.9v9.8.9
liihuuliihuuยท2y agoยทMay 27, 2024
GitHub

+ ๐Ÿž Fix style configuration `yAxis.type: 'percentage'` error. + ๐Ÿž Fix declaration issue in typescript.

Version 9.8.8v9.8.8
liihuuliihuuยท2y agoยทMay 13, 2024
GitHub

+ ๐Ÿž Fixed the problem that the style configuration `candle.tooltip.custom` cannot be overridden when it is an array. + ๐Ÿž Fixed the issue of inaccurate decimal folding. + ๐Ÿ’„ Optimize the parameter `precision` in the overlay callback method.

Version 9.8.7v9.8.7
liihuuliihuuยท2y agoยทMay 10, 2024
GitHub

+ ๐Ÿž Fix the issue of unsynchronized price and volume precision in indicator precision.

Version 9.8.6v9.8.6
liihuuliihuuยท2y agoยทMay 6, 2024
GitHub

+ ๐Ÿž Fix an issue that chart API `registerIndicator` and `registerOverlay` parameters `extendData` cannot take effect. + ๐Ÿž Fix an issue of incorrect decimal folding when specifying `.` as the thousandth character. + ๐Ÿž Fix an issue where overlays may not be moved after being created.

Version 9.8.5v9.8.5
liihuuliihuuยท2y agoยทApril 13, 2024
GitHub

+ ๐Ÿ’„ Optimize the default right offset distance of the chart. + ๐Ÿž Fix area chart display issue. + ๐Ÿž Fix occasional blank spaces in chart.

Version 9.8.3v9.8.3
liihuuliihuuยท2y agoยทApril 11, 2024
GitHub

+ ๐Ÿ’„ Optimize styles by adding `offsetLeft`, `offsetTop`, `offsetRight` and `offsetBottom` to `candle.tooltip` and `indicator.tooltip`. + ๐Ÿ’„ Optimize figure and support array for attrs. + ๐Ÿ’„ Optimize y-axis render. + ๐Ÿ’„ Optimize default display, change the default candle width to 8. + ๐Ÿž Fix `applyMoreData` add duplicate data issue. [@cryptotooltop](https://github.com/cryptotooltop)

Version 9.8.2v9.8.2
liihuuliihuuยท2y agoยทMarch 25, 2024
GitHub

+ ๐Ÿ’„ Optimize the display of the area chart. + ๐Ÿ’„ Optimize smooth line drawing. + ๐Ÿž Fix the overlay and drawing it to future time may not be an issue.

Version 9.8.1v9.8.1
liihuuliihuuยท2y agoยทMarch 13, 2024
GitHub

+ ๐Ÿž Fix an issue where initialize only `xAxis` in `layout` caused the chart to fail to initialize. + ๐Ÿž Fix an issue when modify the built-in indicator `VOL` to `calcParams`. + ๐Ÿ’„ Optimize the accuracy of width calculation when display decimal fold on the y-axis. + ๐Ÿ’„ Optimize wheel event trigger.

Version 9.8.0v9.8.0
liihuuliihuuยท2y agoยทMarch 3, 2024
GitHub

+ ๐Ÿ†• Support custom coordinate axis. + ๐Ÿ†• Support indicator mapping to future time. + ๐Ÿ†• Support folding long decimals. + ๐Ÿ†• Support adding data forward and backward. + ๐Ÿž Fix formatting time issue for different browsers.

Version 9.7.2v9.7.2
liihuuliihuuยท2y agoยทJanuary 12, 2024
GitHub

+ ๐Ÿž Fix the issue of ineffective indicator attributes `minValue` and `maxValue`. + ๐Ÿž Fix the display issue on the x-axis of the overlay. + ๐Ÿ’„ Optimize the display of style `candle.type: 'ohlc'`. + ๐Ÿ’„ Optimize drawing clarity.

Version 9.7.1v9.7.1
liihuuliihuuยท2y agoยทDecember 17, 2023
GitHub

+ ๐Ÿž Fix indicators and overlays methods not effect error. + ๐Ÿž Fix package manager download node version dependency error.

Version 9.7.0v9.7.0
liihuuliihuuยท2y agoยทDecember 11, 2023
GitHub

+ ๐Ÿ†• Add instance apis`setMaxOffsetLeftDistance` and `setMaxOffsetRightDistance`. + ๐Ÿ†• Add indicator attribute `zLevel`. + ๐Ÿ’„ Optimize the rendering of the ohlc candle bar. + ๐Ÿž Fix the blurry issue with the candle bar. + ๐Ÿž Fix the rendering rules for the `zLevel` overlay.

Version 9.6.0v9.6.0
liihuuliihuuยท2y agoยทNovember 13, 2023
GitHub

+ ๐Ÿ–‹๏ธ Refactor the separator module. + ๐Ÿ†• Chart api `init(ds, options)`, parameter `options` add `layout`. + ๐Ÿ†• Instance api `createIndicator(value, isStack, paneOptions, callback)`, parameter `PaneOptions` add `position`. + ๐Ÿ†• Style `candle.tooltip.custom` adds `turnover` string template. + ๐Ÿ’„ Optimize the style `overlay.text` configuration. + ๐Ÿ’„ Optimize the implementation of `utils.clone` and `utils.merge`. + ๐Ÿž Fix the issue of multiple overlay styles display error. + ๐Ÿž Fix the issue of multiple indicator styles display error.

Version 9.5.4v9.5.4
liihuuliihuuยท2y agoยทSeptember 21, 2023
GitHub

+ ๐Ÿž Fix the issue of not display the latest price line when the style `candle.type` is `area`. + ๐Ÿž Fix the issue of incorrect display of the style `crosshair.vertical.text.paddingLeft`.

Version 9.5.3v9.5.3
liihuuliihuuยท2y agoยทSeptember 18, 2023
GitHub

+ ๐Ÿž Fix typescript import error.

Version 9.5.2v9.5.2
liihuuliihuuยท2y agoยทSeptember 17, 2023
GitHub

+ ๐Ÿ’„ Optimize the figure `text`. + ๐Ÿ’„ Optimize built-in overlays `simpleAnnotation` and `simpleTag`. + ๐Ÿ’„ Optimize the free style of technical indicators and support increment. + ๐Ÿž Fix typescript declaration issue.

Version 9.5.1v9.5.1
liihuuliihuuยท2y agoยทAugust 13, 2023
GitHub

+ ๐Ÿ†• Add chart api `getOverlayClass`. + ๐Ÿ†• Style configuration `candle.tooltip.custom` add built-in support `change`. + ๐Ÿ’„ Optimize figure `rect` event trigger. + โ†ฉ๏ธ Separator event trigger optimization rollback.