klinecharts/KLineChart
๐Lightweight k-line chart that can be highly customized. Zero dependencies. Support mobile.๏ผๅฏ้ซๅบฆ่ชๅฎไน็่ฝป้็บงk็บฟๅพ๏ผๆ ็ฌฌไธๆนไพ่ต๏ผๆฏๆ็งปๅจ็ซฏ๏ผ
+ ๐ 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.
+ ๐ 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.
+ ๐ 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`.
+ ๐ 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.
+ ๐ Fix typescript reference error.
+ ๐ 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.
+ Error publish.
+ ๐ 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.
+ ๐ 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.
+ ๐ 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.
+ ๐ The x-axis supports displaying future time. + ๐ Fix the issue that `subscribeAction` type is `ActionType.OnCandleBarClick` and it does not work.
+ ๐ 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.
+ ๐ 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`.
+ ๐ Fix style configuration `yAxis.type: 'percentage'` error. + ๐ Fix declaration issue in typescript.
+ ๐ 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.
+ ๐ Fix the issue of unsynchronized price and volume precision in indicator precision.
+ ๐ 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.
+ ๐ Optimize the default right offset distance of the chart. + ๐ Fix area chart display issue. + ๐ Fix occasional blank spaces in chart.
+ ๐ 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)
+ ๐ 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.
+ ๐ 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.
+ ๐ 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.
+ ๐ 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.
+ ๐ Fix indicators and overlays methods not effect error. + ๐ Fix package manager download node version dependency error.
+ ๐ 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.
+ ๐๏ธ 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.
+ ๐ 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`.
+ ๐ Fix typescript import error.
+ ๐ 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.
+ ๐ Add chart api `getOverlayClass`. + ๐ Style configuration `candle.tooltip.custom` add built-in support `change`. + ๐ Optimize figure `rect` event trigger. + โฉ๏ธ Separator event trigger optimization rollback.
