Release v31.1.0 (from 6b804c486857f27920cf761aa7eb6e29d9bb6362)

This commit is contained in:
jenkins
2026-04-08 18:26:06 +00:00
parent c8eebb69a4
commit aa70f376c9
16 changed files with 512 additions and 418 deletions

View File

@@ -4,9 +4,33 @@
<!-- markdownlint-disable no-emphasis-as-heading -->
<!-- markdownlint-disable no-inline-html -->
<!-- markdownlint-disable code-block-style -->
## Version 31.1.0
*Date: Wed Apr 08 2026*
**New Features**
- **Added CSP nonce support for widget bootstrap scripts and same-origin iframe loading.** The new [`nonce`](https:/www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.ChartingLibraryWidgetOptions#nonce) widget constructor property applies a Content Security Policy (CSP) nonce to TradingView-owned bootstrap scripts and runtime-created style/script tags inside the library iframe. When `nonce` is omitted, the library attempts to infer the nonce from `window.__tvCspNonce` or a host-page `<script nonce>`. Script nonce propagation is supported. However, strict nonce-based `style-src` CSP is not currently supported, and library styles still require `style-src 'unsafe-inline'`. This property also works with the [`iframe_loading_same_origin`](https:/www.tradingview.com/charting-library-docs/latest/customization/Featuresets#iframe_loading_same_origin) featureset. In this case, the `sameorigin.html` response can provide its own nonce by setting `window.__tvCspNonce`, which takes precedence over the parent-side value.
- **Added globally shared mode for drawings.** This feature allows users to synchronize drawings across all layouts for the same symbol.
The update also adds a "New drawings sync globally" button to the [drawing toolbar](https:/www.tradingview.com/charting-library-docs/latest/ui_elements/drawings#drawing-toolbar).
**Improvements**
- **Extended save/load adapter API for separate drawings storage.** The [`saveLineToolsAndGroups`](https:/www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IExternalSaveLoadAdapter#savelinetoolsandgroups) method now receives an optional `context` argument containing metadata (`sharingMode`, `symbol`, `requestId`). The [`loadLineToolsAndGroups`](https:/www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IExternalSaveLoadAdapter#loadlinetoolsandgroups) request context is exposed through [`LineToolsAndGroupsLoadRequestContext`](https:/www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.LineToolsAndGroupsLoadRequestContext). For more information, see [Saving drawings separately](https:/www.tradingview.com/charting-library-docs/latest/saving_loading/saving_drawings_separately).
- **Added UI support for multiple exit levels on the chart.** The Take Profit and Stop Loss buttons now reappear on the parent order after the initial brackets are placed. This allows users to add [multiple exit levels](https:/www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/brackets#multiple-exit-levels) directly from the chart. (Trading Platform only)
**Bug Fixes**
- **Fixed an error in the broker sample implementation when placing a Stop Loss order.** (Trading Platform only)
- **Fixed delayed chart refresh when applying trading property overrides.** The chart now updates immediately when applying overrides to `tradingProperties.showOrders` and `tradingProperties.showPositions`, without requiring user interaction. (Trading Platform only)
- **Fixed an issue where adding orders with exit levels caused a `ReferenceError TradedItemType is not defined`.** (Trading Platform only)
---
## Version 31.0.0
*Date: Thu Mar 05 2026*
*Date: Fri Mar 06 2026*
**New Features**
@@ -62,7 +86,7 @@ The [Introduction](https:/www.tradingview.com/charting-library-docs/latest/intro
**New Features**
- **Added the `legend_bar_change_colors_based_on_value` featureset.** When enabled, bar change values in the legend are colored based on their value (positive, negative, or zero). Applies only to non-OHLC chart types.
- **Added the `legend_bar_change_colors_based_on_value` featureset.** When enabled, bar change values in the legend are dynamically colored. For non-OHLC chart types, the color depends on the value (positive, negative, or zero). For OHLC chart types, the library uses the series' own color scheme.
- **Added the `applyOverrides` method to the `IChartWidgetApi` interface.** Unlike [`IChartingLibraryWidget.applyOverrides`](https:/www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IChartingLibraryWidget#applyoverrides), which applies overrides to **all charts**, this new method allows applying overrides to **specific chart instances**.
Refer to [Apply overrides](https:/www.tradingview.com/charting-library-docs/latest/ui_elements/Chart#apply-overrides) for usage example.
@@ -233,6 +257,16 @@ Old styles like `'ctrl+shift+/'` or `['ctrl', 'shift', '/']` are deprecated. Use
---
## Version 29.6.0
*Date: Wed Aug 13 2025*
**Improvements**
- **Added a `label` property to `StudyOrDrawingAddedToChartEventParams`.** The [`label`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.StudyOrDrawingAddedToChartEventParams/#label) property contains the indicator's name as defined in the [`description`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.RawStudyMetaInfo/#description) field of its [metainfo](https://www.tradingview.com/charting-library-docs/latest/custom_studies/metainfo/).
---
## Version 29.5.0
*Date: Tue Aug 05 2025*