Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Q&A

This page contains frequently asked questions and answers about DXcharts.


Q1: Is DxCharts-react compatible with React 18?​

A: Yep, it is fully compatible with React 18

reference — Getting started with DXcharts React, Migration guide


Q2: Is DxCharts-react compatible with React 19?​

A: React 19 is supported

reference — Migration guide


Q3: Are styled components a hard dependency for overriding styles in the chart?​

A: That's something we are going to work on in the near feature, however there is no major influence on performance since we don’t have to much react rendering on controls

reference — Ways to customize, Styling, Config override, CSS override, UI overrides


Q4: Can you override the left sidebar component? If we want to remove certain drawing tools, or create a custom sidebar component with a hierarchy of groups​

A: You will be able to remove certain drawings and change their order, changes in a hierarchy aren’t available through API

reference — Sidebar component, Drawings configuration


Q5: Can you remove or override the trading components? E.g. hide the buy/sell buttons on display info​

A: Yep, you can hide our trading components and create your own on top. One of the examples from the other project is attached to this message https://files.slack.com/files-pri/T7RV222NQ-F069XRJHD1D/screenshot_2023-12-15_at_17.09.52.png

reference — UI overrides, Config override, Order component


Q6: do you know which data point that the % scale on DXCharts benchmarks against? The 0% line usually intersects the first candle on the chart but not always at an : open, low, high, or close value. See the image below.​

A: Beginning of the visible chart is the starting point for comparison (0%). All other values are calculated relative to that baseline. The baseline is the close price of the first candle in the viewport. Percent change is: (price - baseline) * 100 / baseline.

reference — Compare charts


Q7: Can you disable the right click menu? Either on the Y Axis or on the chart. Can we override this menu's selections?​

A: Yep, you will be able to disable right click menu (both chart and Y-axis) and override selections

reference — Right-click menu elements, Config override


Q8: What's DXcharts size in KB?​

A: 990 kb (zip), 3,900 kb (uncompressed), 11,000 kb (source code)

reference — Getting started with DXcharts React


Q9: How easy to replace current charting solution​

A: Widget – easy, maybe 1 day. Library – depends on how they would like to customize it, what data provider they have etc. Best case – week or few, worst case – month or few.

no link — This is not a developer documentation question. Integration timelines depend on your scope and setup — contact your DXcharts account manager for an estimate.


Q10: Who does the integrations​

A: Clients team or DXcharts team based on T&M billing model.

no link — This is not a developer documentation question. Integration ownership is agreed per contract — contact your DXcharts account manager.


Q11: How do you trade from the charts? Which type of orders are supported?​

A: There is trading UI and API that will allow brokers to connect charts to their trading functionalities. Type of orders: Market, Limit, SL, TP

reference — Trading, Order provider


Q12: If there is an issue who can fix it? How fast? How many people work on the team?​

A: We have support package for those who are interested in predictable SLA. In general, all clients can report defect, we try to take everything into account

no link — This is not a developer documentation question. Support SLAs and response times depend on your support package — contact your DXcharts account manager.


Q13: Can you give us grace period for integrations​

A: Yes, there is free trial

no link — This is not a developer documentation question. Trial and licensing terms are agreed per contract — contact your DXcharts account manager.


Q14: Who is using it already?​

A: Banks, brokers, startups

no link — This is not a developer documentation question. For customer references and use cases — contact your DXcharts account manager.


Q15: Are there any major differences between the libraries we're using for the free trial and the libraries we would use if we decide to move forward on a paid subscription? I'd like to know if we're going to have to redo some of the development work after the free trial or if it's a smooth transition to go live​

A: There are no differences between trial and paid libraries. Once the trial library is integrated you won't have to reintegrate it again after receiving the paid build.


Q16: We want to align the Y Axis of custom data in a separate pane (a horizontal bar chart) with the Y Axis of our main DXChart​

A: If library needs to communicate with something outside of it, there is a need for additional coding. Clients might do it themselves or this can be delivered as sponsored (paid) feature based on T&M billing model


Q17: I just want to know if I have to draw a vertical line at a specific time, or you can simply say that I want to know the x position at the specific time. How can I calculate that?​

A: To redraw specific canvas only use chart.bus.fireDraw([this.dynamicObjectsCanvasModel.canvasId]) , this is more performant way. To find an X coordinate based on timestamp you should use chart.toXFromTimestamp method

reference — Custom drawer, Custom drawer — redraw


Q18: Why are my drawn lines partially erased when the graph is rendered? Am I drawing the lines on the wrong canvas?​

A: You use correct canvas, maybe your drawer calculates incorrect Y coordinate? you should draw line from bottom to top of canvas bounds area.

reference — Custom drawer


Q19: RoundingY-AxisLabelValues: Currently, the Y-axis label values are displayed with up to two decimal places. However, I need them to be rounded to up to five decimal places. Could you please advise on how I can achieve this customization?​

E.g -> in right side y -axis it is only showing 1.08 but the remaining of the y-axis are black due to round up to 2 decimals

A: Our documentation is to help with price precision — configure priceIncrements on each instrument via Symbol Suggest Provider.

reference — Price precision, Symbol suggest provider


Q20: Setting Margin-Top for Legend: I am wondering if there is a way to adjust the margin-top for the legends that are displayed in the top-left corner of the chart. I would like to customize their position, and any insights on how to achieve this would be greatly appreciated.​

A: There is no quick way to achieve. You can replace the legend header via uiOverrides (Legend.Header) or adjust layout with CSS overrides.

reference — UI overrides, CSS override, Component overriding — Overview


Q21: Rounding Y-Axis Label Values: Currently, the Y-axis label values are displayed with up to two decimal places. However, I need them to be rounded to up to five decimal places. Could you please advise on how I can achieve this customization?​

A: Precision is specified on the data level. Set priceIncrements on each instrument via SymbolSuggestProvider — whatever is configured there is displayed on the Y-axis (it can be more than two decimals). If this field is missing, two decimals are used by default.

The priceIncrements array format is [(priceIncrement, price,)*, incrementForOtherPrices] — for example [0.01, 1, 0.1, 10, 1] means increment 0.01 for price < 1, 0.1 for price < 10, and 1 for any other price. The array must contain at least 3 elements and the number of elements must be odd.

reference — Price precision, Symbol suggest provider


Q22: Can I use Vite as a bundler?​

A: Yes — Vite is fully supported as of DXcharts React v5.17.1 and higher (including web workers). Use the latest Vite 5.x and follow the required configuration in the Bundling guide. Webpack 5 remains the most battle-tested option if you run into bundler-specific issues.

reference — Bundling


Q23: How to create custom indicators?​

A: Custom indicators are implemented as JavaScript custom studies. Register a study with addCustomStudy() and define its calculation logic, parameters, and output plots.

reference — Custom studies


Q24: Do you have roadmap?​

A: Yes, you can reach out to DXcharts sales team to help with that


Q25: Are there heat maps in DXchart.​

A: No, we don't have heat maps and don't have any plans to add it.


Q26: How secure DXcharts is?​

A: DXcharts is a purely front end library. We don't store any users info


Q27: Are there external dependencies?​

A: Yes. DXcharts React depends on react, react-dom, @dx-private/dxchart5-react, @dx-private/dxchart5-modules, @dx-private/dxstudies, and uses styled-components for UI styling. See Packages and Getting started for the full list.

reference — Packages, Getting started with DXcharts React


Q28: Is there a dummy market data in the chart? is there a way to see how it works?​

A: The public demo at devexperts.com/dxcharts-demo uses real market data from the dxFeed demo feed with a 15-minute delay — not static dummy data. To run a chart locally without a live feed, use mock providers.

reference — Provider setup examples — live demo, Provider setup examples — mock providers


Q29: How to install library?​

A: Install via ZIP file or private npm registry. See Getting started for step-by-step instructions.

reference — Getting started with DXcharts React, Installing from ZIP file, Navigating this portal


Q30: How to add custom drawings?​

A: Built-in drawing tools cannot be extended via the library API. With source code access, you can add new drawing instruments. For canvas overlays without source code, use a custom drawer.

reference — Creating a custom drawing, Custom drawer, Working with drawings


Q31: Could you please provide detailed steps or documentation on how to effectively insert source data?​

A: The library is data-agnostic — connect your sources by implementing providers. Candles are passed in OHLCV format (Open, High, Low, Close, Volume) for drawing candles, volume, and indicators. Implement chartDataProvider for historical and live candles, symbolSuggestProvider for instrument search, and tradingSessionsProvider for session-based indicators such as VWAP.

reference — Chart Data Provider, Providers setup, dxFeed Integration, Symbol Suggest Provider, Trading Session Provider


Q32: I am interested in creating a custom graph(indicator). Could you share the necessary steps or resources to guide me through the process?​

A: Custom indicators are implemented as JavaScript custom studies. See the Custom studies documentation for how to define metadata, calculation logic, and output plots with addCustomStudy().

reference — Custom studies


Q33: After successfully creating a custom graph(indicator), I would like to understand how to create an API for it. Furthermore, could you provide guidance on integrating this API with the chart for seamless functionality?​

A: Custom indicators integrate with the chart through the chart React API. Register your study with __CHART_REACT_API.addCustomStudy() — define metadata (id, parameters, output lines) and a constructor.main function for the calculation. The chart then handles lifecycle automatically: real-time ticks, historical data loads, and parameter changes. Use removeCustomStudy() to unregister. Calculation runs client-side in JavaScript; there is no separate server-side indicator API to implement.

reference — Custom studies, Quick reference


A: Yes. For styling or hiding built-in elements, use config, CSS, or UI overrides. To draw custom overlays on the chart canvas, use a custom drawer or add data series and panes. For deeper changes, replace components via UI overrides.

reference — Ways to customize, Component overriding, Custom drawer, Data series, Panes


Q35: In cases where we are using the dxChart library, but do not have access to the source code, how can we integrate a custom API? Could you provide insights or best practices to achieve this integration?​

A: You cannot inject arbitrary custom APIs into the library internals. Integration is done through provider interfaces — implement the relevant provider (for example chartDataProvider, newsDataProvider, orderProvider) and pass it when creating the chart instance.

reference — Providers setup


Q36: What is the data ingestion framework for streaming quotes data into the dxCharts components? For better understanding, can you please explain the process flow.​

A: Streaming data flows through ChartDataProvider. The chart first calls requestHistoryData for OHLCV history, then subscribeCandles for live last-candle updates pushed via callback, and subscribeServiceData for streaming bid/ask and related quote fields. In the stock product, dxFeed dxLink handles snapshot and live stream subscription.

reference — Chart Data Provider — Data flow, dxFeed Integration


Q37: For technical indicators if we plan to utilize ML-driven methods, how would we integrate the same with the UI?​

A: That's in our plans for future, currently not supported in Library


Q38: How can integrate news that we would receive via another API to library’s event component in a way that the hover component is created automatically as soon as the news is received?​

A: Implement a NewsDataProvider that fetches news from your API and maps it to the NewsData format. The chart displays news icons above candles and opens the hover popup automatically when the user hovers an icon.

reference — News Data Provider, News, NewsComponent


Q39: What's the difference between library and widget (referred to lack of trading capabilities)​

A: Library is build for Trading platforms. Lots of customisation capabilities, trading functionality, build on React. For technical advanced teams or developers. While widget is build for website, there are customisations possible but restricted comparing with library but much easier to instal. Just get JS files, host them on your server, copy code from here https://devexperts.com/advanced-financial-chart-widget/, add your data provider and it is ready to go.

reference — Getting started with DXcharts widget — React library vs widget, Widget setup, DXcharts React quick start


Q40: Which of DXcharts solution better for TV​

A: They all suit, while we don't test our products on TV screens


Q41: What if I am looking for data provided along with charts?​

A: It is absolutely possible, we have our sister company DXfeed that sells market data. We have simplified integration with them. In the DXcharts library there is build in data provider that you can use

reference — dxFeed Integration, Packages


Q42: About x-axis: We have a lot of chart, some chart X-axis is time-base, but some x-axis data is from other different thing.​

A: Right now our dxchart5-react library only support time-based data

reference — Chart Data Provider


Q43: About jest configuration: I still didn’t understand how to configure jest to support es2020. Could you provide a whole “Hello Word”project with “vue2+dxchart.lib+jest”​

A: Dxcharts team recommends this guide https://jestjs.io/docs/ecmascript-modules for ESM support. We do not ship a vue2+jest hello-world sample, but you can run Jest with DXcharts: mock @dx-private/dxchart5-react in unit tests that do not need a live chart, or configure Jest to transform DXcharts packages (esbuild-jest + transformIgnorePatterns) and set chartReactConfig.disableWorkers: true when importing the library. For Vue integration see the createChart guide. For full chart testing use browser E2E (for example Playwright) rather than Jest.

reference — Bundling — Jest, Using DXcharts with Vue


Q44: About the multiple chart? I don’t want to add a new series via UI select, I want show the two series on first render.​

A: you have 2 options: - call method on init chartReactAPI.addCompareInstrument(symbol) if you have one additional instrument or chartReactAPI.setCompareInstruments(symbols) if you want to set more than one in a row.You can find the reference here https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/API%20Reference%20-%20API- there's a concept of LayoutProvider https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/Advanced/Sync%20state%20with%20external%20storage, you can provide the layout you need with compare instruments added in it, and chart will init with them automatically

reference — Compare charts — Setting compare instruments on first render, Supported APIs, Layout Provider


Q45: Do you have a full demo integrate dxchart and vue? I encounter some error when I am run unit test and build my project​

A: Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

By default "node_modules" folder is ignored by transformers.

Here's what you can do:

• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.

• If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript

• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.

• If you need a custom transformation specify a "transform" option in your config.

• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:

https://jestjs.io/docs/configuration

For information about custom transformations, see:

https://jestjs.io/docs/code-transformation

Details:

dxchart.lib\dxchart5-react\dist\utils\timezones\timezones.js:204

const _0x3754ff = (0, _comlink.wrap)(new Worker(new URL('./timezones-worker.js', import.meta['url']))),

^^^^

at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1728:14)

at Object.<anonymous> (dxchart.lib/dxchart5-react/dist/chart/chart-react-app.js:6:8032)

at Object.<anonymous> (dxchart.lib/dxchart5-react/dist/render-chart.js:6:6011)

reference — Using DXcharts with Vue, Bundling — Jest


Q46: Are you support a api which can let us fetch the new data when I drag the chart to the left side?​

A: Yes, when you reach the left edge of the loaded data, or earlier if startLoadDistance is configured, chartDataProvider.requestHistoryData is called again for lazy loading. For scrolling into earlier history, the chart passes toTime — the timestamp of the leftmost candle already loaded — so your provider can fetch the next older chunk.

reference — Chart Data Provider — toTime, Lazy loading configuration


Q47: How to pass the other graphic data structures in addition to candles. I have creare a chartDataProvider in our project, but I don’t know what data structures should be resolve by requestHistoryData.​

A: What other graphic data you mean? chartDataProvider has strict interface and you can find a d.ts file for it here `chart-react/dist/providers/chart-data-provider.d.ts

reference — Chart Data Provider, Data series


Q48: How to display four decimal places on the y-axis.​

A: That's not trivial too, Iet me write a guide for it. It depends on the instrument info you passed via SymbolSuggestProvider

reference — Price precision, Symbol suggest provider


Q49: didn’t see the complete configuration of initialChartConfig in the chart-with-modules.config.d.ts file.​

A: chart-with-modules.config.d.tsdepends on the dxcharts-lite config, it extends dxcharts-lite config. Modules are like addons for dxcharts-lite, which include drawings, studies etc. Full config for dxcharts-lite can be found heredxcharts-lite/dist/chart/chart.config.d.ts

reference — Chart configuration, Configuration and main concepts


Q50: How to intergra the Mandatory providers in createChart.​

A: how to use createChart function described in the https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/Quick%20Start/Quick%20Start%20-%20Vue, as you can see there's a second argument, which is exactly the same as dependencies prop in ChartReactApp React component. So you should pass your implementations of providers right here to the object that is passed as a second argument

reference — Using DXcharts with Vue, Providers setup, Getting started with providers


Q51: How to control the y-axis and x-axis range in my code? The library default show is the figure 1 below, and I want to show is Figure 2 below looks like​

A:

Chart automatically calculates the range of values on YAxis, it takes in count the maximum and minimum values of the candle data you provided. So the first option is to fix your data, because I can't see the point of not showing the user all the data you have on chart. The second option - you can control it programmatically, let me write a guide how you can do this, because that's not trivial at all.

how to control YAxis values decimal part.

When you implement symbolSuggestProvider there's Instrument interface all over the place. In Instrument interface there's a field called priceIncrements.

What is a priceIncrements?

// Price increment represent array of increment-price couples and trailing increment
// e.g. [(priceIncrement, price,)* incrementForOtherPrices]
// [0.01, 1, 0.1, 10, 1] means
// there are three increments (0.01 for price < 1 ), (0.1 for price < 10), (1 for any other price)

i.e increment is a step for a values on Y Axis, i.e if the increment is 0.01, it means that Y axis will show you the values like 1.01, 1.02, 1.03 etc.

These increments are used to format these values on YAxis. For your case you should pass smth like [0,0001, 1, 1] as a priceIncrements

NOTE: there should be at least 3 elements in priceIncrements array.

reference — Scaling, Price precision, Symbol suggest provider


Q52: I have implement a ‘SymbolSuggestProvider’, but I still don’t know how to write ‘priceIncrements’, what is [0,0001, 1, 1] means? It is not work for our data.​

When I pass SymbolSuggestProvider’, my y-axis data just display integer, not decimal. And just see one data in y-axis.

A: here's the definition of what price increment is

// Price increment represent array of increment-price couples and trailing increment

// e.g. [(priceIncrement, price,)* incrementForOtherPrices]

// for example [0.01, 1, 0.1, 10, 1] means that

// there are three increments (0.01 for price < 1), (0.1 for price < 10), (1 for any other price)

// it means, that if your price is smth like < 1, then values will have 2 decimal digits like 0.56, 077. If your price is < 10, then values on y-axis will have 1 decimal digit like 4.4, 9.5. And for prices > 10 values on y-axis will be 11, 15, 17 etc.

reference — Price precision, Symbol suggest provider


Q53: How to pass multiple data for custom provider? The demo just has one data. I want to show two candlesticks in one chart​

A: Just select compare instrument from the UI via toolbar button, and you will see one more series on top of main series.

reference — Compare charts, Compare charts — Setting compare instruments on first render


Q54: In the chart, how could we zoom in out with x-axis and y-axis at the same time.​

A: In order to zoom with x and y axis same time you would turn on Lock scale or Auto-scale price axis options (right click in Price Axis expends the context menu)

reference — Scaling


Q55: How to disabled the share button.​

A: Would you like to hide twitter and telergam sharing buttons or the whole snapshot menu?

reference — Snapshot sharing menu, Config override


Q56: Are there any api sending out data out of the library?​

A: The library does not expose a general-purpose API to send chart data out. Some builds include Google Analytics event logging (controlled at build time). Chart snapshot sharing uploads an image via your chartSharingProvider when the user uses the share menu.

reference — Chart Sharing Provider


Q57: How to implement multiple data in the one chart. (in the example, showing candlestick and histogram)​

A: Volume histograms are built into the chart (enable volumes in config). For multiple candle series from different instruments on the same chart, use compare series. For candlestick plus another series on independent Y-axes, use multiple scales or panes.

reference — Compare charts, Multiple scales, Multiple scales in DXcharts Lite, Panes


Q58: I have tried to figure out how to set the specified xAxis or yAxis range/scale during initialization but cannot find relevant configuration.​

A: subscribe to chartInstance.data.observeCandlesChanged after candles are set. Use instance.scale.setYScale / instance.scale.setXScale to manually specify range and scale right after initialization. And then set Autoscale to false initialChartConfig: { scale: { auto: false } }

reference — Scaling — Programmatic axis range, Chart configuration


Q59: We applied the settings from the document https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-lite/X%20Axis but found that the display looked strange and didn't follow what the documentation defined it would. What we want to achieve is to display all the data when the chart is first displayed. In addition to this, we want the Xscale gaps to be even.​

As shown in the picture below, this is the question mentioned in my previous email. Some gaps are based on month and some are based on years. We want its gaps to be normal and regular rather than the gaps in the picture appearing abnormally. The Xscala we need should be 1d 2d ...nd, or 1d, 3d, 5d...(2n+1)d. Same for year/month/time..etc

A:

Here's the default format config for x scale labels:

initialChartConfig: {
components: {
xAxis: {
formatsForLabelsConfig: {
lessThanSecond: 'mm:ss',
second_1: 'HH:mm:ss',
minute_1: 'HH:mm',
minute_5: 'HH:mm',
minute_30: 'HH:mm',
hour_1: 'HH:mm',
day_1: 'dd.MM',
month_1: 'MMM',
year_1: 'YYYY',
},
},
},
},

The thing is, that x-labels-generator takes into account the maximum possible length of a label, i.e number of symbols. For example in default config the longest format is HH:mm:ss, which is 8 symbols long. Bearing that in mind, x-axis labels-generator will try to position every possible label as if it has maximum possible length. And it stops on the first label, that satisfies all the requirements. That's why labels can be positioned not evenly.

You can overcome that by reducing the maximum possible length of a label. For example, if you know that you don't have seconds aggregation, and you don't need that long format like HH:mm:ss, just delete it.

i.e that's may be your config

initialChartConfig: {
components: {
xAxis: {
formatsForLabelsConfig: {
minute_1: 'HH:mm',
minute_5: 'HH:mm',
minute_30: 'HH:mm',
hour_1: 'HH:mm',
day_1: 'dd.MM',
month_1: 'MMM',
year_1: 'YYYY',
},
},
},
},

This will help you to make maximum possible length of a label more stable in average, in this example it will be 5 symbols in average. And because of that chart will be able to place labels more evenly.

reference — X-axis, Chart configuration


Q60: We cannot see complete configurations in the document, which is very troublesome for us to use. Can the document show the complete configuration? I highlighted one of these cases in below screenshot.https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/API%20Reference%20-%20Configuration. We can understand the attributes of APIs through the definition of TS, but even if we know what attributes this method requires, we don't know what it is used for. Some attribute definitions are not very clear, which also take us time to figure out what they are used for.​

A: Currently most of our documentation is auto-generated. Besides we're using documentation engine which is not supporting nested values description, eg. nested config objects. We've plans to change our documentation engine and also provide more self-handed articles rather than auto-generated. For now, probably, as a workaround, is better to use Typescript types definitions to understand our APIs.

reference — API reference for configuration, Chart configuration, Configuration and main concepts


Q61: Upon unzipping the files, I attempted to execute "npm install," at which point I was prompted to sign in to GitHub. However, when I tried to sign in using my email address kannan.ganesan@rksv.in, I encountered a "permission denied" error message. Kindly review the attached screenshot and provide assistance as necessary.​

A: For ZIP file owners, the right place to start will be https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/Quick%20Start/Quick%20Start%20-%20Zip Quote: "If you don't have an access to internal repository then this is a guide how to install dxCharts packages without it"

reference — Installing from ZIP file


Q62: upon attempting to launch the app, I encountered an error from Firebase stating index.esm2017.js:561 Uncaught FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists with different options or config (app/duplicate-app). Please refer to the attached image for further details and provide any suggestions you may have.​

A: Looks like there is a conflict between DXcharts analytics and your analytics account. You should reach out to Devexperts team to get a new build

no link — This requires a custom build with Google Analytics disabled. Contact your Devexperts representative.


Q63: Additionally, do you have a sample React app that includes integrated charts with examples demonstrating all the APIs and methods? If so, could you please share those as well? It would greatly assist us in the integration process.​

A: We currently don't have demo app that demonstrates all the available methods. https://devexperts.com/dxcharts-demo/

There lots of providers added as examples, such as: market data integration, symbol suggest provider, layout provider integration, logo added to the charts etc. Everything that is mentioned here is described in the documentation, so you do not necessarily need an access to source code to understand how we built these.

reference — Provider setup examples, Getting started with providers, Supported APIs


Q64: Is there a method to determine whether the requestHistoryData function is invoked for the initial data request for a symbol? The reason for this inquiry is that we utilize two distinct APIs to retrieve current day and historical data. Simply providing the 'from' and 'to' times doesn't suffice for our needs.​

Our current approach for the chart we are having involves: The chart library invokes the requestHistoryData function and with arguments such as 'from', 'to', and 'firstDataRequest'. If 'firstDataRequest' is true, we utilize our current day API to retrieve today's candle response, which we then pass back to the chart. We disregard the requested 'from' and 'to' values since we don't have a single API. If the returned candles are insufficient, the chart subsequently calls the same method again with 'firstDataRequest' set to false. At this point, we utilize the historical API to retrieve the necessary data from the previous day. The documentation provides only basic syntaxes and lacks detailed explanations. It doesn't offer a comprehensive understanding of how to utilize the methods provided by the DX chart.

A: Usually there are two kinds of Candle's data: 1) candles which are already in past - any candles before the current moment, even if it's the current day. 2) candles which are still incoming - candles will be received reactively in runtime.

For first kind of the candles data, we need to use requestHistoryData even if it's current day candles. For second one, we need to use method subscribeCandles which is implements subscription model for incoming data. Also, we need to learn, that there's not any point which can be called firstDataRequest and be somehow related to current day, because chart viewport can be initially scrolled into the distant past and firstDataRequest will not be include current day candles at all.

Seems like complexity on your side is connected with the fact that data source separates current day candles and all other previous candles for some reasons. And access to these data are presented through different api endpoints. In this case, probably the only solution is to abstract this inconvenience within the date provider itself. Looks like, they can just check fromTime/toTime parameters are belongs to current day, and make an additional request to get current candles data and merge it with historical data from second api endpoint. Pseudo-code bellow:

async function requestHistoryData(symbol, aggregation, { fromTime, toTime }, updateCallback) { const includesCurrentDay = checkIncludesCurrentDay(fromTime, toTime); const includesHistorical = checkIncludesHistorical(fromTime, toTime); const data: ChartCandleData = []; if (includesHistorical) { const historicalData = await fetchHistoricalData(symbol, aggregation, ...); data.push(...historicalData); } if (includesCurrentDay) { const currentDayData = await fetchCurrentDay(symbol, aggregation, ...); data.push(...currentDayData); } return data; }

reference — Chart Data Provider, Chart Data Provider — Data flow


Q65: How can we ensure that the charts are reloaded when the internet connection is lost and then restored? We anticipate that the charts should retrieve historical data and resubscribe once the internet connection is reestablished. Could you please advise us on how to accomplish this.​

A: Internet connection loss affects only live data, not historical. If you worry that historical data might be stale by the time when connection is restored you can use the last argument of requestHistoryData for manual data update

function requestHistoryData(symbol, aggregation, options, updateCallback) {

....

// something has happened with the connection, that it has been restored, you can request data again and call

updateCallback(data);

}

reference — Chart Data Provider — updateCallback, Chart Data Provider — Data flow


Q66: The requestHistoryData function isn't providing the expected parameters​

A: fromTime and toTime reflect the chart viewport state, not only user swipes. On initial load they are often undefined or 0 — load the latest dataset you need. fromTime may appear on subsequent loads or timeframe presets. When scrolling left into older history, lazy loading passes toTime (timestamp of the oldest loaded candle).

reference — Chart Data Provider — fromTime, Chart Data Provider — toTime


Q67: How do we configure sessions for different segments?, How do we pass special holidays and handle special trading sessions?​

A: TradingSessionsProvider needs to be implemented.

reference — Trading Session Provider


Q68: How do we configure price precision for different segments?​

A: Price Precision feature is described here (https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/Price%20Precision).

reference — Price precision, Symbol suggest provider


A: SymbolSuggestProvider needs to be implemented.

reference — Symbol suggest provider


Q70: Do we need to code anything to save indicator templates?​

A: IndicatorsTemplateProvider needs to be implemented.

reference — Indicator Templates Provider


Q71: Inserting Source Data into Graph: Could you please provide detailed steps or documentation on how to effectively insert source data into a graph using [name of the tool or library]?​

A: The library is data-agnostic — connect your sources by implementing providers. Candles are passed in OHLCV format (Open, High, Low, Close, Volume) for drawing candles, volume, and indicators. In DXcharts React, implement chartDataProvider for historical and live candles, symbolSuggestProvider for instrument search, and tradingSessionsProvider for session-based indicators such as VWAP. Alternatively, push OHLCV data directly to the chart-core instance with chart.setData({ candles }) — get the instance from api.onChartCreated. Use chart.updateData() for incremental updates without replacing the full history.

reference — Chart Data Provider, Providers setup, dxFeed Integration, Symbol Suggest Provider, Trading Session Provider, Getting started with DXcharts Lite, Using API


Q72: Creating a Custom Graph. I am interested in creating a custom graph(indicator). Could you share the necessary steps or resources to guide me through the process?​

A: Custom indicators are implemented as JavaScript custom studies. See the Custom studies documentation for how to define metadata, calculation logic, and output plots with addCustomStudy().

reference — Custom studies


A: Yes. For styling or hiding built-in elements, use config, CSS, or UI overrides. To draw custom overlays on the chart canvas, use a custom drawer or add data series and panes. For deeper changes, replace components via UI overrides.

reference — Ways to customize, Component overriding, Custom drawer, Data series, Panes


Q74: data ingestion framework : What is the data ingestion framework for streaming quotes data into the dxCharts components? For better understanding, can you please explain the process flow.​

A: Streaming data flows through ChartDataProvider. The chart first calls requestHistoryData for OHLCV history, then subscribeCandles for live last-candle updates pushed via callback, and subscribeServiceData for streaming bid/ask and related quote fields. In the stock product, dxFeed dxLink handles snapshot and live stream subscription.

reference — Chart Data Provider — Data flow, dxFeed Integration


Q75: Technical indicators & signals: For technical indicators if we plan to utilize ML-driven methods, how would we integrate the same with the UI?​

A: That's in our plans for future, currently not supported in Library


Q76: How can integrate news that we would receive via another API to library’s event component in a way that the hover component is created automatically as soon as the news is received.​

A: Implement a NewsDataProvider that fetches news from your API and maps it to the NewsData format. The chart displays news icons above candles and opens the hover popup automatically when the user hovers an icon.

reference — News Data Provider, News, NewsComponent


Q77: Can your component be used with Electron + NextJs (React) environment?​

A: Yes, in practice — DXcharts is a client-side React component and customers use it in Electron and Next.js, though we do not officially test or document a Next.js integration path. Mount ChartReactApp only in the browser ('use client' or dynamic(..., { ssr: false })). In Electron with strict CSP, you may need relaxed policy (for example script-src 'unsafe-eval' if you use custom JS studies or DXScript; worker-src blob: for timezone workers — see Q127).

reference — Using DXcharts with React — Next.js and Electron


Q78: can you provide example code for integrating your component with Next.js or React?​

A: React integration samples are in the quick-start guides. There is no dedicated Next.js guide — follow the React quick start and mount the chart as a client component.

reference — Using DXcharts with React, Getting started, Providers setup


Q79: In the demo of the component your company provides, there is an indicator search and add dialogue box; Can we add our custom-made indicators to this dialogue?​

A: Yes. Register custom indicators with __CHART_REACT_API.addCustomStudy() — they appear in the indicator search and add dialog alongside built-in studies.

reference — Custom studies, Custom studies — Study not appearing


Q80: Can we add and display the properties of our custom-made indicators in the indicator properties dialogue box?​

A: Yes. Define inputs in the study metainfo.parameters array when registering with addCustomStudy() — they are shown in the indicator properties dialog and can be edited by the user.

reference — Custom studies — Parameters


Q81: TradingView has a drawing tool called "Date and price range"; do you offer a similar feature?​

A: Yes. DXcharts includes the Date and Price Range drawing (date_price_range) — a shaded box between two points across time and price. It is available in the drawings toolbar/sidebar by default.

reference — Date and Price Range


Q82: Can the button placement or caption of the drawing tools be changed?​

A: Drawing tool captions can be changed via the localization dependency (for example localization.drawings.date_price_range). You can switch drawings between the sidebar and toolbar via chartReactConfig.drawings, and customize which tools appear via drawingsList. Reordering buttons or adding custom toolbar placements is not supported.

reference — Localization, Configuring drawings


Q83: Can we repeatedly display svg annotations (like arrows, circles, etc.) having tooltip text on the indicators lines or candle bars?​

A: Yes. Use a custom drawer to render SVG or canvas annotations on the chart and attach tooltips to your data points.

reference — Custom drawer


Q84: We would like to change the line color of specific indicators based on the reference value or direction. is this feature available?​

A: Built-in indicators do not support conditional line colors. With custom studies, you can return per-point colors from constructor.main (for example { value: rsi, color: '#00FF00' } when a value crosses a threshold), or use line types such as LINEAR_TREND, TREND_HISTOGRAM, and TREND_POINTS to color output by direction.

reference — Custom studies — Output lines (plots), Custom studies — Line types


Q85: Can we add a button for temporarily hiding or minimizing a specific indicator displayed on the chart?​

A: You cannot add a custom hide/minimize button, but indicators can be hidden via the chart legend eye icon, the studies right-click menu (hideStudyButton), or the chart layers panel. Toggle visibility per study line from the legend when an indicator has multiple plots.


Q86: We are conducting tests on the implementation of the DXCharts library. We have made progress in some areas, but we noticed some issues after integrating the SymbolSuggestProvider with our data provider. SymbolSuggestProvider:​

We have created an internal list of symbols according to those available in our data provider. However, after passing the list, we noticed that some functionalities and graph visualizations stopped working. As per the screenshot below, we cannot visualize the auto-scale price axis; prices do not appear on the Y-axis, and some drawings after marking on the graph also do not appear.

A: This usually means priceIncrements was not set on instruments returned by symbolSuggestProvider. Without price precision, the Y-axis, auto-scale, and drawings can fail to render correctly. Set priceIncrements on each instrument in your symbol list.

reference — Price precision, Symbol suggest provider


Q87: Indicators: Regarding the indicators, selecting one does not generate the graph. It is unclear whether we need to pass specific data or perform some calculations. Nevertheless, we have successfully integrated our endpoint, which is the data provider, and made the requestHistoryData function work.​

chunk-XCJ4UMHA.js?v=62e2c2b9:9269 Uncaught Error: Something went wrong =/ at ExtendedContext.intersectLineVertically (chunk-XCJ4UMHA.js?v=62e2c2b9:9269:15) at polygonPoints (chunk-2TKESNEC.js?v=62e2c2b9:11408:43) at TrendChannel.draw (chunk-2TKESNEC.js?v=62e2c2b9:11444:21) at drawShape (chunk-2TKESNEC.js?v=62e2c2b9:9482:63) at DrawingsDrawer.drawDrawing (chunk-2TKESNEC.js?v=62e2c2b9:9465:5) at DrawingsDrawer.draw (chunk-2TKESNEC.js?v=62e2c2b9:9458:147) at @dx-private_dxchart5…v=62e2c2b9:39298:16 at Array.forEach (<anonymous>) at DynamicObjectsDrawer.draw (@dx-private_dxchart5…v=62e2c2b9:39295:29) at @dx-private_dxchart5…v=62e2c2b9:36872:18 Upon reviewing the documentation, we identified potential issues with Vite related to the use of Webworkers. In response to this, I opted to set up a new environment using create-react-app + TypeScript, which utilizes Webpack as its default bundler. During the project execution, I noticed some warning messages indicating failures in the file paths that supposedly represent the indicator names. Although I examined the ZIP file containing the DxCharts libraries that were sent to us, I couldn't locate these specific files. Would it be possible to check with your team if it makes sense for us to have access to these files to ensure thecorrect functioning of the indicators? Are we on the right track?

A: These are separate issues. The Create React App path warnings about indicator file names are a known harmless CRA issue — no files are missing; mute the warnings. The TrendChannel.draw stack trace is a drawing render error (often related to missing priceIncrements or invalid chart data), not missing indicator files. Built-in indicators are provided by the @dx-private/dxstudies package included in the ZIP — you do not pass indicator calculation data via chartDataProvider; only OHLCV candles are required. Ensure dxstudies is installed and requestHistoryData returns enough history for the selected study.

reference — Getting started with ZIP, Price precision, Chart Data Provider


Q88: Is there any functionality in this version to divide one asset by another?​

A: No. There is no built-in price-ratio chart (dividing one instrument by another). Compare charts overlay multiple instruments on a percentage-performance axis, which is not the same as a price division.

reference — Compare charts


Q89: Does the interface support language change to Portuguese/pt-br?​

A: Yes. Pass a custom localization object with Portuguese strings to ChartReactApp. There is no pre-built pt-BR locale file — you provide the translations yourself.

reference — Localization


Q90: the user conducted their technical analysis on the graph and wants to continue monitoring their markings in the following days. How can we proceed with this approach?​

A: Persist drawings and chart state via LayoutProvider — layout snapshots include drawings per instrument. Implement a LayoutProvider backed by localStorage (example in docs) or your database so markings reload when the user returns. Use UserDataProvider for additional user preferences (favorite drawings, toolbar positions, etc.).

reference — Layout Provider, User Data Provider, Working with drawings — external storage


A: There is no DXcharts documentation for @dxfeed/dxlink-websocket-client — it is a dxFeed-only demo reference. If you use dxFeed market data, connect via dxLink and createDxLinkAdapter() (see dxFeed Integration). If you have your own exchange feed, implement ChartDataProvider yourself: return historical bars from requestHistoryData, push live last-candle updates via subscribeCandles, and optionally stream quote fields via subscribeServiceData. Your WebSocket endpoint sits behind the provider; DXcharts does not connect to it directly.

reference — dxFeed Integration — dxLink, Chart Data Provider, Chart Data Provider — Data flow, Providers setup


Q92: API to obtain the list of strings, but was unsuccessful. I am unsure if this functionality is available in the version I am using.​

Error: window.__CHART_REACT_API.internal.getLocalizationJSON(); VM17160:1 Uncaught TypeError: Cannot read properties of undefined (reading 'internal') at <anonymous>:1:26 header: 'Desenhos', buttons: { magnetMode: 'Modo Ímã', drawingMode: 'Modo de Desenho', syncDrawings: 'Sincronizar desenhos', hideDrawings: 'Ocultar todos os desenhos', showDrawings: 'Mostrar todos os desenhos', deleteDrawings: 'Excluir todos os desenhos', }, },

A: getLocalizationJSON() is not a supported API — the user tried __CHART_REACT_API.internal.getLocalizationJSON(), which does not exist. Use api.getLocalization() via onAPICreated to read the current strings, or import DEFAULT_LOCALIZATION and pass a custom localization object to ChartReactApp (spread defaults and override sections such as drawings, toolbar, legend). Use api.updateLocalization() for runtime partial updates.

reference — Localization — Default localization strings, Localization — Reading and updating localization at runtime, API reference


Q93: How to translate drawings legend and other chart core elements​

A: Most chart UI strings are translatable via the localization dependency — including the OHLC legend (localization.legend), drawings toolbar and settings (localization.drawings), toolbar, studies menu, and settings popup. On-canvas numeric/date labels (drawing measurements, axis ticks) are formatted values, not locale keys; customize them with xAxisLabelFormat / customFormatter in chart config where needed.

reference — Localization — Common localization sections, X-axis — Custom label formatting


Q94: How to translate X-axis​

A: Use customFormatter or conditional xAxisLabelFormat entries in chart config — the formatter can return date strings in any language for the selected aggregation period.

reference — X-axis — Custom label formatting


Q95: Visual Style Adjustments: We would like to ensure that the visual styles of the chart interface are consistent with the rest of our platform. Could you guide us on how we can make these customizations in the library?​

A: Depends on what you want to change. Common approaches: palette tokens and CSS for colors/themes, chartReactConfig for layout and feature toggles, component overriding for React UI pieces, and custom drawers for canvas-level rendering.

reference — Ways to customize, Palette, Styling, Component overriding, Custom drawer


Q96: Candle Visualization for Larger Periods: We noticed that when switching to larger aggregation periods, the candles appear large on the screen. Is there any configuration that allows the candles to automatically adjust according to the screen resolution to maintain a standardized view?​

A: Yes — use viewportStrategy. With timeframe, the chart keeps the same visible time range, so switching to a larger period shows fewer, wider candles. Set aggregations: 'candles' to keep a fixed number of visible candles instead (the default in DXcharts React). Configure via chartReactConfig.viewportStrategy or api.setAggregationViewportStrategy('candles'). This controls candle density vs time range — not screen resolution.

reference — Scaling — Candles viewport


Q97: Is there a way to change price label colours?​

A: Yes. Override palette tokens via dependencies.palette on ChartReactApp. For Y-axis price labels, try chart-label-text and chart-label-text-inverted:

<ChartReactApp dependencies={{
palette: {
dark: { object: { 'chart-label-text': '#FFFFFF', 'chart-label-text-inverted': '#000000' } },
light: { object: { 'chart-label-text': '#000000', 'chart-label-text-inverted': '#FFFFFF' } },
}
}} />

reference — Y-Axis Price Labels — Label colors, Palette


Q98: I am facing an issue with the candle data generated by the WebSocket and would like to request your assistance. Historical data is being processed correctly, with dates and time zones adjusted by the interface as expected. However, the candle data received via WebSocket is not reflecting the time zone change by the interface.​

A: All candle timestamps sent to the chart must be UTC. The chart applies the selected timezone offset only for intraday periods (less than one day). For daily-or-larger aggregations, timestamps stay UTC because day boundaries do not need an offset. Ensure live candles from your WebSocket use the same UTC format as historical data.

reference — Timezones — Timezones and candles timestamps


Q99: It seems that the examples in the documentation assume that the install has been done via npm (as they use import...from..., etc.). Do you have documentation on how to use the library for vanilla usage where we're just using the two files from the zip and then creating the chart using DXChart.createWidget()? For a start, I note that if I write var widget = await DXChart.createWidget(document.getElementById('chart'), {}), I don’t get a reference to the chart; how can we get a reference to the chart in vanilla JS? And how, in general, can the examples be modified for use with vanilla JS?​

A: Use DXChart.createWidget() from @dx-private/dxchart5-react-widget. You do not get a chart instance from the return value — pass onAPICreated in the widget config, then use api.onChartCreated((chartId, chart) => …) to access the chart-core instance. Full config options are in widget.config.d.ts in the ZIP. Providers and configuration work the same as in the React/npm setup.

reference — Using DXcharts with Vanilla — Providers and configuration, Using the API, DXcharts widget overview


Q100: Aside from the “How to use dxchart5-react with vanilla apps” page, I can’t see any other documentation on how to get started (with Configuration, Providers, etc.). The HTML file creates the chart successfully, but how can we get a reference to the API? There is only a react based app example.​

Regarding the command: DXChart.createWidget(document.getElementById('chart-iframe'), { width: '800px', height: '576px', } ); …is there any documentation for this object parameter? Width and height are documented and working, but I don’t know what else we can specify there or how (in the context of a vanilla app).

A: The second argument to createWidget is ChartReactWidgetProps — see widget.config.d.ts in the ZIP for all options (providers, chartReactConfig, localization, onAPICreated, symbol, chart type, etc.). For providers and configuration guides, follow the same React library docs; wire values into the widget config object. Use onAPICreated to get the chart React API.

reference — Using DXcharts with Vanilla — Providers and configuration, Setting up the widget, Getting started with providers, Getting started with configuration, API reference


Q101: Do you please have examples for how to provide Config and Providers in a vanilla app? (Please note again that we don’t use modules, TypeScript, Node, npm, etc.).​

It seems that the examples in the documentation assume that the install has been done via npm (as they use import...from..., etc.). Do you have documentation on how to use the library for vanilla usage where we're just using the two files from the zip and then creating the chart using DXChart.createWidget()? For a start, I note that if I write var widget = await DXChart.createWidget(document.getElementById('chart'), {}), I don’t get a reference to the chart; how can we get a reference to the chart in vanilla JS? And how, in general, can the examples be modified for use with vanilla JS?

A: Same as the npm setup — pass providers and config on the createWidget props object. Use dependencies for chartDataProvider, layoutProvider, chartReactConfig, initialChartConfig, and other providers; see widget.config.d.ts in the ZIP for the full ChartReactWidgetProps shape. createWidget returns only a destroy handle — use onAPICreated and api.onChartCreated((chartId, chart) => …) to access the chart-core instance. React/npm examples map directly: replace ChartReactApp props with the widget config object.

reference — Using DXcharts with Vanilla — Providers and configuration, Getting started with providers, Getting started with configuration, DXcharts widget overview


Q102: The requestHistoryData function does not seem to be providing the expected parameters - As per the DX team's explanation, the requestHistoryData method is invoked with either fromTime or toTime when the user scrolls to the right side of the chart. However, there appears to be a discrepancy in the symbols passed during the initial call to requestHistoryData and subsequent calls. Please refer to the attached video for clarification. While the symbol passed during the initial call seems correct, the symbols passed in subsequent calls are incorrect.​

A: fromTime and toTime reflect the chart viewport state — they are hints, not strict API query bounds. You can return as much history as you need. On initial load both are often undefined or 0. Later loads may pass fromTime (leftmost loaded candle, or timeframe presets). Lazy loading when scrolling left into older history passes only toTime (timestamp of the oldest loaded candle). The symbol argument is the instrument for that specific request — in multichart or compare mode, subsequent calls may use compare/secondary symbols, not only the main chart symbol. Use the optional chartId parameter to correlate requests per chart.

reference — Chart Data Provider — fromTime, Chart Data Provider — toTime, Chart Data Provider — symbol and chartId


A: Set chartReactConfig.watermark.mode: 'custom' (default is 'instrument', which always shows instrument data and overwrites manual changes). Store chart instances from onChartCreated, then call chart.watermark.setWaterMarkData({ firstRow, secondRow, thirdRow }) — use api.onInstrumentChanged to re-apply your display name when the symbol changes.

reference — Watermark — Custom display name, Watermark component API


Q104: How do we determine classes for styled components? DXChart will investigate whether exploration of components can be enhanced.​

A: DXcharts React uses styled-components internally. Override styles by wrapping ChartReactApp in a styled parent and targeting nested components via styled-component selectors — there are no stable public CSS class names to rely on. For simpler changes, prefer palette, CSS override, or config before deep styled-component overrides.

reference — Styling, UI overrides


Q105: Warning upon loading in the React app.​

A: Don't pay attention to this warning. It doesn't affect anything. We will try to get rid of it.


Q106: How do we enable crosshair and format labels on the x-axis? What configuration is required? (Meaning that they should be turned on by default when DXcharts is loaded first time​

A: Crosshair is enabled by default (cross-and-labels). To set it explicitly on first load, pass initialChartConfig.components.crossTool.type: 'cross-and-labels' in ChartReactApp dependencies (or dependencies.initialChartConfig in the widget). Format X-axis crosshair labels via crossTool.xAxisLabelFormat in the same config — use format strings or customFormatter. Change at runtime on the chart-core instance: chart.crossTool.setVisible(true) and label format via chart.config.

reference — Crosshair, CrossTool, X-Axis label format


Q107: Are “dxcharts-react” and “dxcharts-react-widget” two separate products?​

The “Quick Start – Vanilla” instructions are under dxcharts-react but seem to pertain to dxcharts-react-widget; I note (from looking at the code) it seems that the items in “Quick Start – Configuration” (e.g. ChartAppInitials and its properties, ChartReactAppConfig and its properties) are not the same as / not available in the properties made available through standalong-config.d.ts. If they are the same, how can we provide the dependencies (initials, configs, providers – as per the documentation) to the standalone chart?

A: Same product, two distributions: @dx-private/dxchart5-react (npm/React) and @dx-private/dxchart5-react-widget (script/ZIP). The widget wraps ChartReactApp — providers and config go in createWidget's dependencies object (chartDataProvider, chartReactConfig, initialChartConfig, etc.), not as top-level React props. Top-level widget props cover display toggles (width, symbol, chartType, feature flags); see widget.config.d.ts. React-only customization (uiOverrides, full component replacement) is also available on the widget via the uiOverrides prop.

reference — Using DXcharts with Vanilla, DXcharts widget overview, Getting started with configuration


Q108: How do we display a different name on the chart instead of the symbol we pass to the chart?​

A: Same as Q103 — set chartReactConfig.watermark.mode: 'custom', then chart.watermark.setWaterMarkData({ firstRow, secondRow, thirdRow }) via onInstrumentChanged (and store chart instances from onChartCreated).

reference — Watermark — Custom display name


Q109: Can we completely replace the Drawings Sidebar? We want to add our own custom UI elements to this DOM element and add custom menu options​

A: Yes — override uiOverrides.DrawingsSidebar (DrawingsSidebarComponent, DrawingsSidebarHeader, DrawingsSidebarFooter). Your component receives chartReactAPIProps and originalProps. For smaller changes (hide tools, reorder), use drawingsList in chart config instead of a full sidebar rewrite.

reference — Overriding the Sidebar component, UI overrides


A: Yes — override uiOverrides.Footer: replace the whole footer via FooterComponent, or swap individual pieces (TimeframePresetsComponent, TimeZoneComponent, SwitchAxisButtonsProps, etc.). Your component receives chartReactAPIProps and originalProps (including default children).

reference — Overriding the Footer component, UI overrides


Q111: Is it possible to implement our own UI for the Indicators/Studies menu? We want to use our own UI elements for adding/removing indicators and the parameter UI controls. It might be possible to implement a custom UI menu in the toolbar but it looks like the function addStudy is a private internal function​

A: The built-in studies settings popup is not replaceable as a whole, but you can build your own UI around the public chart API. Hide the default indicators button (chartReactConfig.toolbar.buttons.studies.enabled: false), add a custom toolbar button, then drive studies programmatically: api.setStudies() / api.setStudiesByIds() for built-in studies, api.addCustomStudy() / api.removeCustomStudy() for JavaScript custom studies. Custom study parameters are defined in metainfo.parameters and shown in the default properties dialog unless you manage values entirely from your UI.

reference — Studies — Custom studies UI, Toolbar buttons, Custom Studies overview, API reference


Q112: How can we change the animation of drawing the live candle updating? If we want to tweak the animation of how a candle is drawn when changing.​

A: There is no API to customize live-candle animation timing or easing. You can only disable scale/viewport animations via initialChartConfig.scale.disableAnimations: true (affects how the chart pans when the last candle updates, not the candle body draw itself). Fine-grained animation control would require source changes.

reference — Scaling — Scroll limits


Q113: Is it possible to disable short selling in the Trading UI? Can we override the UI of the Trading Labels to use our own elements on the chart?​

A: There is no config flag to disable short selling only. Override trading components via uiOverrides.trading (OrderEntry, RegularOrder, Position, etc.) and omit or disable sell actions in your UI, or set chartReactConfig.trading.enabled: false.

reference — Trading, Overriding the Order component, UI overrides


Q114: Is it possible to implement our own Drawings Settings Menu to add our own UI for parameters and remove parameters?​

A: Two different UIs — don't confuse them with the sidebar (Q109). Drawings sidebar (tool list on the side): yes, replace via uiOverrides.DrawingsSidebar — same as Q109. Drawing settings menu (toolbar/popup that appears when a drawing is selected — color, line style, fib levels, measure-box toggles, etc.): not replaceable via uiOverrides; those are hardcoded per drawing type in drawing-settings-toolbar / drawing-settings-popups. For parameter UI you can limit tools via drawingsList, override the drawings right-click menu, or build controls outside the chart.

reference — Overriding the Sidebar component, Configuring drawings, Right-click menu elements


Q115: How can we override the style of the Y-Axis Labels? I only see rectangle/badge/plain as the options, is there further customization here? E.g. if we want to change the shape or font type/size​

A: labelType supports badge, rectangle, and plain only — no custom shapes. Tune appearance via initialChartConfig.components.yAxis (fontSize, fontFamily, typeConfig for badge/rectangle padding and rounding) and per-label colors in chartCoreConfig.colors.labels or palette tokens. Runtime: chart.yAxis.changeLabelMode() and custom Y-axis label providers for advanced cases.

reference — Y-Axis Price Labels — Label appearance, Y-Axis Price Labels — Label colors


Q116: Can we implement our own Positions UI elements to display on the Chart?​

A: Override the built-in position component via uiOverrides.trading.Position (or PositionAlt), or disable built-in trading (chartReactConfig.trading.enabled: false) and render your own UI using PositionProvider

reference — Trading — Custom trading UI, Overriding the Order component


Q117: A positive displace value for an indicator should push the indicator forward, but it's the opposite. Is it possible to modify how displace works in the indicators? Can you set a maximum and minimum on an indicator for the Y-Scale? For example, the RSI overbought and oversold levels have no upper or lower limit and negative values are possible.​

What’s the easiest way to include our own custom indicators/studies?

A: Built-in study math (displace direction, RSI Y-scale bounds, overbought/oversold limits) comes from @dx-private/dxstudies and is not configurable via chart API. Easiest path for custom indicators: register JavaScript custom studies with api.addCustomStudy() — you control calculation, parameters, outputs, and pane scaling. To change built-in RSI/displace behavior, modify or extend the dxstudies package.

reference — Custom Studies overview, Custom Studies quick reference, Studies


Q118: Is it possible to prevent a user from scrolling past the left or right side of the chart? Sometimes a user can scroll past where the first candle is drawn and we want to prevent that.​

A: By default components.chart.minCandlesOffset (default 2) constrains panning so empty space beyond the first/last candles is limited. Increase it for stricter edges, or add custom rules with chart.scale.addXConstraint() in onChartCreated (the chart already uses candleEdgesConstrait internally when minCandlesOffset > 0).

reference — Scaling — Scroll limits


Q119: Is it possible to modify the content inside the measure box/label box of a drawing? (Example: “-0.31 (-0.80%)”) We want to change this format and content. When we change the color of a drawing, the label on the X and Y axis does not change. How can we update the colors of the Y-Axis and X-Axis Label to be the same color​

A: Measure-box numeric format (e.g. -0.31 (-0.80%)) is not customizable via API — only visibility toggles in drawing settings. Drawing X/Y axis projection labels use fixed theme palette tokens (drawing-label-x-text, drawing-label-y-bg, etc.), not the active drawing line color. Override those palette keys in dependencies.palette to align axis label colors with your design.

reference — Configuring drawings — Measure box and axis labels, Palette


Q120: Is it possible for us to make the vertical crosshair snap to the middle of the candle when it moves?​

A: Yes — enable discrete: true on components.crossTool in initialChartConfig. This snaps the crosshair X coordinate to the center of the nearest candle (enabled by default). Set magnetTarget ('O' | 'H' | 'L' | 'C' | 'OHLC') to snap the Y coordinate to OHLC values.

reference — CrossTool — Discrete mode, Crosshair


A: Yes — custom canvas overlays are supported and recommended for chart-integrated visuals. Register a custom Drawer on the chart's DrawingManager via addDrawer(drawer, name). Access the chart instance from api.onChartCreated (React) or ChartBootstrap (lite). Use chart.bus.fireDraw([canvasId]) to redraw after updates, and chart.toXFromTimestamp() / ChartModel#toX / ChartModel#toY to bind elements to price/time.

reference — Custom drawer


Q122: I have integrated trading sessions providers as suggested. generateSessions method did not get called for me. please suggest.​

A: this is handled via tradingSessionsProvider. Please check if you implemented everything according to the documentation

const tradingSessionsProvider = (() => {

console.log('Creating custom provider');

const defaultProvider = createDefaultTradingSessionsProvider();

return {

...defaultProvider,

generateSessions: (...args) => {

console.log('GENERATE SESSIONS REQUEST');

return defaultProvider.generateSessions(...args);

},

};

})()

<ChartReactApp dependencies={{ tradingSessionsProvider }}/>

reference — Trading Sessions Provider, Providers setup


Q123: Objective: Trigger drawing through functions provided by dxcharts api. Current Status: We have done the poc on triggering drawing functions through the method mentioned (attachDrawingsComponent) in the documentation.​

we are not able to enable the drawing settings toolbar which comes up automatically everytime we select a drawing tool from the sidebar. For this we have also enabled the toolbar boolean from the drawing chartReactConfig.Э

A:

Please, be careful. You looked at the documentation of dxcharts-lite regarding this attachDrawingsComponent.

dxcharts-lite by default doesn't include modules like drawings, studies etc, that's why you can use attachDrawingsComponent to wire it up as a module.

BUT

dxcharts-lite is a part of dxchart5-react. And all the modules like drawings, studies are wired up by default in dxcharts5-react. This means you don't need to wire them up manually.

To draw drawings programmatically, you need to call some methods on drawings module.

To get instance of dxcharts-lite with drawings module attached from chart-react do the following:

const onApiCreated = (chartReactAPI) => {
// for 1st chart `chartId = '0'` and `chartInstance` is the instance of `dxcharts-lite` with `drawings`
chartReactAPI.onChartCreated((chartId, chartInstance) => {
// here's the logic to start drawing
const drawingType = 'arrow'
const configCopy = cloneUnsafe(DEFAULT_DRAWINGS_CONFIG[drawingType])
chartInstance.drawings.startDrawing(configCopy)
// if you want to add a complete drawing
const configCopyWithAllPoints = ...your code;
chartInstance.drawings.setDrawing('AAPL', configCopyWithAllPoints)
// if you want to add a pack of drawings
const drawingsMap = {
'AAPL': [configCopyWithAllPoints, configCopyWithAllPoints, configCopyWithAllPoints]
}
chartInstance.drawings.setDrawings(drawingsMap)
})
}

<ChartReactApp onApiCreated={onAPICreated} />

reference — Configuring drawings, Drawings in DXcharts React, Drawings module (lite)


Q124: Coding tools: Typecript5, FP-TS, React18, StyledComponents5, RxJS7​

Building tools: Webpack5, Prettier/EsLint, Testings tools: Jest, Playwright As part of the source code acquisition, is there any tooling available for monitoring or debugging? We found this page available, but we want to make sure it is something we would be receiving, https://devexperts.com/case-studies/how-we-delivered-the-dxcharts-source-cod

A: Full source-code deliveries include in-repo debugging helpers; npm/trial ZIP packages do not. callTracer (dev/non-production builds) records view-model action sequences — access via window.__CHART_DEBUG.callTracer.report(). Dev builds also expose window.__CHART_REACT_API, window.__CHART_INSTANCE_<chartId>, window.__CHART_VIEW_MODELS_<chartId>, and window.__CHART_MULTICHART_VM in the browser console. Set sessionStorage.setItem('FORCED_DEBUG', '1') to expose globals in production-like builds. Monitoring infrastructure described in the Devexperts case-study article (external APM/log pipelines) is not part of the library — only callTracer and console globals ship in source.

no link — debugging tooling lives in the source-code repo (callTracer, chart-window-global.ts), not in public library docs


Q125: What testing suites would we receive with the purchase​

A: Full source-code deliveries include three suites: e2e-test (Playwright browser tests), unit tests (*.spec.ts alongside chart-react, chart-core, dx-feed-data-provider, etc., run with Jest), and perf-test (FPS/CPU performance harness). These are not included in npm/trial ZIP library packages.

no link — test suites are part of the source-code delivery (e2e-test/, perf-test/, embedded *.spec.ts), not documented separately


Q126: What framework/dependencies/build process are used in the kotlin library?​

A: Built-in indicators live in @dx-private/dxstudies — a Kotlin Multiplatform library (Kotlin source under src/commonMain/kotlin/…), built with Gradle and compiled to JavaScript for the browser. Integrators consume the prebuilt npm package — no Gradle/Kotlin toolchain required at runtime. With full source code, you can extend dxstudies in Kotlin or rebuild the JS artifacts.

no link — dxstudies Kotlin/Gradle build is part of the source-code delivery, not public integration docs


Q127: What is causing the library to violate these Content-Security-Policies enforced by Electron apps? We had to turn this policy off temporarily to make the library work (screenshot attached)​

A: Strict Electron CSP can block the chart for two reasons. new Function() is still used, but only for custom JavaScript studies — deserializing persisted study code (mapDTOToCustomStudy) and compiling calculation strings (compileCustomStudyFunction in custom-js-studies.model.ts, custom-studies-calculations.utils.ts). Core chart code, built-in dxstudies indicators, and time-axis formatters do not use new Function(). If you use no custom JS studies, this path may never run. DXScript compiles in the separate dx-script-platform-provider package (may also require unsafe-eval). Timezone parsing can spawn blob Workers — add worker-src blob: if needed.

reference — Quick start (React) — Electron / CSP


Q128: if we want to write our custom InstrumentSuggestComponent, how do we get the data (instruments) from SymbolSuggestProvider? Seems like this data is available in MainInstrumentSelectorContainer, but we cannot override the container, just InstrumentSuggestComponent​

A: uiOverrides.InstrumentSuggest replaces only the suggest UI. Override props are onInstrumentChanged and instrument (current symbol) — search results from SymbolSuggestProvider are not passed through. In your custom component, call the same SymbolSuggestProvider instance you pass in dependencies.symbolSuggestProvider (searchInstruments, findInstrument). On selection, call onInstrumentChanged with the chosen instrument so the chart updates.

reference — Symbol Suggest Provider — Custom InstrumentSuggest override, UI overrides


Q129: We have our proprietary programming language that allows users to create their own indicators. Do DX charts allow users to create their own indicators?​

A: Yes. JavaScript custom studies via api.addCustomStudy() work in all builds — you define calculation logic, parameters, and outputs client-side. DXScript (Devexperts scripting language) requires @dx-private/dxchart-dx-script-platform-provider, real DxScriptProvider/DxScriptRunner dependencies, and chartReactConfig.dxScriptEnabled: true — trial/npm packages ship mocks only. With source code, you can also extend the Kotlin dxstudies library or wire your own language through a custom calculation path.

reference — Custom studies, DXScript integration


Q130: We have approximately 10 more studies that the DX charts. What is the process for requesting new studies? Also can DXScript allows us to build all our own indicators?​

A: Four paths: (1) addCustomStudy() — JavaScript indicators without dxstudies changes; (2) DXScript — user-defined script indicators when the DXScript platform provider is integrated; (3) dxstudies (Kotlin) — add built-in studies in source code; (4) sponsored feature — Devexperts implements and ships the study. DXScript/custom JS can cover most proprietary indicators, but replicating every built-in dxstudies indicator in script may require significant effort.

reference — Custom studies, Studies, DXScript integration


Q131: If there are additional drawing tools we would like added, what is the process for requesting new drawing tools?​

A: Two paths: implement a custom drawing in source code (DrawingsComponent + figure/drawer), or request it as a sponsored feature for Devexperts to add to the core drawings module. Existing built-in tools are configured via drawingsList — adding new core tool types requires code changes.

reference — Creating a custom drawing, Configuring drawings


Q132: We allow to trade in the pre and post market. For example, from 8 am eastern to 9:30 eastern. How does a user turn the pre/post market bars on and off?​

A: Toggle Extended hours in Settings → Market (or the chart background right-click menu → Data). Works only for intraday aggregations (period < 1 day); disabled for daily and larger periods. Your chartDataProvider must return pre/post-market candles when requestHistoryData / subscribeCandles is called with extendedHours: true. Optional: TradingSessionsProvider highlights session types on the chart.

reference — Extended hours, Chart Data Provider


Q133: Do you have a mobile SDK or do we just use the same charting package? Is there another version that’s more properly formatted for a mobile screen?​

A: The web/React package is responsive and used in mobile browsers, but native iOS and Android chart SDKs are separate products (not the same npm package). Contact sales@devexperts.com for native mobile licensing.

no link — native mobile SDKs are separate commercial products, not covered in DXcharts React docs


A: Trading UIs are customizable. Override uiOverrides.Legend.Header to extend the legend (top-left quote/trade area where order-entry quantity lives). Override uiOverrides.trading (OrderEntry, Position, RegularOrder, etc.) for trading panels and chart overlays. There is no single config flag for arbitrary regulatory fields — build them in your override components using your quote data.

reference — UI overrides, Trading — Custom trading UI


Q135: Does the library have limitations on the amount of datasets streaming on the chart.​

A: No hard-coded limit on live candle streams — the chart subscribes to the main instrument plus all compare symbols on that pane (subscribeLastCandleUpdates per symbol). Default maxCandlesCount is Number.MAX_SAFE_INTEGER. Practical limits are browser memory and your provider's throughput, not a DXcharts cap.

reference — Chart Data Provider


Q136: How many different symbols can be loaded on the chart?​

A: Depends on layout. Per chart pane: one main symbol plus any number of compare symbols on the same pane (addCompareInstrument / setCompareInstruments — no hard-coded compare limit). Multichart: up to 8 main symbols (one per pane in the 2x4 layout). Layouts: 1x1 … 2x4 (multichart.model.ts).

reference — Multichart, Compare charts


Q137: How many studies can be added to a chart?​

A: No hard-coded API limit on studies per chart. Practical limits are browser/CPU performance (many studies on one pane can be heavier than several empty multichart panes). Add built-in studies via the UI or api.setStudies() / setStudiesByIds(); add JavaScript custom studies via api.addCustomStudy().

reference — Studies, Custom studies


Q138: Ability to plot one or more symbols on the same chart​

A: Supported via compare charts — overlay additional symbols as line/area series on a shared percent Y-axis (api.addCompareInstrument(), api.setCompareInstruments(), or include compare instruments in LayoutProvider). This is separate from multiple scales (extra Y-axes / pane placement for studies).

reference — Compare charts, Multiple scales


Q139: Ability to create custom symbols to display on the charts ( Example (AAPL + GOOG)/2 )​

A: No built-in synthetic / formula symbol type. Compute blended values on your backend, expose the result as a regular instrument symbol with OHLCV from chartDataProvider, and chart it like any other symbol. Alternatively, plot constituents separately with compare charts.

reference — Chart Data Provider, Compare charts


Q140: Ability to display options price data on charts​

A: Not supported now. Any instrument (including an option contract) works if your chartDataProvider / symbolSuggestProvider supply standard OHLCV candles and metadata (priceIncrements, tradingHours, etc.) like a stock or forex symbol.

reference — Chart Data Provider, Symbol Suggest Provider


Q141: Ability to send a chart & it's configuration to a new user, the new user will own the copy and be able to make changes​

A: Use LayoutProvider — createLayout() / updateLayout() persist full chart state (instruments, studies, drawings, appearance per layout). Share a layout ID or serialized layout via your backend; the recipient loads it through getLayouts() / updateSelectedLayout(). chartSharingProvider uploads image snapshots only, not editable configuration.

reference — Layout Provider


Q142: Ability to send a read-only version of a chart to a 3rd party user that when the owner makes changes it's reflected in the 3rd party view of the chart.​

A: No built-in live read-only mirror. Implement in your host app: persist layout state server-side, push updates over WebSocket/SSE to viewers, and call layoutProvider.updateLayoutData() / chart API on subscribers. Snapshot sharing (chartSharingProvider) is static images only.

no link — live collaborative viewing is a host-application pattern, not a chart library feature


Q143: Ability to export and import chart settings. share chart settings with other users. sharing URL​

A: Export/import: LayoutProvider (getLayouts, updateLayout, updateLayoutData) stores the full layout snapshot to your DB or localStorage. Share with users: assign layout IDs per user/account in your backend; recipient selects or is assigned that layout on login. URL sharing: encode a layout ID or token in your app URL and load the matching layout in getLayouts() — the chart has no built-in URL serializer for full state (Widget query params cover only a few init flags).

reference — Layout Provider


Q144: Ability to import chart settings, studies, objects, etc​

A: LayoutProvider — chart settings, studies instances, drawings, multichart state, compare instruments (per layout snapshot). UserDataProvider — favorites, UI preferences, drawing toolbar positions, etc. CustomStudiesProvider — persist/share custom study definitions (not just instances). Wire import/export buttons via uiOverrides or your app shell calling provider APIs.

reference — Layout Provider, User Data Provider, Custom Studies Provider


Q145: Are custom indicators supported client side or cloud based? build and run client side. ability to sync requires server side​

A: JavaScript custom studies (api.addCustomStudy()) — calculated client-side in the browser; persist/sync definitions via CustomStudiesProvider (your server/DB). DXScript — execution runs through DxScriptRunner; trial builds use mocks/demo infrastructure, production requires your own dx-script-platform-provider backend instance. Built-in dxstudies indicators run client-side via the compiled Kotlin/JS bundle. Sync across users/devices always needs your persistence layer — not built into the chart alone.

reference — Custom studies, Custom Studies Provider, DXScript integration


Q146: Ability to view your custom studies on any chart instance?​

A: Yes. Register a study with api.addCustomStudy() or load definitions through CustomStudiesProvider — on chart init the provider calls getAllStudies() and registers each study globally via dxStudiesProvider.registerStudy(). Once registered, the study appears in the indicators picker on any chart pane or multichart instance. Adding a study to one pane does not automatically apply it to others unless multichart studies sync is enabled.

reference — Custom studies, Custom Studies Provider — Loading studies


Q147: Ability to create studies that create/control drawing objects on the chart​

A: Partially. Custom studies render indicator output plots (lines, histograms, markers, candle coloring) defined in metainfo.lines — they do not create or control user drawing tools (trend lines, Fibonacci, shapes, etc.). Use the drawings API separately if you need interactive shapes on the chart.

reference — Custom studies — Output lines (plots)


Q148: Ability to write studies using different programming languages and import into DX charts? natural language?​

A: Supported paths: JavaScript custom studies (addCustomStudy()), DXScript (with the DXScript platform provider integrated), and Kotlin dxstudies (source-code builds). There is no natural-language indicator authoring — you implement calculation logic in one of those languages. Import user-defined studies via CustomStudiesProvider (serialized JS) or DXScript runner integration.

reference — Custom studies, DXScript integration, Custom Studies Provider


Q149: Ability to create/set/manage alerts with your custom studies & have them running while platform is offline​

A: Not in the current release. As of June 2026, study and indicator alerts (including custom studies) are planned for the next minor version — UI to create, set, and manage alerts from the chart. Offline alerting (notifications while the platform is closed) will still depend on your backend or notification service; the chart evaluates conditions when the client is connected. Until that release ships, implement alerting in your host application if you need it today.

no link — planned for next minor version; not yet in library or docs


Q150: What is the process for requesting new indicators?​

A: Same options as adding missing built-in studies: (1) addCustomStudy() — JavaScript indicators without dxstudies changes; (2) DXScript when the platform provider is integrated; (3) dxstudies (Kotlin) in source-code builds; (4) sponsored feature — Devexperts implements and ships the study (contact sales@devexperts.com or your sales manager). DXScript/JS can cover most proprietary indicators; replicating every built-in dxstudies study in script may require significant effort.

reference — Custom studies, Studies, DXScript integration


Q151: Can we have indicators renamed to other names?​

A: Yes. Built-in studies: override display names in localization.studies (e.g. macd.title) and pass the same dictionary to DEFAULT_STUDIES_LIST(yourStudiesDictionary) when wiring dxStudiesProvider — no source-code changes required. Custom studies: set metainfo.title / shortTitle when registering.

reference — Localization — Renaming built-in indicators, Custom studies — Study configuration


Q152: If studies are created for TS, do all DX chart clients get the them?​

A: No — not automatically. Studies you add via CustomStudiesProvider or addCustomStudy() are distributed only to chart instances that load them (your backend, localStorage, or in-memory registration). DXcharts does not push custom studies to other clients. Kotlin dxstudies changes shipped as a sponsored feature depend on your contract (npm package update vs. source delivery).

reference — Custom Studies Provider


Q153: Can we set alerts on drawing tools? Are they available if the platform is offline? This is for price/volume alerts​

A: No. DXcharts has no built-in drawing or price/volume alerts, and nothing runs while the platform is offline. Implement alerts in your host application if needed.

no link — no alert feature in the chart library; host-app responsibility


Q154: Activation Rules - can trades be generated based upon indicator triggers?​

A: No — not out of the box. The chart can display orders and positions via OrderProvider / PositionProvider, but rule-based or indicator-triggered trade generation is handled by your trading platform/backend, not by DXcharts.

no link — indicator-triggered trading is a host-platform concern


Q155: Ability to display open orders on chart​

A: Yes. Implement OrderProvider.observeOrders() and push the current list of open orders for the active symbol — the chart renders them as draggable order lines (market, limit, stop, and protection orders). Use createOrder / updateOrder / deleteOrder for user interactions from the chart UI.

reference — Trading, Order Provider


Q156: Ability to display filled orders on chart​

A: Yes, via OrderProvider.observeExecutedOrders()

reference — Order Provider — Order Execution


Q157: Ability to create new single orders and TP/SL, prefably with estimated profit and loss shading visualization​

A: TP/SL are in place. Profit/loss zones are shown by the Risk Reward drawing, which can also place the order (Create Order)

reference — Trading — Stop loss and Take profit orders, Risk Reward — Create Order


Q158: Ability to cancel/replace the order via drag and drop​

A: TP/SL can be changed via drag and drop. Dragging an order line calls OrderProvider.updateOrder()

reference — Order Provider — Key methods


Q159: DX Offers market data and cloud running of the scripts/stratgies etc... -> we need to understand if we can use our own market data with the DX Cloud tools.​

A: not out of the box


Q160: Do DX charts support data tables? display results of the indicator in a data table on the chart​

A: Tables can not be shown on charts. But there is possibility to export data to a CSV file.

reference — Export Data


Q161: Can back testing be done?​

A: Not now


Q162: Does the mobile package include all the same functionality as the web based charting?​

A: No, the mobile package is not supported right now. Also, lots of new features are not available there.


Q163: Does the library support accessibility standards (e.g., WCAG) to accommodate users with disabilities.​

A: Yes, hotkeys and screen readers support

reference — Keyboard shortcuts


Q164: Localization capabilities, including support for multiple languages, date/time formats, price formats, enhance usability for global audiences.​

A: Yes you will be able to localise the library on your language including Arabic

reference — Localization, Date format, Price precision, Timezones


Q165: Which operating systems does the library support? MAC, PC, Linux​

A: no limitations


Q166: Are there browser limitations?​

A: no limitations but we test on Chrome, Firefox, Safari


Q167: Ability to save drawing tools settings (color, thickness, etc)​

A: Yes, drawings settings are saved per symbol and per theme. They can be persisted in layout.

reference — ChartReactAppConfig - drawingsConfig, Layout provider


Q168: Set right margin and set vertical scaling​

A: Yes. Right margin via components.offsets.right (in candles), vertical range via chart.scale.setYScale()

reference — Chart configuration, Scaling — API axis range


Q169: Automatic scaling (horizontal and vertical): Double click automatic scale, and set chart to automatic scaling default​

A: Yes. Default is set with scale.auto in the chart config

reference — Scaling — Chart scale configuration


Q170: Zoom in/out and reset​

A: Zoom in/zoom out in place, reset via double click on timescale

reference — Scaling — User interactions, Magnifying tools, Chart Zooming Tool


Q171: Smart scaling - as prices move off screen will the screen auto adjust to display​

A: If autoscale is enabled and the latest candle is on the screen, the viewport will move.

reference — Scaling — Chart scale configuration


Q172: Ability to display correct formatting for futures - fractional and exotic​

A: Not out of the box


Q173: From my investigation, it looks like the createWidget() function’s “props” param is of type ChartReactWidgetProps, which doesn’t contain (itself or by extension) the uiOverrides property, and that is the reason we can’t get that working. It seems that the uiOverrides property is only available in the React version of the library, and not the widget. Am I correct? If so, is there some other way to specify UI Overrides to the DXChartWidget?​

A: Supported now: pass uiOverrides to DXChart.widget.createWidget() and build the components with the exposed DXChart.React.createElement

reference — Ways to customize DXcharts widget — UI overrides


https://dxcharts-demo.konak.in.devexperts.com/api/lib-alive https://devexperts.com/dxcharts/kb/docs https://dxcharts-demo.konak.in.devexperts.com/api/snapshot https://devexperts.com/dxcharts https://dxcharts-demo.konak.in.devexperts.com/docs/chart/x-axis https://dxcharts-demo.konak.in.devexperts.com/schedule-view

A: https://dxcharts-demo.konak.in.devexperts.com/api/lib-alive

This URL is used by us to check if library is being used or not.

https://devexperts.com/dxcharts/kb/docs

Link to our knowledge base. This link is used in studies config to give some information about study. You can replace studies config with your own, or map through ours default and delete this line if you don't like it.

https://dxcharts-demo.konak.in.devexperts.com/api/snapshot

We have default chartSharingProvider implementation that wired up to our server and this link is a part of it. This provider is responsible for snapshot functionality. Please make sure that you need to implement your own chartSharingProvider

https://devexperts.com/dxcharts

This is a promo link for web crawlers that attaches to DOM.

You can disable it via

<ChartReactApp dependencies={{ initialChartConfig: { devexpertsPromoLink: false } }}/>

https://dxcharts-demo.konak.in.devexperts.com/docs/chart/x-axis

That's a link to our documentation if you as a developer provided wrong format for XAxis labels format configuration.

https://dxcharts-demo.konak.in.devexperts.com/schedule-view

We have default implementation of tradingSessionsProvider and this link is a part of it. This provider is responsible for sessions. Please make sure that you need to implement your own tradingSessionsProvider

reference — Chart Sharing Provider, Trading Sessions Provider, Chart configuration (devexpertsPromoLink)


Q175: If I run DXChart.destroy(), on a page with one chart it destroys that chart, but on a page with 2 charts it destroys only the second chart. Is this the expected behaviour?​

A: you either need to call chartReactAPI.internal.destroy(), or the destroy() returned by each createWidget() / createChart() call

reference — Vanilla JS — Using API, Internal API


Q176: I notice there are two places I where can obtain the api:​

[1] props.onAPICreated() (with API in capitals) [2] props.dependencies.onApiCreated() If I specify it in both places (as an experiment), only [1] gets called, seemingly preventing the other one from being run. I am wondering why this similarly-named callback is in two places, do they do they have identical functionality, and which version do you recommend we use?

A: They are exactly the same, the only difference, that props.onAPICreated() was lifted one layer up for a simplicity while using widget.

props.dependencies.onApiCreated() is default dxcharts-react library callback, we didn't modify type declarations dependencies, but props.onAPICreated() has priority over props.dependencies.onApiCreated() in widget.


Q177: We are able to change the colors in the "Most important colors" and "Chart-core colors" palettes. However, we are not able to change the palettes under "Other colors" in our project. We are following the same structure that works for the others.​

Example below: // palette.ts

export const customPalette = {

light: { object: { 'main_chart-bg': 'rgb(226, 238, 255)', // Most important colors 'dropdown-list_item-selected-text': 'rgba(0, 0, 255, 1)' // Blue - Other colors } }, dark: { object: { 'main_chart-bg': '#1e1e1e', 'button-border-bg': '#000000', 'button-buy-default-bg': '#ffffff', 'button-buy-default-color': '#000000', 'button-buy-hovered-bg': '#f0f0f0', 'button-focus-border': '#ff0000', 'button-primary-border-default': '#0000ff', 'axis-text': '#ff0000', } } };

A: Regarding custom palette colors. Piece of code provided looks right and should work as well.

Please check these things:

  1. dev-tools eg HMR/hot-reload updates the code correctly;

  2. appropriate theme selected (for example, default theme is dark, but color has changed only in light theme);

  3. palette object is passed via dependencies.palette prop of ChartReactApp:

const deps = { ... }; const palette = { dark: { ... }, light: { ... }, }; <ChartReactApp dependencies={{ ...deps, palette, }} />

reference — Palette — Selective color overriding


Q178: We are running into some issues while lazy loading our candlestick data. Our API takes 3 params -> from_time, to_time and intervalOn the initial chart load in the method requestHistoryData - the from_time comes as 0, this means that data will be fetched since the beginning of that instrument. This results in a high API response time and payload for us. Can we initially fetch data for a certain timeframe without us hardcoding the initial from_time? The ideal scenario would be - we only fetch the data that is required to render the candles in the initial viewport - and then lazily load the previous data as the user scrolls back. We could not find any such callback/method in the documentation for implementing this​

A: Something goes wrong, if on initial chart load requestHistoryData receives fromTime = 0. Actually, fromTime is optional argument and not passed to options argument in most of the cases at all. I must have confused the undefined and 0 value. When fromTime is undefined (in most of the cases) it shouldn't be interpreted by the provider code as this means that data will be fetched since the beginning of that instrument. It's not.

fromTime usually used from timeframe presets, so in cases of lazy-loading, provider's code can ignore it at all. For lazy loading only toTime is important because it identifies the oldest candle already loaded and passed to provider to determine to which time stamp additional candles need to be loaded. Number of additionally loaded candles can be defined by the provider itself. If API takes 3 params described above, probably, from_time parameter can be calculated like this (pseudo-code):

requestHistoryData(symbol, aggregation, { toTime, fromTime }) { const interval = ...; return apiCall({ symbol, aggregation, to_time: toTime, from_time: fromTime ?? (toTime - interval) }) }

Most important thing, that both options (fromTime/toTime) is OPTIONAL and can be undefined.

One of the cases where fromTime can be = 0 - on very-very first chart load when there's no any layout and user data. It's looks like a mistake and value should be just undefined, but it's not changing the main behaviour. So, looks like there's several possible cases:

  1. chart loaded for the very first time: fromTime = 0 (possibly will be changed in future) and toTime = undefined

  2. chart loaded for the first time after page reload: fromTime = <timestamp> and toTime = undefined

  3. chart scrolled to the left in history and new data needs to be lazy-loaded: fromTime = undefined and toTime = <timestamp>

  4. timeframe preset selected: fromTime = <timestamp> and toTime = <timestamp>

reference — Chart Data Provider — Data fetching using requestHistoryData, Chart Data Provider — Lazy loading


Q179: concerning lazy loading, thank you for the detailed explanation about the internals! However, there is still some lack of understanding at our end. The issue with fromTime and toTime coming as undefined / 0 in most cases is that our api expects timestamps in the payload, according to which it fetches the candles within the timeframe provided. So to fetch the candles in the initial viewport, we need the latest timestamp, as well as the first timestamp corresponding to the leftmost candle in the viewport, which is where we are running into issues since the library is not giving us a fixed timestamp on initial load.How can we possibly pre-select a timeframe preset to get the fromTime and toTime timestamps?​

A:

As DXcharts is data-source agnostic library any arguments we provide to data provider methods are not query parameters to the data source in most cases. These arguments, eg. fromTime/toTime simply reflect the current state of the chart, not the chart request to load additional data. Therefore, you can either use the current state of the chart to calculate the necessary query parameters, or completely ignore them.

On very first load, when user didn't perform any scrolling actions and there's no any user-related/layout-related data form previous chart usage, you can just load latest dataset. In this case, the rightmost candle will be the newest by current moment (Date.now()) and the leftmost candle will be any interval in the past from current moment you want to be loaded in your data provider. On the second load, when chart was already loaded with some date (after very first load), you'll receive fromTime argument which is the leftmost candle timestamps of previously loaded data. If user will scroll the chart on right, in history data, your provider will receive toTime argument which will be a timestamp of rightmost candle in viewport and leftmost candle in already loaded candles. So, to load additional set of candles you can use toTime as a rightmost cut-off of data, and leftmost cut-off you can calculate based on the desired data interval, eg (pseudo-code):

requestHistoryData(symbol, aggregation, { toTime, fromTime }) {

if ( ! toTime) toTime = Date.now();
if ( ! fromTime) fromTime = toTime - periodToMinutes(aggregation) * 60 * 1000 * COUNT_OF_CANDLES;

return apiCall(symbol, aggregation, fromTime, toTime);
}

reference — Chart Data Provider — fromTime, Chart Data Provider — toTime


Q180: For our UI implementation, we are disabling the sidebar used to trigger drawings, and enabling the same through our UI, which requires us to call the drawings module functions to enable the user to draw by clicking our UI. We are using the following code (taking path drawing as an example) -​

const chartWithDrawings = attachDrawingsComponent(localChart.current) const configCopy = DEFAULT_DRAWINGS_CONFIG['path'] chartWithDrawings.drawings.startDrawing(configCopy) The above code initiates the ‘path’ drawing, however, it does not completely replicate the functionality on clicking the original sidebar, eg. the popup for the drawing settings/line color /lock-unlock isn’t visible. What could we be missing out here?

A: If you're using chart-react library and just want to make your own drawings toolbar, basically. you don't need to call attachDrawingsComponent at all, because chart instance from chart-react already has drawing attached to it. Moreover, an additional call to this function can lead to unpredictable effects

reference — Accessing DrawingsComponent from DXcharts React, Drawings configuration — Sidebar and toolbar drawings


Q181: Just to understand is there a feasibility to do our custom automatic drawings with the android/iOS sdk like web?​

A: Not as of now unfortunately, but we are looking to extend mobile library possibilities.


Q182: The requestHistoryData function does not seem to provide the expected parameters​

A: requestHistoryData receives all necessary arguments, eg. symbol, aggregation period and optional arguments eg. toTime/fromTime. The last arguments are needed for things like previous candles retrieving, additional candles lazy-loading and timeframe presets. There's several possible cases are associated with them:

  1. chart loaded for the very first time: fromTime = 0 (possibly will be changed in future to undefined as well) and toTime = undefined

  2. chart loaded for the first time after page reload: fromTime = <timestamp> and toTime = undefined

  3. chart scrolled to the left in history and new data needs to be lazy-loaded: fromTime = undefined and toTime = <timestamp>

  4. timeframe preset selected: fromTime = <timestamp> and toTime = <timestamp>

reference — Chart Data Provider — Data fetching using requestHistoryData


Q183: Configuring an image as part of a custom button instead of text was discussed​

A: you just need to use ChartToolbarButtonWithTooltip component to it like this:

import { ChartToolbarButtonWithTooltip } from '@dx-private/dxchart5-react/dist/chart/components/chart-toolbar/chart-toolbar-button-with-tooltip.component'; export const CustomToolbarButton = memo(() => { .... return ( <ChartToolbarButtonWithTooltip icon={icon} label={'Tooltip'} /> ); }); const toolbarButtons = addCustomToolbarButtons({ button: CustomToolbarButton, index: 21 }); <ChartReactApp {...props} uiOverrides={{ Toolbar: { ...DEFAULT_TOOLBAR_BUTTONS, ToolbarButtons: toolbarButtons }, }} dependencies={deps} />

reference — Overriding Toolbar buttons


Q184: The generateSessions method in the Trading session provider is not being called​

A: In codebase, generateSessions call happens as an effect to new candles loaded. So, probably, you need to complete your implementation of ChartDataProvider and make sure that this part is completely finished.

reference — Trading Sessions Provider, Chart Data Provider


Q185: Additionally, guidance is sought on the logic expected for the onInstrumentChanged method.​

A: This is your provider custom callback which can be just empty function if you don't need it. Basically, it's created to notify SuggestProvider when instrument changed in specific chart (multichart feature) to make some side-effect on this action.

reference — Symbol Suggest Provider — API reference


Q186: Requirements for displaying trading hours in the trading widget, including handling special trading sessions and holidays within Monday to Friday, were discussed.​

A: There's no any requirements except compliance with data types. To provide holidays and any other non-trading days just put TradingSession object with type NO_TRADING. To get Market State widget working, you need to successfully implement TradingSessionsProvider. The main thing, for this widget, is to provide the next trading session to chart be able to calculate when market will open.

reference — Trading Sessions Provider


Q187: dependencies.initialChartConfig: please see my comments there; it seemed like the items I needed to put in there are from the dxcharts-lite config section, and I couldn’t find any of that by following the TypeScript definitions as I had with all other sections of the config. Should this section follow the structure here: https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-lite/Chart%20Config ?​

A: this is config for our canvas library dxcharts-lite which is open source, and you can find on github https://github.com/devexperts/dxcharts-lite.Config you're interested in can be found here https://github.com/devexperts/dxcharts-lite/blob/master/src/chart/chart.config.ts

reference — Chart configuration, Config override


Q188: Chart crashes when background colour is picked (whether the values are RGB or RGBA)​

These are fixed background colours that can be picked in the colour picker. #FF0000", "#00FF00", "#0000FF", "#999999

A: Regarding colorPalette - please, provide colors in the next format rgba(1, 1, 1, 1). Alpha channel is crucial


Q189: I see warning about URL, what should I do?​

A: Its because we use webworkers under the hood to do some things in a more performant way. The thing is that chart can't create workers in your environment obviously, that's why you see this error. Fixed in v5.17.1 — workers are now bundler-agnostic; disable workers for older versions

reference — Bundling — Vite, Bundling — Older versions


Q190: Please also let us know how we can hide the bottom bar which shows the timeframe selection and how we can change timeframe and intervals through code​

A: To hide the bottom bar, you can use the chartReactConfig to disable the timeframe selection UI component.

javascript const chartReactConfig = { timeframePresets: { mode: 'none' } }; <ChartReactApp dependencies={{ chartReactConfig }} />

reference — API reference — Configuration — ChartReactAppConfig — timeframePresets, Overriding the Footer component


Q191: Changing Period Through Code​

A: To change the timeframe and intervals programmatically, you can use the changePeriod methods provided by the chartReactAPI.Here is an example of how to change Period :

javascript const onApiCreated = (chartReactAPI) => { chartReactAPI.onChartCreated((chartId, chartInstance) => { // Change the aggregation period chartReactAPI.changePeriod({ duration: 30, durationType: 'm' // 'm' for minutes, 'h' for hours, etc. }); }); }; <ChartReactApp onApiCreated={onApiCreated} />

reference — Supported APIs


Q192: Can I completely ignore the initialChartConfig section (and delete it from my config), given that we are using the React version (widget build) and not the lite version?​

A: separate parts of application uses their own config, i.e if you need something to configure on canvas - use initialChartConfig. It is optional — omit it if you don't customize the canvas chart

reference — Configuring DXcharts React library — Initials, Chart configuration


Q193: on web workers – our product is already a PWA and uses a service worker; as far as I’m aware, there is no environmental reason that standard web workers should not operate.​

A: Since v5.17.1 workers work out of the box (self-contained blob workers). Disable them only on older versions

reference — Bundling, Bundling — Older versions


Q194: could you also let us know how to change the time frame of the graph? eg. 1D, 1W, 1M, 1Y etc​

A:

const initialTimeframePresets: {
presets: [
{
timeframe: { label: '1D', value: 60 * 60 * 24 // day in sec },
aggregation: {
duration: 1,
durationType: 'm',
},
},
...
],
};

<ChartReactApp dependencies={{ initialTimeframePresets }} />

reference — Configuring DXcharts React library — Initials


Q195: how can we hide this bottom bar which shows % and log?​

A: Override the footer via uiOverrides.Footer, or hide the element with a CSS override

reference — Overriding the Footer component, CSS override


Q196: Do we need to implement any provider specific to handle multi charts ?​

A: There's no separate provider for multi-charts. Each chart is a separate instance; chartId in requestHistoryData tells which chart asked for data

reference — Multichart, Chart Data Provider — symbol and chartId


Q197: I have a question regarding resetting the chart candles data when the symbol changes.When the instrument changes, I call the changeInstrument method on the chartReactAPI from my component.After changing the instrument, I also need to reset the chartCandlesData stored in the provider. I can't expose a new method like resetCandlesData directly to the provider due to potential type errors. This seems like a common scenario to me. Could you please advise on the ideal approach for handling this situation?​

A: Could you try to use use updateCallback function which is the last argument of chartDataProvider.requestHistoryData. Read more https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/API%20Reference%20-%20Providers

reference — Chart Data Provider — updateCallback


A: about duplicating candles after switching between multichart/singlechart layouts. The only reason chart can draw duplicated candles is when candles data is duplicating. Which data chart receives from provider, that data will be displayed. Actually, we can see it on video, when data count doubles at each action, it's wrong behavior and probably should be fixed on data provider side. Client should make sure that provider return the correct data to the chart.

reference — Chart Data Provider — symbol and chartId, Chart Data Provider — updateCallback


Q199: Regarding the trading session provider, could you please provide a sample TradingSession object that I need to return in the generateSessions method for the following scenarios:​

Regular trading sessions are from Monday to Friday, starting at 9:15 a.m. and ending at 3:30 p.m. There are no trading sessions on weekends. There is a special trading session on May 18, 2024, which is a Saturday. There is a trading holiday on August 2, 2024, which falls on a Wednesday.

A: here's an example of trading sessions array

[

{

"from": 1720569600000,

"to": 1720598400000,

"type": "NO_TRADING"

},

{

"from": 1720598400000,

"to": 1720612800000,

"type": "PRE_MARKET"

},

{

"from": 1720616400000,

"to": 1720641600000,

"type": "REGULAR"

},

{

"from": 1720641600000,

"to": 1720656000000,

"type": "AFTER_MARKET"

},

{

"from": 1720656000000,

"to": 1720684800000,

"type": "NO_TRADING"

},

{

"from": 1720684800000,

"to": 1720699200000,

"type": "PRE_MARKET"

},

{

"from": 1720702800000,

"to": 1720728000000,

"type": "REGULAR"

},

{

"from": 1720728000000,

"to": 1720742400000,

"type": "AFTER_MARKET"

},

{

"from": 1720742400000,

"to": 1720771200000,

"type": "NO_TRADING"

},

{

"from": 1720771200000,

"to": 1720785600000,

"type": "PRE_MARKET"

},

{

"from": 1720789200000,

"to": 1720814400000,

"type": "REGULAR"

},

{

"from": 1720814400000,

"to": 1720828800000,

"type": "AFTER_MARKET"

}

]

NOTE: timestamps are mocked. Please, change timestamps to what you need

reference — Trading Sessions Provider


Q200: I am currently testing our requestHistoryData() implementation, and have noticed that options.fromTime is 0 and there is no options.toTime.​

A: fromTime and toTime is not exactly the date range that you should request data for, it's more like a viewport state. So it's not strict actually and you can change range the way you like.

When chart loads, especially for the first time, there's no date range actually - we don't know how much data to request. That's why we send fromTime as 0 and toTime as undefined. You can provide any amount of data you want.

toTime always provided when lazy loading was triggered. toTime indicates the leftmost candle you have on chart. That means that you can provide any amount of data to the left with the right bound pointed to toTime.

When fromTime is provided it doesn't mean that you strictly should provide data in the range fromTime - Date.now, it only tells you - look, user's left viewport bound is fromTime, please provide at least data from fromTime, but you can provide more or less in case you have fewer data for that instrument.

reference — Chart Data Provider — fromTime, Chart Data Provider — toTime


Q201: I have some test bars which display fine on our chart if I return Promise.resolve(arr). However, I need to be able to send the bars array to the chart at any time (and not just at the end of the requestHistoryData function), and that’s what I assume the updateCallback is for.​

A: updateCallback should only be used on subsequent calls. What it means? When chart asks you a data (for example on load or when you change aggregation/instrument) via requestHistoryData you should provide him history data via return value, pretty simple. BUT, there are some cases when you want to change data after some time, for example when some part of candles changes in the middle, then you should store this updateCallback somewhere and call it providing ALL THE CANDLES, including new ones. Please, be careful, because this method don't support partial updates, it updates all the history.

reference — Chart Data Provider — updateCallback


Q202: One other thing I’ve noticed is that when I scroll backwards in the chart, the library is not requesting further historic data. Should I expect the requestHistoryData() function to be called by the library to request previous historic data as I scroll?​

A: Yes, you should expect the requestHistoryData function to be called by the library to request previous historic data as you scroll backwards in the chart. This is part of the lazy loading mechanism in DXcharts. Here’s how it works:

Lazy Loading Mechanism​

  1. Initial Load:
  • On the initial chart load, requestHistoryData may receive fromTime as 0 or undefined, indicating that it should fetch the latest dataset required to render the initial viewport.
  1. Scrolling Backwards:
  • When you scroll backwards in the chart, the library will call requestHistoryData with the toTime parameter, which identifies the oldest candle already loaded. This allows you to fetch older data.

Example Implementation​

javascript const requestHistoryData = (symbol, aggregation, { fromTime, toTime }) => { const interval = ...; // Define your interval here if (!toTime) toTime = Date.now(); if (!fromTime) fromTime = toTime - interval _ 60 _ 1000 * COUNT_OF_CANDLES; return apiCall({ symbol, aggregation, to_time: toTime, from_time: fromTime }); };

Detailed Steps:​

  1. Initial Load:

javascript if (!toTime) toTime = Date.now(); if (!fromTime) fromTime = toTime - interval _ 60 _ 1000 * COUNT_OF_CANDLES;

  1. Lazy Loading:

javascript // Use toTime to determine the timestamp for additional candles

For more detailed information, you can refer to the DXcharts documentation:

  • DXcharts Documentation - Providers.

This approach ensures that you fetch only the data required to render the initial viewport and then lazily load additional data as needed.

reference — Chart Data Provider — Lazy loading, Chart Data Provider — toTime


Q203: The above clarification is for setting the initial timeframe presets if I'm not wrong – We need to select one of these presets through one of the callback functions - which is what we need to know, please help out here!​

A: The initial preset is set via dependencies.initialTimeframePreset (it must be one of initialTimeframePresets). To select a preset at runtime, call api.setTimeframePreset(preset, chartId?)

reference — Configuring DXcharts React library — Initials, Supported APIs


Q204: Is changing the font family of the chart feasible?​

A: You can change fonts in canvas (example will be posted below). For React UI components, override the font CSS variables (see the Fonts guide).

Example on how to change for canvas:

You can achieve this by configuring the fontFamily property in the chart configuration. Here is an example of how to change the font family:

Example Implementation​

javascript import { ChartReactApp } from '@dx-private/dxchart5-react'; const initialChartConfig = { components: { xAxis: { fontFamily: 'Open Sans, sans-serif', fontSize: 10, }, yAxis: { fontFamily: 'Open Sans, sans-serif', fontSize: 10, }, watermark: { fontFamily: 'Open Sans, sans-serif', } } }; <ChartReactApp dependencies={{ initialChartConfig }} />

Detailed Steps:​

  1. Set Font Family for X-Axis:

javascript components: { xAxis: { fontFamily: 'Open Sans, sans-serif', fontSize: 10, }, }

  1. Set Font Family for Y-Axis:

javascript components: { yAxis: { fontFamily: 'Open Sans, sans-serif', fontSize: 10, }, }

  1. Set Font Family for Watermark:

javascript components: { watermark: { fontFamily: 'Open Sans, sans-serif', } }

For more detailed information, you can refer to the DXcharts documentation:

  • DXcharts Documentation - Chart Config.

reference — Fonts (DXcharts React), Fonts (canvas)


Q205: On adding indicators, they are added to the viewport and the chart is shrunk. How can we avoid changing the height of the chart and add the indicators below the viewport?​

A: Currently is not possible, chart recalculates viewport after indicator is added to the chart.

reference — Chart Scale configuration


Q206: How can we change the default icons for event the event bubbles on charts (the default icons being rhombus)? We wanted to use custom initials for the icons which we receive on the client through an API​

A: By changing the event config chart.config.components.events.icons.

reference - Events customization


Q207: Our backend currently supports data time frames of 1 minute, 30 minutes, and 1 day. For intervals like 15 minutes (which fall between 1 minute and 30 minutes), we would like the chart to use 1 minute data to plot candles for 15 minutes. We use requestHistoryData and subscription to provide 1 minute data, expecting the chart to aggregate this data for 15 minute candles. Could you please advise on how to configure this?​

A: You would need to paste these 15 candles together on you custom data provider side and then pass them to the chart. Charts expects to receive 15 minutes candles data when 15 minutes aggregation option is selected in the UI.

Code sample for you data provider:

const aggregateToFifteenMinutes = (oneMinuteData) => {

const fifteenMinuteData = [];

for (let i = 0; i < oneMinuteData.length; i += 15) {

const chunk = oneMinuteData.slice(i, i + 15);

const aggregatedCandle = {

time: chunk[0].time,

open: chunk[0].open,

high: Math.max(...chunk.map(c => c.high)),

low: Math.min(...chunk.map(c => c.low)),

close: chunk[chunk.length - 1].close,

volume: chunk.reduce((sum, c) => sum + c.volume, 0),

};

fifteenMinuteData.push(aggregatedCandle);

}

return fifteenMinuteData;

};


Q208: I would like to provide different loading states to the chart by using initialLoading property on the ChartReactAppConfig. From the typings below, I could not figure out how to configure these. Can you please provide an example on how to show our own loading states for symbol loading and candle loading etc.​

A: Add your own InitialLoadingItem entries to initialLoading; the guide shows a custom loading state for requestHistoryData candles

reference — Loading state


Q209: I have reviewed the trading sessions attached in the previous email. I’m unsure how they are configured for Monday to Friday, as the JSON file only contains epoch timestamps which seem specific to particular days or weeks. Additionally, I am unsure how to incorporate special trading sessions on specific Saturdays or trading holidays on weekdays. On the Android DX build, we use the Schedule object to define days (Monday to Friday) and specify sessions for those days. Is there a similar configuration available for the web bundle?​

A: Web and Android works differently in case of trading sessions. I have attached the same file with additional comments on top. DXcharts interface consumes data in this format (like in attached exampl). In your provider you can use the preferable session format and then convert it to what DXcharts understands.

[

{

// as you can see here, you define NO_TRADING session from 12:00 AM to 8:00 AM on 10 Jul

"from": 1720569600000, // GMT: Wednesday, July 10, 2024 12:00:00 AM

"to": 1720598400000, // GMT: Wednesday, July 10, 2024 8:00:00 AM

"type": "NO_TRADING"

},

{

// after that obviously PRE_MARKET sessions starts from 8:00 AM to 12:00 PM

"from": 1720598400000, // GMT: Wednesday, July 10, 2024 8:00:00 AM

"to": 1720612800000, // GMT: Wednesday, July 10, 2024 12:00:00 PM

"type": "PRE_MARKET"

},

{

// then REGULAR session starts from 12:00 PM to 8:00 PM

"from": 1720612800000, // GMT: Wednesday, July 10, 2024 12:00:00 PM

"to": 1720641600000, // GMT: Wednesday, July 10, 2024 8:00:00 PM

"type": "REGULAR"

},

{

// and AFTER_MARKET then starts from 8:00 PM Jul 10 to 12:00 AM Jul 11

"from": 1720641600000, // GMT: Wednesday, July 10, 2024 8:00:00 PM

"to": 1720656000000, // GMT: Thursday, July 11, 2024 12:00:00 AM

"type": "AFTER_MARKET"

}

]

reference — Trading Sessions Provider


Q210: To update the watermark, When I implement below code, the custom watermark I apply only appears briefly before reverting back to the default watermark on the charts. I am calling this method once api is created. Please review my code below and let me know how to update the watermark on initial load, change instruments, switch between layouts on multi charts etc. Please refer to the attached video for my current issue i am facing.​

A: Set chartReactConfig.watermark.mode: 'custom' — in the default instrument mode the chart overwrites your watermark. Then call chart.watermark.setWaterMarkData()

reference — Watermark — Watermark modes, Watermark — Custom display name


Q211: API methods like changeTheme do not work when uiOverrides dependencies are added to the chart. Without uiOverrides, methods such as changeTheme and changePeriod function as expected. Please review the code below and let me know if any adjustments are necessary:​

A: Since ChartReactApp is a React component. And you pass {} to property called uiOverrides . It means, that ChartReactApp component will receive new object every rerender, which will lead to ChartReactApp rerender too. We will fix it, so ChartReactApp will not be rerendered in that case, because we don’t support runtime prop changes.

To unblock you, simply wrap your uiOverrides object with useMemo

const uiOverrides = useMemo(() => ({Toolbar}), [])

and pass it to ChartReactApp uiOverrides prop


Q212: We want to be able to change the timeframe through our UI. How can we achieve this if there is no callback function available for the same?​

A: You can change the preset in runtime via api.setTimeframePreset(preset, chartId?)

reference — Supported APIs


Q213: How can we find if an indicator on the chart is turned off/on? Ideally, on clicking the close button of an indicator on the chart, we want to find out which indicator is closed​

We tried the following approach but the subscription to the observeStudiesConfigChanged method logs undefined on any changes in indicators - ChartWithModules.studies.observeStudiesConfigChanged().subscribe((config) => { console.info(config) })

A:

There's no special API or event to notify user-land code about studies changes, but we can try to implement such kind of interaction for different ways with varying degrees of convenience. First of all, provided example of subscription doesn't contain config argument in callback function. It works mostly like plain notification notifying that some changes have occurred in the studies config. Determining which exact changes occurred, for example, which studies was removed or added, should be handled by user-land code:

instance.studies.observeStudiesConfigChanged().subscribe(() => {
const studies = instance.studies.model.studies;
// determining which changes happened
});

For us the most appropriate way to handle such cases - implementing custom LayoutProvider which will track which changes happened using the layout config, in which studies are present as well:

// LayoutProvider

export function createLayoutProvider(): LayoutProvider {
...
const updateLayout = (layout: ChartLayoutWithId): Promise<void> => {
// layout.charts[i].studies[j] - current state of studies on all charts of layout
// determining which changes in studies happened
};
...

return {
...
updateLayout,
};
}

reference — Layout Provider


Q214: Regarding the trading sessions provider, could you please be more specific? Does DX need timestamps for only the current and next trading day, or does it require additional days as well?​

A:

We recommend to to provide timestamps for 14 days ahead from the current day

  1. It seems this omission from the api-side and a great opportunity to improve it. Probably, we'll add ability to set these fields separately and optional. For now client can use such workaround:
import { DEFAULT_LIST_OF_TIME_ZONES } from '@dx-private/dxchart5-react/dist/utils/timezones/timezones';

const timezones = { currentTimezone, listOfTimezones: DEFAULT_LIST_OF_TIME_ZONES };
  1. To localize xAxis labels client may define these configs in order of days in week and months in year:
const dependencies = {
initialChartConfig: {
shortMonths: [],
shortDays: [],
}
};

reference — Trading Sessions Provider, Timezones, Localization


Q215: Price type settings:In the price type settings, I see four options: Last, Market, Bid, and Ask.​

A: This is responsibility of ChartDataProvider, equestHistoryData. In options there is priceType: ‘last’ | ‘mark’ | ‘bid’ | ‘ask’. Chart will request market data with the type specified in the UI, while provider should give candles with the necessary type.


Q216: Bottom Nav Bar Interval Config: Our data feed doesn't support the 5-second timeframe​

A: You can use ChartReactSupportedAPI.setAggregationRestrictionRule api method to filter superfluous timeframe periods. In this particular case, it can be done like this:

api.setAggregationRestrictionRule((aggregation: AggregationPeriod) => aggregation.durationType !== 's');

reference — Supported APIs


Q217: Is there a way to add validations to aggregation periods, like: 300 minutes for minutes, 24 hours for hours, 365 days for days, 54 weeks for weeks, 12 months for months, and 30 years for years.​

A: Pls take a look at this example

api.setAggregationRestrictionRule((aggregation: AggregationPeriod) => { if (aggregation.durationType === 'h' && aggregation.duration !== 24) { return false; } // any other restrictions and conditions return true; });

reference — Supported APIs


Q218: Wanted to hide a few options on the settings tab. For example, we do not want to display the "Conference Calls" option in the Event settings. Please let me know if this is possible.​

A: Yes, via config: chartReactConfig.settingsTabs.events.options.conferenceCalls.enabled: false

reference — Config override — Full config reference


Q219: How can we set the Y axis bounds to keep the chart's Y scale within the stock's all time low and all time high values?​

A: For runtime you can use setYScale/setXScale functions, while to change that during initialisation subscribe to chartInstance.data.observeCandlesChanged after candles are set. Use instance.scale.setYScale / instance.scale.setXScale to manually specify range and scale right after initialization. And then set Autoscale to false initialChartConfig: { scale: { auto: false } }

reference — Scaling — API axis range


Q220: I am encountering an issue with the generateSessions method in the TradingSessions provider. I have configured the from and to options to span from the provided epoch time to 14+ days ahead. The timezone is set to 'Asia/Kolkata' using the getTimeZone method in the TradingSessions provider.​

However, the trading hours displayed on the chart are incorrect. Expected trading hours: 09:15 to 15:30 Displayed on the chart: 15:30 to 23:59 Note: I was asked to pass the tradingHours parameter as an optional string in the findInstrument method within the SymbolSuggestProvider. I tried passing the following value to denote market hours from 09:15 to 15:30 in IST: MumbaiIN(rt=0530;0=p00000000r09150915a09150915) However, the issue still persists regardless of whether I include this data or not.

A: Please check how tradingSessionsProvider.getTimeZone is implemented. It should receive and process options argument which contains instrument's symbol and instrument's tradingHours. If tradingHours of specific instrument is undefined, it means what UTC should be returned form this function. If specific instrument has declared tradingHours in format NewYorkETH(....), getTimeZone should return timezone based of instrument's tradingHours field in format America/New_York. Important that getTimeZone returns not just any timezone but transform instrument tradingHours to timezone format. Small example of implementation:

function getTimeZone({ tradingHours }) { //{tradingHours: 'NewYorkETH(....)'} if (!tradingHours) { return Promise.resolve('UTC'); } return requestToDataProviderScheduler(tradingHours).then((res) => { return res[tradingHours].schedule.timeZone; // 'America/New_York' }); };

reference — Trading Sessions Provider, Symbol Suggest Provider — tradingHours


Q221: Wanted to hide a few options on the settings tab​

A: Prefer config: chartReactConfig.settingsTabs (see Q218). CSS alternative, for example (disclaimer: its bad approach and not recommended), for me this CSS selector is working fine:

#events-tab :nth-child(5) { display: none;}

The also way to do that is to create fully custom setting tab for events from scratch. It's not very convenient and probably will require many internal API usage, but it's also possible and as I know, this approach also used by some of our clients. Please check this article for more details: https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/Component%20Overriding/Settings%20Tabs/settings-popup-tabs

reference — Config override — Full config reference, CSS override, Overriding settings tabs


Q222: How can I make Crosshair initialised by default in the default graph, so there wont be a need for users to manually set it.​

A: const dependencies = { initialChartConfig: { components: { crossTool: { type: 'cross-and-labels', // 'cross-and-labels' | 'only-labels' | 'none' ... }, ... }, }, }; <ChartReactApp dependencies={dependencies} />

reference — Crosshair, CrossTool


Q223: How do I change the default color of the drawing line (by default it is yellow)?​

A: const palette = { dark: { object: { 'drawing-line-default-bg': '#ff5b24', } }, light: { object: { 'drawing-line-default-bg': '#ff5b24', } }, }; <ChartReactApp dependencies={{ palette, ... }} />

reference — Palette — Selective color overriding


Q224: how to lock Y-scale?​

A: const onApiCreated = (api: ChartReactAPI) => {

api.onChartCreated((chartId, chart) => {

chart.chartPanComponent.setChartPanningOptions(true, false);

});

};

reference - Scaling - Chart Scale configuration


Q225: How can I subscribe to the event when DOM is fully rendered​

A: const subscription = chart.chartModel.observeCandlesChanged().subscribe(() => {

if (chart.chartModel.getCandles().length) {

console.log('Chart with candles is ready');

subscription.unsubscribe();

reference - API Reference - Chart Component

}

});


Q226: How to limit max/min width of the chart?​

A: const dependencies = { initialChartConfig: { components: { chart: { minCandles: <number>, // for max zoom - minimum number of candles should be on viewport minWidth: <number>, // for min zoom - minimum width of the chart } } }

reference — Chart configuration


Q227: How to remove "delete" icon from drawing toolbar​

A: Right now we don't have any way to hide close button or override drawing toolbar component.


Q228: During runtime, we want to check if a particular candle at a timestamp is available/fetched, if the candle at that timestamp doesn't exist/hasn't been fetched yet, we want to fetch candles till that particular timestamp. Do you know how we can do this?​

A: Looks like the question is about lazy-loading of additional candles when moving to the history. If so, then the chart will call requestHistoryData() callback with { toTime } timestamp. This timestamp can be used to "fetch candles till that particular timestamp.".

This is how to get currently loaded candles:

const candles = chart.chartModel.getCandles(); const isCandleExist = candles.some(candle => candle.timestamp === timestamp);

reference — Chart Data Provider — toTime, Chart Data Provider — Lazy loading


Q229: Aggregations / Calculations etc. on the most granular (tick level) data is done in the library or client browser/app?​

A: From the standpoint of DXcharts aggregation is a parameter that is send to data provider, which in case return the requested data. No calculations happen on DXcharts side


Q230: Could you explain how I can pass WaterMark to the graph?​

Find these two links https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-lite/Tools-and-features/Watermark https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-lite/API-Reference/WaterMarkComponent I carried out some tests, but I was unable to move to the graph, by default loading WaterMark Note: We are using reactjs with typescript.

A: Two links you have provided are related to DXcharts-lite (you can see it in URL), that is open source data visualisation tool, this works differently from DXcharts Library.

In the library set chartReactConfig.watermark.mode: 'custom' and pass rows via chart.watermark.setWaterMarkData().

reference — Watermark — Watermark modes, Watermark (canvas)


Q231: In runtime, how do we get the current aggregation period applied on the chart?​

A:

const onApiCreated = (api: ChartReactAPI) => {
console.log(api.getSelectedChartInfo().period); // eg: { duration:1, durationType:"h" }
};

reference — Supported APIs


Q232: Is there any way to call requestHistoryData on runtime without it being called on it's own in the provider?​

A:

To give the most useful answer, quick 101 - requestHistoryData calling by chart internal logic any time then initial or additional historical data are needed. The result of this function applying to the chart automatically and you don't need to do anything more in most of the cases. But, for some reasons, you want to apply additional data candles to the chart at some logical point of your application, you able to use third argument of requestHistoryData function called updateCallback. You can store this callback anywhere you want and call it at any moment you need and provide any ChartCandleData array which should be applied to the chart after this call. Note, that new ChartCandleData array you provided as an argument of updateCallback function will fully re-write current data in chart and you should control the data flow by yourself. Possible code example:

let updateChartData;

export function createChartDataProvider() {
...
return {
...
async requestHistoryData(symbol, aggregation, options, updateCallback) {
updateChartData = updateCallback;
...
}
};
}

// any other place in you code

updateChartData(data); // will apply new data series to the chart

reference — Chart Data Provider — updateCallback


Q233: This is the documentation that we are using. https://devexperts.com/dxcharts/documentation-for-developers/About​

Is there more detailed documentation that gives detailed instructions how functionality is supposed to be implemented? The documentation seems to only describe the function name. It does not give more complete examples of how to integrate the function.

A: We constantly updating the documentation, currently everything we have available is add to our website. We hope that that function naming and descriptions together with full typing coverage should help out to determine the purpose of a particular APIs. Let us know if there is anything specific that you are looking for and we'll add this to documentation.


Q234: We provide users the ability to set the default quantity and quantity step/increment by asset class. We will eventually allow users to set defaults by symbol.​

We do not see how to update the quantity when a new symbol is entered in the chart. When we attempt to reset the values when the symbol is changed, the quantity and increment are ignored. Can this be done?

A: To understand a moment when instrument has changed you can implement SymbolSuggestProvider.onInstrumentChanged callback (https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/API-reference/api-reference-providers). This callback will be triggered by chart when user changes an instrument. In that moment we can somehow check the instrument group and apply appropriate values to Order entry input. Possible code example:

onInstrumentChanged(symbol: string) { switch(symbol) { case 'GOOG': case 'GOOGL': chartReactAPI.setTradingQuantity(1000); // etc break; case 'AAPL': chartReactAPI.setTradingQuantity(10); // etc break; } }

reference — Symbol Suggest Provider — API reference, Supported APIs


Q235: On our current chart, if you have Orders or Positions off screen, there is an order flag/positions flag that points off screen. This lets the user know that they have open order and positions when they are off screen.​

Does your chart have this functionality?

A: Orders/positions are completely on corresponding providers side, under full control of the client-side code. So, we think it shouldn't be difficult to implement such labels using regular user-land React components on-top of dxChart widget.

reference - Component Overriding - Order component

Q236: About the widget. I am trying to determine a reliable way of targeting elements so that I can customise them. Currently, I have hidden the control by CSS via a classname in its containing div:​

.kkYXyj // Zoom in/out magnifying glass icons { display: none !important; } This works on different browsers on my desktop, but doesn’t work on my mobile because the classname is different (in this case, “kkZJLK”). I am therefore wondering if this class is different for each device.

A: all those classes will be different on each build, so it's definitely not reliable way. Use the stable human-readable class names instead (listed in COMPONENTS_CLASSNAME)

reference — CSS override — How to find class names


The term “extended hours” in our React application refers to a feature that allows you to retrieve candle data beyond the regular trading session. When enabled, it triggers a request to the candleDataProvider for candles that fall outside the primary trading hours. This functionality helps your application distinguish between candles from the main trading session and those from other times. To make it work, you’ll need to provide trading schedules for the instrument in the tradingSessionsProvider and ensure that the candleDataProvider includes the extendedHours field in its history requests.

A: Sure thing. Let me start with the following.

Session breaks - Highlights the time breaks on the chart if the aggregation period is less than 1 day. The session breaks can also be toggled on/off by right-clicking on the chart area.

Extended hours - Displays extended hours volume on the chart if the chosen instrument supports extended hours trading and aggregation period is less than 1 day. Pre-market and Post-market sessions

Events - Displays info markers about upcoming events on the time axis.

Events and news

More info under this links:

https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/API%20Reference%20-%20Providers - TradingSession provider (session breaks and extended hours are included in here), news and events implementation guide https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-lite/Session%20Breaks - how its being visualised. You don't need to do it from scratch, already a part of library

example of trading sessions array:

[

{

"from": 1720569600000,

"to": 1720598400000,

"type": "NO_TRADING"

},

{

"from": 1720598400000,

"to": 1720612800000,

"type": "PRE_MARKET"

},

{

"from": 1720616400000,

"to": 1720641600000,

"type": "REGULAR"

},

{

"from": 1720641600000,

"to": 1720656000000,

"type": "AFTER_MARKET"

},

{

"from": 1720656000000,

"to": 1720684800000,

"type": "NO_TRADING"

},

{

"from": 1720684800000,

"to": 1720699200000,

"type": "PRE_MARKET"

},

{

"from": 1720702800000,

"to": 1720728000000,

"type": "REGULAR"

},

{

"from": 1720728000000,

"to": 1720742400000,

"type": "AFTER_MARKET"

},

{

"from": 1720742400000,

"to": 1720771200000,

"type": "NO_TRADING"

},

{

"from": 1720771200000,

"to": 1720785600000,

"type": "PRE_MARKET"

},

{

"from": 1720789200000,

"to": 1720814400000,

"type": "REGULAR"

},

{

"from": 1720814400000,

"to": 1720828800000,

"type": "AFTER_MARKET"

}

]

NOTE: timestamps are mocked. Please, change timestamps to what you need

reference — Extended Hours, Session breaks, Trading Sessions Provider, Events Data Provider, News Data Provider


Q238: Is there a way to add title to the chart headline? Title should change depending on the chart type​

A: The only way to subscribe to chart type changes right now is via layoutProvider.updateLayout method. layoutProvider.updateLayout will be called by dxcharts-react every time something layout related changes and chart type is a part of it. When layoutProvider.updateLayout is called you can unpack new selected chart type and notify your components somehow (via global storage or some kind of eventbus implementation).

reference — Layout Provider


Q239: is there a way to make symbol suggest input wider?​

A: If you don't like our default symbol selector - you can implement your own via uiOverrides.InstrumentSuggest. If you want to change only width of input - there's no native way. You can hack it somehow with CSS but it's not recommended.

reference — Symbol Suggest Provider — Custom InstrumentSuggest override, UI overrides, CSS override


Q240: I'm working on implementing extended hours and have a few questions:​

Does the tradingSessionsProvider control how the candles from the chartDataProvider will be rendered on the chart? I created a TradingSessionsProvider.ts file and integrated it into the dependencies with tradingSessionsProvider: customBovespaTradingSessionsProvider. Is this the correct approach?

A: To make extendedHours functionality work correct you need to support it correctly in ChartDataProvider

When extendedHours is enabled - it means that all the candles will be displayed on chart, including those from different trading sessions like PRE_MARKET and so on.

When extendedHours is disabled - it means that only candles from REGULAR trading session will be displayed

The thing is, that it is up to you which candles to show. When user clicks extendedHours and enable it, then ChartDataProvider.requestHistoryData will be called with extendedHours option provided with true like ChartDataProvider.requestHistoryData('AAPL', '1h', { extendedHours: true }). It means, that in return dxchart will wait for all the candles from all trading sessions to be provided by you and chart will be completely redrawn. In other words it is your business to provide all the candles.

When user clicks extendedHours and disable it, the same this happens, but with extendedHours: false provided - therefore your should return candles only from REGULAR trading session.

One of TradingSessionsProvider responsibilities is to cover sessionBreaks functionality. When user enables Session Breaks (NOTE: it only available with extended hours enabled) they will see vertical lines on chart that indicate the start and end of different trading sessions. And to know where to draw which line, chart will ask trading sessions schedule via TradingSessionsProvider.generateSessions.

reference — Extended Hours, Trading Sessions Provider


Q241: Is it possible to place orders through dxscript in an automated manner? If so, could you please provide some insights on how to achieve this?​

A: Currently there are no such capabilities in DXscript, but pls discuss this with DXfeed team they might have it in a roadmap or planned for future releases


Q242: Following up on a previous question, I wanted to hide certain options on the settings tab. For example, we don't want to display the "Conference Calls" option under Event settings. You mentioned that one approach would be to completely rewrite the content of the Events tab and retain only the options we need.​

A: You can refer to https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/Working-with-dxcharts-react-library/Configuration/Component-overriding/settings-popup-tabs or https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/Working-with-dxcharts-react-library/Configuration/Component-overriding/settings-popup-content to accomplish this. Simpler option: hide it via chartReactConfig.settingsTabs (see Q218)

reference — Overriding settings tabs, Overriding default settings tab content, Config override — Full config reference


Q243: Our data feed provides only 1-minute, 30-minute, and 1-day data, and we aggregate these to generate all other intervals. For example, we use 1-minute data to create a 15-minute candle.​

Our APIs deliver live data for the previous completed minute (n-1 candles). For instance, if the current time is 10:01 a.m., the APIs will provide data up until 10:00 a.m., and the socket will provide the data for 10:01 a.m. We receive this live data through sockets and update it using the subscribeCandles callback method from ChartDataProvider. Consider the following scenario: The current interval is from 10:00 to 10:15 a.m., and a user enters the chart at 10:11 a.m. By calling our APIs, we can form the 10:00 a.m. candle using the data up to that time. Now, we need to update this candle with live data from the socket. However, the socket will only provide data for 10:11 a.m., which includes the OHLC values for that specific minute. Therefore, I need to retrieve the last candle plotted on the chart, apply aggregation logic, and then use the subscribeCandles callback to plot the correct live data. Is there a way to access the last plotted candle data to accomplish this? Additionally, in the case of multiple charts, how can I ensure that I'm only updating the data for the intended chart? I believe I need to use the subscriptionId to retrieve the last plotted candle data. Could you please suggest how to handle this scenario?

A: As far as I understand, you need to retrieve the last candle plotted on the canvas. The thing is, the chart only draws what you provide, so you can easily get the last candle on your end.

Regarding how to identify which chart you send updates to via the provider: requestHistoryData and subscribeCandles receive an optional chartId argument that identifies the requesting chart.

The subscriptionId is our internal subscription ID, and it is only useful for passing to unsubscribeCandles to clear any unnecessary subscriptions.

reference — Chart Data Provider — symbol and chartId


A:

To change link to KB in indicator you should follow this link https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/Working-with-dxcharts-react-library/Tools-and-features/Studies

here you'll find how to change default list of indicators

Along the way you can change indicators settings too. You can find DEFAULT_STUDIES_LIST() - it is an array that stores all the predefined indicators with its default settings. link is one of that settings.

So you just need to map link setting to link you want like

export const dxStudiesProviderWithCustomList = createDxStudiesProvider(
// here in `DEFAULT_STUDIES_LIST` function you can pass your localization for studies as an argument
DEFAULT_STUDIES_LIST()
.filter(study => listOfStudies.includes(study.id))
// like this for example
.map(s => {
s.link = `_link_to_your_resource_/${s.id}`
})
.map(fromRawStudiesSettings)
)

Then pass that newly created provider to dependencies.

reference — Studies — Configuring list of studies


Q245: All our chart data is in UTC. So, I would like to configure the chart to recognise this.​

Please can you advise how to configure this in our case? I have tried specifying it in dependencies like so: timezones: currentTimezone: "Etc/UTC", listOfTimezones: ["Etc/UTC"] } But that doesn’t seem to work. I’ve also tried specifying it under ChartSettingsDefaults: timezone: "Etc/UTC" But no luck. I have tried specifying it at just “UTC” as well.

A:

We store utc timezone identifier in a different format like UTC. So to make it work. So you can either specify it via props like timezone: 'UTC' or via dependencies

timezones: { currentTimezone: 'UTC' }

NOTE: UTC and Exchange are predefined and you cannot exclude them from the list. If you want to have only then in list of timezone then pass empty array to the listOfTimezones like

timezones: {
currentTimezone: 'UTC',
listOfTimezones: []
}

If you don't want to see timezone controls at all you can disable it via dependencies:

{
chartReactConfig: {
timezoneControls: {
enabled: false
}
}
}

reference — Timezones


Q246: There are certain typings that I can only import from the folder provided by the DX team.​

However, I want to export them from node_modules, but it doesn’t work. The reason is that I don’t want to include the files provided by the DX team in my build process. Instead, I want to reference all typings from the installed packages. Please guide on how to achieve. For example: Imported from a local folder—this works:

import { LogoProps } from 'packages/dxChart/dxchart5-react/dist/chart/ui-overrides/logo/Logo';

Imported from node_modules—this doesn’t work:

import { LogoProps } from 'dxchart/dxchart5-react/dist/chart/ui-overrides/logo/Logo';

Listing out few more imports which I am only able to import from local folder:

import { AggregationPeriod } from 'packages/dxChart/dxchart5-react/dist/chart/model/aggregation.model';
import { ChartCandleData } from 'packages/dxChart/dxchart5-react/dist/providers/chart-data-provider';

A:

in our project we use npm workspaces to managing multiple packages. I'm not completely sure I understand whole question, but looks like it will be enough to use correct packages naming with workspace and it should importing from node_modules in client's project, eg example above:

// somewhere in host-application code

import { LogoProps } from '@dx-private/dxchart5-react/dist/chart/ui-overrides/logo/Logo';
import { AggregationPeriod } from '@dx-private/dxchart5-react/dist/chart/model/aggregation.model';
import { ChartCandleData } from '@dx-private/dxchart5-react/dist/providers/chart-data-provider';

reference - ZIP file installation


Q247: After a break in internet connection or server connection, I now send the chart a completely fresh set of data (so that there are no gaps), and to do this I call the updateCallback provided by requestHistoryData.​

The update of the data on the chart seems to work fine. But the chart’s view of the data remains at the same time as before. For example, I load a 1-minute chart and the right-most bar is at 14:00. We have a break in internet connection for 3 hours, then it reconnects. The chart’s data gets updated, but is still showing up to a time of 14:00, and I have to manually scroll the chart from right to left in order to reveal the new candles from 14:00 to 17:00. Please can you let me know how we can programmatically reposition the chart’s view to show the end portion of data?

A:

For example, we can incapsulate this stuff in a class-manner like this:

class DxChartsDecorator {
charts = new Map(); // or just a single value if multi-chart not needed

onApiCreated(api) {
api.onChartCreated((chartId, chart) => {
this.charts.set(chartId, chart);
});
}

scrollToLastCandle(chartId) {
if (this.charts.has(chartId)) {
const chart = this.charts.get(chartId);
const { startUnit } = chart.chartModel.getLastVisualCandle();
chart.setXScale(startUnit);
}
}
}
...
// somewhere in the code
const myDxChart = new DxChartsDecorator();

...
<ChartReactApp
onApiCreated={myDxChart.onApiCreated.bind(myDxChart)}
/>
...
// somewhere in the code
myDxChart.scrollToLastCandle(1);

reference — Scaling — API axis range


Q248: We need a callback after calling setDrawing function, for example we are using the following code: chartRef.current?.drawings.setDrawing(symbol, custConfig).​

  • We need the callback once this function is done or the drawing has been formed.

A: chart-react, right now, not supported styling Events via its API, but you can configure it using chart-lite directly. Please read this article:

https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-lite/Events/Economic%20Events

chart instance can be obtained using chartReactAPI.onChartCreated callback.


Q249: We are facing this issue while setting the viewport for a particular AI Driven pattern.​

Issue: the viewport is shifting automatically to the default view after setting the viewport for a few milliseconds. Please try to help us in this issue as this is a production issue for us

A: turn off auto scale feature:

const dependencies: ChartAppDependencies = {

initialChartConfig: {

scale: {

auto: false,

},

},

};

reference — Scaling — API axis range


Q250: News bubbles are not customizable with an icon like the events are?​

A: Yes, now supported: set components.news.icon (normal and hover SVG strings) in the chart config

reference — News — Event icons, News — Custom icon example


Q251: Multiple events on the same candle or a timestamp doesn't show multiple icons​

Current Behaviour: multiple events get hovered one by one with each interaction on the same icon.

A: Correct. Can be improved in future after re-design this part.


Q252: Can we make events hovered line dashed? Also for the last price label line, can we make the line dashed?​

A: Yes for events hovered line use:

<ChartReactApp
dependencies={{
initialChartConfig: {
components: {
events: {
line: {
[eventType]: {
width: 1,
dash: [10, 10], // for dashed line
},
},
},
},
},
}}
/>

Not supported for last price label line.

reference - Components config - Events - line dash


Q253: Can we extend this list of supported events?​

earnings dividends splits conference calls

A: Unfortunately, still no, we can't. Full re-design of our providers planned in v6 only.

reference — Events Data Provider


Q254: Can we customize buy/sell Icons using svg or other formats like event icons?​

A: We can change only color of these icons right now


Q255: An extra call for the candles data is happening with the aggregation duration of 1 hour at requestHistoryData. There is no logic or code written for this particular call. What can be the issue? is it the default behaviour for a particular use case?​

  • start_time=1726004074642&end_time=1729604074642&interval=60minute
  • Required call: start_time=1728104074861&end_time=1729604074861&interval=5minute

A: There is no specific behavior coded to trigger a 1-hour aggregation period by default in requestHistoryData. If additional calls for data occur, they are likely due to the current layout or the X-axis position, which may require additional data chunks to ensure all necessary candles are displayed on the chart. However, these additional calls should align with the chosen aggregation period.

reference - Providers - Chart data provider


Q256: How can we set the default color for the color palette? currently that is set to yellow. Do we need to manually set the colors on whenever we need to call the drawing component?​

A: If questions about default color for color picker on drawing in drawing settings popover, when client can change it via palette config of ChartReactApp. Specific color variable called drawing-line-default-bg. Note: color should be in rgba format.

reference — Palette — Selective color overriding


Q257: My call to getLastVisualCandle() is now working and returning 1999 in my case, but there doesn’t appears to be a function chart.setXScale(). Please see below screenshot for further details.​

A: The best way (and even easier) will be:

chart.chartModel.doBasicScale();

Less manual work, shorter code.

reference - Scaling — Basic scale,Scaling — API axis range


Q258: About previous question "My call to getLastVisualCandle() is now working and returning 1999 in my case, but there doesn’t appears to be a function chart.setXScale().", the solution does not work on mobile (Samsung galaxy s9): It works in desktop mode, and in Chrome’s emulator for “Samsung Galaxy S8+” (I haven’t tried the other devices there). However, on my actual Samsung Galaxy S9, the chart does not move to the end – I still have to manually scroll it.​

A: Same as previous question.

reference - Scaling — Basic scale,Scaling — API axis range

Q259: SpreadCO send volume data to chart for equities, indices and commodities, but not for forex.​

In the legend data box they want to show the ‘volume’ field for those markets that have volume. On initial chart load they are achieving this as follows: Result:: If they then change the instrument (on the same chart instance) to a forex instrument, They would like to be able to tell the legend data box to not show the volume field for this instrument. Please would you advise how to do this? (The config setting only seems to apply to the initial value.)

A: If they wants to completely hide volume in cases when selected instrument hasn't volume value - right now it's not possible. Current behaviour is to show dash sign if value not provided for current instrument. There's no API to change this behaviour or set showVolume config property on-fly. Despite that now both library and widget supports UIOverrides to override any other component, but for legend - only Legend header can be overridden.

Q260: Please would you advise how we can change the formatting of the positions PnL amount?​

We only need to show 2 decimal places, and need to be able to change the currency symbol. Ideally, I need to display the above example as +£528.10.

A: Order price precision equals to instrument price precision which is used on Y-scale for instance. When you change price precision, order precision will be changed along with it.

reference — Price precision — Orders and positions


Q261: This is more a confirmation than a question:​

It’s not clear to me from the documentation how to save and restore various aspects of chart state, so I’m approaching you for your advice on how best to do this.

A: All current state of the chart can be saved/restored using LayoutProvider. If you select some instrument, aggregation period, adds some indicators or drawings to the chart or even to the multi-chart, and after that reloads the page, you'll see all your selections restored. This feature is implemented using the LayoutProvider and you don't need to manually listen/observe/subscribe to each specific part of the state of the chart - just implement LayoutProvider and work with whole state in one place.

reference — Layout Provider


How to obtain the current frequency (AggregationPeriod) from the chart How to obtain the data on the open studies with their config How to re-apply those studies (with their config) to the chart

A: Obtain current frequency (AggregationPeriod):

api.getChartInfo().period

Obtain studies with their config:

api.getChartgInfo().studies

Re-apply saved studies to a chart:

api.setStudies(studies)

(But please let me know if there is a better recommended way!)

reference — Supported APIs, Layout Provider


Q263: I do have one further question: Is there a way to know when a study has been added, or deleted, or a study’s config changed? I ask this because whenever such a thing happens, I need to re-save the current state to our server.​

A: You don't need to worry about it as well, because it also can be handled by LayoutProvider - its state already contains all currently applied studies. Check our example implementation for LocalStorage and implement the same approach but for you server-side API.

reference — Layout Provider


Q264: For observePositions(), I am calling its dataCallback and providing it with an array of Position obects to add to the chart. Am I expected to call dataCallback every time there is a change to the data in those positions, or should the charting library automatically pick up on changes to the data in the array initially provided?​

A: Yes, you can use dataCallback to set new positions array to the chart.

reference — Position Provider — Key methods


Q265: Executed order is showing a triangle for the order, but when hovering over the triangle, no label/bubble appears (but a dot appears on the chart canvas where perhaps the label/bubble should be)​

A: Ensure that tooltip functionality is correctly enabled for order markers. If you see a dot, this may indicate the label is positioned incorrectly, possibly due to alignment or styling settings. If that's not the case, another possibility is if by any means you had to remove or override the mb component, the label could be overwritten (but we believe that just the settings could be the cause).

reference — Order Provider — Order Execution


Q266: UpdateOrder() callback is not being called for take profit / stop loss amendments (i.e. after dragging)​

A: This is the current behavior, yes (a possibility would be for the event handling setup explicitly includes drag actions for take profit/stop loss orders).

reference — Order Provider — Protection Orders


Q267: Added take profit / stop loss orders remain on the chart even if our back-end has not confirmed these orders​

A: This should be made with implementation in orders-provider. To wait for confirmation before a TP/SL is created, subscribe to api.onProtectionOrderPlacementEnd and call confirm() / cancel()

reference — Trading — Confirmation popup before creating a protection order


Q268: Sometimes there are what seem to be z-index issues breaking interaction with position / order UI elements on the chart canvas, especially when there is more than one element (e.g. a position element, and an order element, or more than one position element)​

A: Potential bug as Z-index conflicts can occur with overlapping UI elements (under analysis)


Q269: Should there be a facility to edit / remove the existing stop loss / take profit of a position / order?​

A: Same as updateOrder() callback, I need to check as one of the requirements for an update on the trading component. I will keep you posted about it.

reference — Order Provider — Protection Orders, Trading — Stop loss and Take profit orders


Q270: It’s possible to add several Take Profits / Stop Losses to an order – is this by design? And if so, should there be an amount associated with each one?​

A: There's no specific configuration for the action as we cover on our library just the toolset, so it may depend on your trading implementation to configure the behavior for one or more than one take/stop.

reference — Trading — Stop loss and Take profit orders


Q271: I am calling dataCallback whenever the PnL of a position changes, so that the position PnL updates on the chart in real time.​

What I am finding, though, is that when I have several positions for an instrument, and I hover the mouse over the collapsed position UI in the chart to see all positions like this: …when the position price changes and dataCallback is called as a result, the UI redraws from scratch, resulting in a not-ideal user experience; sometimes the panel collapses down to the single view, but otherwise the redraw of all the positions is not instant. Is there any way to update the positions on the chart without it redrawing them like this?

A: There are no specific configurations to avoid the charts to keep redrawing like this, but a few options over the callback itself and the state management may help.

Debounce Updates: Implement a debounce or throttle mechanism on the dataCallback to limit the frequency of updates.

Selective Re-rendering: Instead of redrawing the entire position panel, see if there’s a way to update only the PnL values themselves. This would require modifying the dataCallback function to refresh only specific parts of the UI (such as PnL text) without affecting the entire position structure.

State Management Optimization: If possible, store and track each position’s state (expanded/collapsed) separately.

reference — Position Provider — Key methods


Q272: Would you please be able to advise how to default the amount fields to a value of our choosing?​

A: Set the initial value with chartReactConfig.trading.defaultOrderQuantity; change it at runtime with chartReactAPI.setTradingQuantity.

reference — Trading — Configuration for trading, Supported APIs


Q273: I’d like to understand if trading from the chart supports partial exits. For example, if I buy 100 lots, can I set a take profit divided into multiple parts? Do you have a simulation environment available for testing?​

A: This can be set up in your Order Provider or Position Provider. By a certain event that you can set up chart can start showing 50 lots instead of 100 lots in your open position.


Q274: What's the purpose of updateLayoutData function? Its not explained in the docs​

Also, there is already a function of updateLayout(which I use to sync layout data with MongoDB)so why the provider expect to get both?

A: updateLayoutData – this method is called every time the state of the selected chart changes (aggregation, selected instrument, timeframe, studies) so that this state is saved.

getLayouts – this method returns the saved state that was sent using updateLayoutData.

reference — Layout Provider — API reference


Q275: Do you have an example of using the Layout Provider?​

A: Yes, the Layout Provider page has an example that stores layouts in localStorage. A real implementation should be connected to your own persistence storage.

reference — Layout Provider — How it works


Q276: Executed order is showing a triangle for the order, but when hovering over the triangle, no label/bubble appears (but a dot appears on the chart canvas where perhaps the label/bubble should be).​

A: Ensure that tooltip functionality is correctly enabled for order markers. If you see a dot, this may indicate the label is positioned incorrectly, possibly due to alignment or styling settings. If that's not the case, another possibility is if by any means you had to remove or override the MB component, the label could be overwritten. Ensure settings are correctly applied. If this persists, it should be checked by QA and designer review.


Q277: updateOrder() callback is not being called for take profit/stop loss amendments (i.e., after dragging).​

A: This callback is called in two cases: 1) when drag from group is finished; 2) on drag stop but only if the order has a real ID provided by the order provider. There shouldn’t be differences in behavior between orders and protection orders.

reference — Order Provider — Key methods


Q278: Added take profit/stop loss orders remain on the chart even if our back-end has not confirmed these orders.​

A: This depends on the integration side. If the back-end does not confirm any order/position/etc., you can simply not apply them to the chart by removing them from the orders list in dataCallback. They will then disappear from the UI.

reference — Trading — Stop loss and Take profit orders, Trading — Confirmation popup before creating a protection order


Q279: Sometimes there seem to be z-index issues breaking interaction with position/order UI elements on the chart canvas, especially when there is more than one element (e.g., a position element and an order element, or more than one position element).​

A: It’s possible in some edge cases. Please provide exact steps to reproduce this, and our QA team will check these steps and create an issue based on the results. Creating a support ticket on our support board is recommended.


Q280: Should there be a facility to edit/remove the existing stop loss/take profit of a position/order?​

A: Since all data on orders and positions are in the corresponding providers under your control, you can do whatever you want with the list of orders/positions and apply these changes to the chart through dataCallback. The chart doesn't control this data; it just renders it and provides user controls.

reference — Order Provider — Protection Orders, Trading — Stop loss and Take profit orders


Q281: It’s possible to add several Take Profits/Stop Losses to an order – is this by design? And if so, should there be an amount associated with each one?​

A: It’s possible to do that on the integration level because the chart trusts the data provider and doesn’t check the applied data. However, on our latest version, you cannot add multiple Take Profits/Stop Losses to a single specific order via UI because the button disappears after adding the first

reference — Trading — Stop loss and Take profit orders


Q282: I am calling dataCallback whenever the PnL of a position changes, so that the position PnL updates on the chart in real time. Is there any way to update the positions on the chart without it redrawing them like this?​

A: No, right now this is the only way to do that, but it could be a good improvement for the future. Thanks for the suggestion!

reference — Position Provider — Key methods


Q283: When I make changes to the chart, I can see that LayoutProvider.updateLayout(chartLayoutWithId) is being called; in this function, I create a chartLayoutData object with a selectedLayoutId always set to “1” (as we only have one layout per instrument) and save it out to our back-end. Please can you tell me in what circumstances the updateLayoutData(ChartLayoutData) function is called by DXCharts, and how it differs from updateLayout()? Do I need to implement it for our use case?​

A: The main difference between updateLayoutData and updateLayout lies in the type of the function argument. updateLayout is used to update the data of a specific layout. In contrast, updateLayoutData can be used to store/update the full list of layouts and other top-level properties, such as theme and selectedLayoutId. Implementing it depends on whether you need to update the full layout data for your use case.

reference — Layout Provider — API reference


Q284: I have noticed that getLayouts() is being called more than once (in quick succession) when I load a chart. Why does this happen?​

A: The two calls are due to different purposes: one is for applying layout migrations, and the other is for the direct use of the final layout. If a layout migration is needed, you’ll see an additional updateLayout call during the initial chart loading.

reference — Layout Provider — API reference


Q285: How can we programmatically ask the charting library to load the layout for a new instrument when we change the instrument?​

A: This is not a common behavior for the chart. However, as a workaround, you can try using ChartReactSupportedAPI.syncLayoutParts to set the layout manually at runtime. This isn’t officially recommended but could be a good workaround.

reference — Supported APIs, Layout Provider — API reference


Q286: In the LayoutProvider implementation, when we open a chart for a particular instrument, we fetch a ChartLayoutData object from our back end containing only one layout (the default one). However, in our app's “quick-chart” mode, we change the market by calling chart.api.changeInstrument(newInstrument). How can we handle layouts for this scenario?​

A: You should have a dictionary of default/pre-defined layouts for each symbol on your server side. When changing the instrument, use ChartReactSupportedAPI.syncLayoutParts to set this pre-defined layout. Alternatively, we could explore adding an API method like generateLayout() to create a layout skeleton for customization. Let us know if this is a viable option for your case.

reference — Supported APIs, Layout Provider — API reference


Q287: Added take profit/stop loss orders remain on the chart even if our back-end has not confirmed these orders. Why does this happen?​

A: The chart employs an “optimistic UI” approach. When the user creates an item, it instantly appears on the UI, assuming a successful outcome. If the back-end does not confirm the item, you need to handle this fail state in your provider and call dataCallback to remove the failed item from the chart. This is designed for a seamless user experience.

reference — Trading — Stop loss and Take profit orders, Trading — Confirmation popup before creating a protection order


Q288: Is there a way to turn off the trade controls that display in the upper left of the chart? We would still want the user to be able to trade from the price axis.​

A: Yes: set showButtons and showQuantity to false in chartReactConfig.trading.legendOrderEntry. Trading from the price axis stays available (controlled separately by trading.yAxisOrderEntry.showAddButton).

reference — Trading — Configuration for trading


Q289: Do you have the ability to hide orders and positions on the chart while still displaying the trade controls?​

A: Yes. Turn off "Show orders" / "Show positions" in the Trading settings tab (chart settings trading.showOrders / trading.showPositions, e.g. via initialChartReactSettings.trading), or don't emit them from your Order / Position providers.

reference — Order Provider, Position Provider


Q290: The current date format is DDMMYYYY. Do we have the ability to change this to MMDDYYYY?​

A: To change the date format from DDMMYYYY to MMDDYYYY, you can configure the chart's date settings. This is typically done through the chart's configuration options, where you can specify the desired date format for display.

reference — Date format


Q291: Executed order shows a triangle but no label/bubble appears when hovering.​

A: Ensure tooltip functionality is enabled and correctly configured. Misalignment in the label or overridden MB components could cause this issue.


Q292: Z-index issues affecting interaction with position/order UI elements.​

A: Provide reproduction steps to QA for further investigation. Support tickets are encouraged for complex issues.


Q293: Can we hide orders and positions on the chart while keeping trade controls?​

A: Turn off trading.showOrders / trading.showPositions in chart settings (Trading tab), or don't emit them from your Order / Position providers.

reference — Order Provider, Position Provider


Q294: Callback for updateOrder() not triggered for take profit/stop loss amendments.​

A: Ensure the order has a real ID and verify the expected behavior when drag actions are completed.

reference — Order Provider — Key methods


Q295: Added take profit/stop loss orders persist without back-end confirmation.​

A: Use dataCallback to remove unconfirmed orders from the UI.

reference — Trading — Stop loss and Take profit orders, Trading — Confirmation popup before creating a protection order


Q296: Facility to edit/remove existing stop loss/take profit orders.​

A: Modify the dataCallback to update the list of orders/positions based on back-end updates.

reference — Order Provider — Protection Orders, Trading — Stop loss and Take profit orders


Q297: I have noticed that when calling api.changeInstrument(newInstrument), the callback SymbolSuggestProvider.onInstrumentChanged() is not called. I was wondering if this is by design or not.​

A: This is by design. These are two different functionalities, SymbolSuggest is component and it’s provider is part of searching for instrument component, not part of API. To listen for every instrument change, including api.changeInstrument, use api.onInstrumentChanged

reference — Symbol Suggest Provider — API reference, Supported APIs


Q298: I see the following WARNING in . /d×/dstudies-esm/kotlin-kotlin-stdlib-js-ir.mjs​

A: DXstudies build have a problem with source map generation, that's why one of the erros occurred during the build process. Temporary fix is added to your setup which is available under the link above. Reach out to DXcharts support team for solution


A: Before 5.15.0 this error might occur on React 19 (not supported then) and on some versions of React 18 https://github.com/facebook/react/issues/28947. Since 5.15.0, dxchart5-react supports React 18.2.0+ and React 19 (recommended). If it persists, reach out to DXcharts support team

reference — Quick start — React version requirements, Migration guide — React 19 migration


Q300: I see an error from using npx create-react-app​

A: It is known issue related to CRA https://github.com/facebook/create-react-app/issues/13721. If it is a blocker for you reach out to DXcharts support team for solution


Q301: Is there a way to off the trade controls that display in the upper left of the chart? We would still want the user to be able to trade from the price axis.​

A: You can use:

uiOverrides={{ Legend: { Header: () => null, } }}

this will remove OrderEntry compomnent from Legend. Alternatively, hide the buy/sell buttons and quantity with chartReactConfig.trading.legendOrderEntry (showButtons, showQuantity)

reference — Trading — Configuration for trading, UI overrides - Legend Header


Q302: Do you have the ability to hide orders and positions on the chart while still displaying the trade controls?​

A: yes, you can manage positions and orders state inside order-provider and position-provider https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/API%20Reference%20-%20Providers

see OrderProvider section:

observeOrders and observerExecutionOrders, that have to subscribed with ordersSubject

reference — Order Provider — Key methods


Q303: The current date format is DDMMYYYY. Do we have the ability to change this to MMDDYYYY?​

A: 3. Date time format can be changed. Described on this page https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-react/Date%20Format

Example for crosstool

crossTool: {

xAxisLabelFormat: [

{

format: 'YYYY-MM-dd',

showWhen:

{ periodMoreThen: 84600, }

,

},

{

format: 'YYYY-MM-dd HH:mm',

showWhen:

{ periodLessThen: 84600, periodMoreThen: 6, }

,

},

{

format: 'YYYY-MM-dd HH:mm:ss',

showWhen:

{ periodLessThen: 6, }

,

},

],

},

reference — Date format


Q304: Original question: Executed order is showing a triangle for the order, but when hovering over the triangle, no label/bubble appears (but a dot appears on the chart canvas where perhaps the label/bubble should be)​

Our answer: is there label or bubble in settings turned on? Ensure that tooltip functionality is correctly enabled for order markers. If you see a dot, this may indicate the label is positioned incorrectly, possibly due to alignment or styling settings. If that's not the case, another possibility is if by any means you had to remove or override the mb component, the label could be overwritten (but we believe that just the settings could be the cause). Reply: Here are my trading settings. (Please note my enableTrading variable is set to true.) Until today, I was seeing a dot whether displayMode was set to “labels” or “bubbles”. However, the “labels” option now appears to be working: …but the “bubbles” option still isn’t showing anything (other than the green triangle).

A: This may be a defect - added to the backlog for analysis and solution


Q305: Original question: Added take profit / stop loss orders remain on the chart even if our back end has not confirmed these orders​

Our answer: This should be made with implementation in orders-provider. Reply: I don’t understand what you mean here, so I think I need to explain this one in more detail. We use observeOrders() and observeExecutedOrders() to show these on the chart. When I add a new limit/stop order via the chart using the chart UI, currently we don’t yet pass this order ‘request’ to our system (as we are still in development), so, when I click on buy or sell on this UI: …it just disappears, as expected, as we don’t add a new order to the system, and therefore there is no new order to observe. However, if I have a position, like this: …and I click on it to show the options: …and here I click on “Add Take Profit” and drag it somewhere: …once I have finished dragging, DXCharts calls the createOrder() callback where eventually I will ask our app to actually create an order (that can be observed) but for now only does this: …I am expecting that as our app is not creating an order (until I implement that), the “Take Profit” UI will disappear as there is nothing new to observe. Instead, it stays on the chart (until I reload the app), implying that there is a take profit order there. I have tried returning Promise.resolve(null), Promise.resolve(), and Promise.reject(), all with the same result. A related question is: once I have implemented creating the order in our app, what should I return if order creation has failed?

A: Actually, there's no any feedback loop between current UI state of trading items and provider's state (which represents actually created orders/positions in your app). Another words, when chart calling provider.createOrder() methods returned value is not taken in further logic. Chart just notifies the providers code about new item was created by the user and appears in UI. We suppose, that if something goes wrong and actual order won't be created in your system than you'll receive and process this fail state in your provider and call dataCallback to provide actual state to the chart, without failed item. It's some kind of optimistic UI approach, I would say. When we're giving quick UI feedback to the user (item is appears instantly, hoping for a successful outcome, but if something goes wrong we fallback these UI changes.

reference — Order Provider — Key methods, Trading — Confirmation popup before creating a protection order


Q306: Original question:​

It’s possible to add several Take Profits / Stop Losses to an order – is this by design? And if so, should there be an amount associated with each one? Our answer: We don't have a specific configuration for the action as we cover on our library just the toolset, so it may depend on your trading implementation to configure the behavior for one or more than one take/stop. Reply: Okay. Will we be able to limit the number of take profits / stop losses (that can be added via the chart) to just 1 (i.e. per order), for example? Currently our trading platform does not support multiple take profits / stop losses on an order.

A: Yes, you can check our demo https://dxcharts-demo.konak.in.devexperts.com/ - you won't be able to create multiple tp/sl orders for a each single order, because the button just disappeared after first is created.

reference — Trading — Stop loss and Take profit orders


Q307: Original question:​

How can we, at that point, programmatically ask the charting library to load the layout for that new instrument? When first opening a chart, the library calls LayoutProvider.getLayouts() and we provide it with the layout for that instrument via Promise.resolve(). So for example, is there any way to cause getLayouts() to ask for a layout when we change the instrument? Our answer: Actually, this is not very common behaviour for our chart and if we formally answer a specific question, then no, there's no way to cause getLayout() to ask a layout when instrument has changed. But as a workaround you can try to use ChartReactSupportedAPI.syncLayoutParts to set layout manually in runtime. I'm not absolutely sure it would help you to do what you needed, but it's a good chance to try to do that. Disclaimer: it's not an officially recommended way for such things. Reply: Thank you for your suggestion; I have been having a think about this, and I don’t think this workaround is going to work for us. This is because we rely on DXCharts’ call of LayoutProvider.createLayout() to provide us with a “chartLayoutNamed” default layout object for an instrument, from which we create a chartLayoutWithId and then from this a chartLayoutData object that we save to our back-end so that an instrument has a stored default layout. Currently createLayout() is called by DXCharts when in getLayouts() we return Promise.reject() when there is no stored layout for an instrument. And of course, this relies on getLayouts() being called in the first place. So, in our case, when we set a new instrument on the chart instance, it would be okay only if our back end already has a stored layout for that instrument for that user – then we could try calling syncLayoutParts() off the back of that. But if there is no stored layout, we have no way (that I know of) of creating a default layout for this newly selected instrument (as createLayout() would normally provide us, and as required by a call to syncLayoutParts()).

A: Probably, in you case, you should have some dictionary of default/pre-defined layouts for each symbol on your server side. After, you'll be able to try to set this pre-defined layout using ChartReactSupportedAPI.syncLayoutParts(). But yea, personally, I think it will be too complicated to handle it. We may think about how we can help to solve your case with additional API. Probably, we can add something like generateLayout() method to create and return some layout "skeleton" and after that you'll be able manipulate it as you needed. WDYT?

reference — Supported APIs, Layout Provider — API reference


Q308: In our mini-chart, we have drop-down menus for Aggregation and Date Range, but we are not validating the combinations thereof, so the user is able to select invalid combinations. I'm noticing on the main chart component, the Date Range and Aggregation sliders only allow certain combinations - how can I get a map of the acceptable combinations?​

I am working on this mini-chart, where we implement our own controls for selecting aggregation and date range. I need to validate the inputs on my component to only allow valid combinations the logic I need to replicate is in timeframe-and-aggregation-selector but I only have the minified version

A: This is a very deep logic and it is not related only to timeframe-and-aggregation-selector component. To partially control this logic for our built-in UI elements from outside, we've introduced a special method that allows you to add rules for aggregation periods: ChartReactSupportedAPI.setAggregationRestrictionRule. However, since you want to create your own UI elements, than there's no official way to use these things, but you can try to use these functions (is not an official api, can be changed at any version):

import { DEFAULT_TIMEFRAME_PRESET, DEFAULT_AGGREGATION_TIMEFRAME_RULE, timeframePeriods, getTimeframeBasedOnPeriod, timeframePeriods, } from '@dx-private/dxchart5-react/dist/chart/model/timeframe-presets.model';

reference — Supported APIs


Q309: Is there a way to change price label style?​

A: There is a way to add new and update existing price labels, inside of the object there is field labelType: 'badge'. Following options are available: badge, rectangle, plain. Detail about y axis labels available here https://devexperts.com/dxcharts/documentation-for-developers/dxcharts-lite/Label-providers/create-y-labels-provider

reference — Y-axis — Price label types, Create Y-labels provider


Q310: When I add DXscript as a dependency to DXcharts it get stuck in an infinite loop​

A: DXscript doesn't support mock provider for now. LayoutProvider can be implemented like in this article but in real application it should be custom and connected to project-specific persistence storage. Example how to use it:

<ChartReactApp dependencies={{ // other providers layoutProvider: createLocalStorageLayoutProvider('dxchartLayout'), dxScriptProvider: createDxScriptDemoProvider({ endpointUrl: 'https://dxcharts-demo.konak.in.devexperts.com/api/script', }), dxScriptRunner: createDxScriptRunner({ endpointUrl: 'https://dxcharts-demo.konak.in.devexperts.com/api/script' }), }}/>

reference — DxScript integration, Layout Provider — How it works


Q311: We’d like to be able to set our own text for interfaces and buttons on the chart, is this possible?​

A: Yes, via the localization functionality: pass your own strings through dependencies.localization on ChartReactApp (or the localization option of createWidget).

reference — Localization — Custom localization, Localization — Default localization strings


Q312: On your demo chart at https://devexperts.com/dxcharts-demo/, when I create or modify a Take Profit / Stop Loss order, the UI element shows and updates the price while dragging​

A: Yes, this is controlled by chartReactConfig.trading.showPriceAsLabels. With false (the default) the price is shown as text on the order line and updates while you drag it. With true the order price is shown as a Y-axis label instead.

reference — Trading — Configuration for trading


Q313: how can I override the UI based on a different chart or chartId.​

A: The Legend component is shared by all charts in a multichart layout, so it isn't tied to one chart. In your custom Legend component (via uiOverrides), use chartReactAPI.getSelectedChartId(), or subscribe with chartReactAPI.onChartSelected(chartId => ...), and switch what the component shows for the selected chart.

reference — Multichart, Overriding the Legend header, Supported APIs


Q314: Getting an error while synchronizing the crosshair across multichart, other syncs are working. Attached screenshot for your reference. Please help us resolve this issue.​

A:

One chartReactAPI instance controls all charts in a multichart layout. Methods that can target one chart take an optional chartId argument; without it, they apply to every chart. Chart ids are strings: '0' is the first chart.

You don't create chartReactAPI yourself: the chart creates it and passes it to onApiCreated:

const onApiCreated = (chartReactAPI: ChartReactAPI) => {
chartReactAPI.changeInstrument('AAPL'); // change the instrument in all charts
chartReactAPI.changeInstrument('AAPL', '0'); // change the instrument only in the first chart
};
...
<ChartReactApp onApiCreated={onApiCreated} />

onApiCreated is called again whenever the multichart layout changes (for example, from 2 charts to 2×2), because the API is re-created to control the new set of charts. Run your API setup again in that callback.

Crosshair is one of the multichart synchronization options, next to symbol, chart type, timeframe, appearance, indicators and drawings. If you still get the crosshair sync error, contact DXcharts support with the console error and your chart version. To customize the shared Legend per chart, see Q313.

reference — Multichart — Synchronization options, Supported APIs


Q315: We are facing an issue with trend line and other drawing interaction on mobile apps where the taps get drawn on the same point resulting in a point size (hardly visible) drawing.​

Please help us resolve this issue as it is a critical interaction. Attaching video for your reference. Screenrecorder-2025-02-24-12-16-49-91 (1).mp4

A: This was a defect in how drawings are created in adaptive (mobile) mode. It was fixed in 5.14.1.


Please help in unblocking. DxScript is now working and we are able to add custom indicators coming from DxScript BE, although dxScript is sending api calls on every tick which we cannot productionize (as mentioned by you guys as well). Ideally it should calculate based on the aggregation level selected by the user, 1min, 5 min , etc and api call should go only at these intervals. Let us know, how soon can you fix this issue and create a productionize version, as we are stuck on many indicators and its impacting our users heavily.

A: What exactly doesn't work properly? The second screenshot looks correct: the chart is shown, and the selected dxScript indicator is displayed above the main chart series. There isn't enough information to tell what is wrong. In the previous case, the problem was an error in the console that stopped the chart from working, and adding a layout provider solved it.

reference — DxScript integration, Layout Provider


Code got stuck in an infinite loop, after adding dxscript dependencies.. Please check this Video. Screen Recording 2025-02-07 at 4.04.24 PM (1).mov Charts team have provided a Trial build with DXscript provider looking into charts backend (that's the typical way of providing trials of DXscript)

A:

Use a real LayoutProvider together with the dxScript providers, not the mock one: the mock layout provider doesn't work correctly with dxScript. In a real application the LayoutProvider should be your own implementation, connected to your persistence storage. For a quick test you can use the localStorage implementation:

<ChartReactApp dependencies={{
// other providers
layoutProvider: createLocalStorageLayoutProvider('dxchartLayout'),
dxScriptProvider: createDxScriptDemoProvider({
endpointUrl: 'https://<your-dxscript-backend>/api/script',
}),
dxScriptRunner: createDxScriptRunner({ endpointUrl: 'https://<your-dxscript-backend>/api/script' }),
}}/>

reference — DxScript integration, Layout Provider


Q318: 1. Is there any way we can configure the default colors of the indicators on the chart?​

  1. Can we give spaces/margin between volume bars? PFA required design image!

A: 1. Yes. The default indicator colors are part of the list of built-in indicators your dxStudiesProvider is created from: DEFAULT_STUDIES_LIST(studiesDictionary, palette) sets each indicator line's colors from the palette's indicator-* tokens. To change the defaults, build that list with your own palette (or edit lines[].colors in the result) and pass it to createDxStudiesProvider, the same way the Localization page builds it to rename built-in indicators. Colors that users change in the indicator settings are saved in the layout, so they persist through your LayoutProvider.

  1. No. Each volume bar fills the full width of its candle slot, and there's no setting for a gap between bars. For a different look, hide the built-in volumes (components.volumes.visible: false in the chart config) and draw them yourself with a custom drawer.

reference — Localization — Renaming built-in indicators, Studies, Layout Provider, Chart configuration, Custom drawer


Q319: Regarding an old issue, we have asked you about the default color of the palette for all the drawings and you answered that setting drawing-line-default-bg with an rgba format value can solve the problem.​

This isn't working as expected. Also the theme property in initialChartConfig also doesn't have such an option. Please provide some insights for this issue as we are also targeting theming changes for our next release. Please find attached the code snippet we are using and a snapshot of the chart for your reference.

A: New drawings take their default colors from drawingsConfig, not from the palette. The default drawingsConfig is built from the built-in palettes, so overriding the palette tokens that feed the default drawing styles (such as drawing-line and drawing-fill) in dependencies.palette doesn't change the colors of new drawings. There's also no drawing-line-default-bg token. Pass your own themed drawingsConfig in dependencies instead. You can build one from palette colors with getDefaultDrawingsConfig().

reference — Configuring drawings — Default drawing colors, Palette — Selective color overriding


Q320: "Facing a severe issue, despite changing the duration type for the aggregation, candles fromTime are not getting changed for different types of candle intervals.Like for 1min, 2min or 5min candles, we are getting the same time stamp for fromTime. similarly for 1day and 1week. Also the fromTime timestamp is too close for the candle aggregation resulting in very few candles in the start"​

A: This is expected. The fromTime argument only indicates the left bound of the requested range. It isn't directly related to the aggregation, so it can be the same for different aggregations at the same position on the timeline. To load the correct set of candles, use both the aggregation period and the time bounds (fromTime/toTime). In some cases toTime is empty, which means "now" (Date.now()), and fromTime can be empty in the initial request: then you decide how many candles to return.

reference — Chart Data Provider — fromTime, Chart Data Provider — toTime


Q321: I didn't understand the usage of TradingSessionsProvider. According to your previous response in this:​

The vwap field in the ChartCandleData interface is available to be used by the chart, but the chart doesn't calculate VWAP by itself. Instead, the VWAP value must come from your data source (like dxFeed) or be calculated within the data provider that you're using. In your case, if your data source provides VWAP directly, you can use it as-is. If not, you will need to calculate VWAP internally and pass the calculated value to the chart.

  • We are already providing calculated vwap values to the chart data. Then where is the use of TradingSessions ? And if yes, could you please state with proper example, since in documentation it's not clear. Currently our Trading Sessions are not managed on frontend it is managed by our BE data provider itself, therefore not point in creating one on FE. Please help us in finding a middle way here to fix vwap asap.

A: The earlier statement quoted above is not accurate. The library calculates the built-in VWAP indicator itself, from your candles: it uses typicalPrice when you provide it, otherwise (high + low + close) / 3, together with volume. The vwap field of ChartCandleData is deprecated and isn't used by the built-in VWAP indicator.

VWAP restarts at every trading session. On intraday aggregations, the session boundaries come from TradingSessionsProvider, so VWAP needs one even when your back end manages sessions: implement it to return your sessions for the requested period. On daily and longer aggregations, each candle is treated as a session.

reference — Trading Sessions Provider — VWAP, Chart Data Provider


Q322: Regarding vwap, since vwap is also another type of indicator, why do you want vwap value inside ChartCandleData and how should we get it ? It should be calculated by the library itself just like other indicators, same is being calculated by trading view itself. As charting library consumers, we should just provide ohlc and volume data to the candles data and indicator logic should be on the library.​

Also, we tried adding vwap values by creating the logic and adding it in candles data by code, but still it is not applied. You can check our code and candles data that we are passing to DX in the below screenshots. Please help in exactly what all keys are required in adding this. indicator, this is highly critical for our users. Kindly check the code we are using to add vwap indicator. Also, if this can be out of the box, that would be great.

A: VWAP is calculated by the library, like the other built-in indicators: OHLC and volume are enough, and you don't need to put VWAP values into ChartCandleData (the vwap field is deprecated and isn't used by the built-in VWAP indicator). If VWAP doesn't plot, check that your TradingSessionsProvider returns sessions for the requested period: on intraday aggregations VWAP needs them. See Q321.

reference — Trading Sessions Provider — VWAP, Provider setup examples


Q323: We have checked that TV has the same behavior:​

Drawings on Chart Synchronization When synchronization is enabled, all drawings are correctly synced across charts, which works as expected. However, when synchronization is turned off and we attempt to delete a drawing in one of the containers, the drawings are removed from all charts, despite synchronization being disabled. This does not seem to be the correct behavior. Please advise. Test with Different Sync States • Test drawing deletion with sync enabled and disabled to confirm that: o With sync enabled, deletions apply to all charts. o With sync disabled, deletions apply only to the specific chart instance. It seems it does not work so in the dxChart lin 5.13.x

A: 1. The attached video shows the same behavior in DXcharts and TradingView, so this works as intended.

  1. A drawing keeps the sync state it was created with. Drawings added while sync was on stay synced across charts after you turn sync off in the interface. This is not a bug.

reference — Multichart — Synchronization options


Q324: Selected drawing tools get deselected when JavaScript code adds drawings​

To reproduce * Run the demo with yarn install and yarn run dev and open the link in the browser Select any drawing tool on the side Before you can draw anything it will get deselected This is happening when our JavaScript code is adding drawings. When new drawings are added, the selection of drawing tools are reset. This is making it impossible for us to draw anything as price line gets updates every few seconds [^dx-testing.zip]

A: This was a defect: drawings.removeDrawing() also reset the drawing tool the user had selected. It was fixed in 5.14.2.

Drawings aren't the best way to show Ask/Bid prices or order positions anyway: users can move and restyle them from the toolbar that appears when they click a drawing. For lines on the price axis, use a Y-axis labels provider instead. DXcharts also shows Bid/Ask prices out of the box, and has built-in trading that creates and displays orders and positions. If you tell us more about what you're trying to achieve, we can suggest the best tool for it.

reference — Y-labels, Y-Axis Price Labels, Trading


Q325: We haven’t explicitly configured any layout or user providers—we’ve just been using the out-of-the-box settings, and everything worked properly in the previous version.​

Could you let us know how to obtain or generate the current provider JSON so that we can share it with you?

A: Without your own LayoutProvider and UserDataProvider, the chart uses built-in mock implementations that don't store anything between page loads, so there is no stored JSON to share. If you use the localStorage implementations from the docs, open the browser developer tools and find the data under Local Storage.

reference — Layout Provider, User Data Provider


Could you confirm if this change is expected or if we need to adjust any settings? Here is the dxChart version we are using "@dx-private/dxchart5-react": "5.13.4", "@dx-private/dxstudies": "53.0.0-esm",

A: If you mean the aggregation period dropdown: nothing changed there in 5.13.4. The list of periods comes from dependencies.initialAggregationPeriods, and periods added by the user are stored by your UserDataProvider (in customPeriods). Check what you pass there, and which version you upgraded from.

reference — API Reference - Configuration, User Data Provider


Q327: Error:​

Failed to create studies webworker Error: Workers disabled
at createDxStudiesWebWorkerProvider (dx-studies-webworker-provider.js:6:585)
...

A: "Failed to create studies webworker Error: Workers disabled" is expected when workers are turned off (chartReactConfig.disableWorkers: true); indicators are then calculated on the main thread. See Q359 and Q360.

The error that came with it, TypeError: Cannot read properties of undefined (reading 'com') in dx-studies-studies-data-provider, was caused by the ESM build of dxStudies, whose exports didn't match the older build. It was fixed in 5.13.4.

reference — Bundling


Q328: Listening to Changes in Drawings​

We would like to listen to events triggered by changes in drawings, specifically for horizontal rays (drawing type: horizontal_ray). For example, when users drag position lines representing stop-loss or take-profit boundaries, we need to capture these events. How can we set up a listener for such interactions to dynamically update these values? Also are the horizontal lines draggable?

A:

There's no dedicated callback in ChartReactAPI for this, but the DrawingsComponent (chart.drawings) has observables you can subscribe to. Get chart from chartReactAPI.onChartCreated:

const { unsubscribe } = chart.drawings.observeDrawingMoved().subscribe(drawing => { ... });
const { unsubscribe } = chart.drawings.observeDrawingFinished().subscribe(drawing => { ... });
// the same for
// observeDrawingRemoved
// observeDrawingsUpdated
// observeDrawingModified

observeDrawingMoved, observeDrawingFinished and observeDrawingModified give you one drawing (the last two can also give null, so check it). observeDrawingRemoved and observeDrawingsUpdated give arrays of drawings. A drawing has a type (for example horizontal_ray) and keyPoints, each with a timestamp and a price value. Yes, horizontal lines and rays can be dragged, unless they are locked.

reference — Accessing DrawingsComponent from DXcharts React — Listening to drawing changes


Q329: Duplicate Callbacks for Historical Data Fetching​

Occasionally, the chart makes two identical callbacks for fetching historical time series data. The only difference between the requests is that the option.priceType changes from 'last' to 'mark'. Both requests are for the same symbol and date range. Is this expected behavior? Interestingly, this behavior is not consistent across all tradable symbols. Could you clarify why this might be happening? Data Type Switching Notification From time to time, the chart displays a message stating: "The type of data has been switched: Last → Market." However, this does not occur consistently when switching between trading instruments or symbols. There is no documentation explaining this behavior. Could you elaborate on what this message means and under what conditions it is triggered?

A: Yes, this is expected. With chartReactConfig.autoApplyPriceType enabled (the default), the chart picks the price type from the instrument type. For a FOREX instrument it switches from last to mark (when mark is available); for stocks and crypto it switches back to last. Each switch shows the "The type of data has been switched" notification and requests history again with the new priceType. That's why it happens only for some symbols: it depends on the type your SymbolSuggestProvider returns for the instrument. Set autoApplyPriceType: false to keep the price type the user selected. See also Q362.

reference — Symbol Suggest Provider, API Reference - Configuration


Q330: Listening to Graph Events​

Is there a way to listen to specific events in the graph, such as when historical candlestick data has finished rendering? This would help us manage other operations dependent on graph readiness.

A: Subscribe to chart.data.observeCandlesChanged(): it emits when the candles in the chart change, for example after history is loaded. Get chart from chartReactAPI.onChartCreated. There's no separate "rendering finished" event.

reference — Supported APIs, Scaling — API axis range


Q331: API for Checking Current Graph Data​

Is there an API to check what data is currently available inside the graph? Like can I get all the candle stick values inside the current chart. For instance, if a data disconnection occurs, we would prefer to reload only the missing candles instead of re-rendering the entire graph. Is it possible to achieve this, or does the graph need to be fully reloaded after reconnection?

A:

The candles currently in the chart are in chart.chartModel.mainCandleSeries.dataPoints. After a reconnect you don't need to reload everything: send only the missing candles with chart.updateData(), which updates the chart without resetting the existing data. chart.setData() replaces all data. Both take candles in the chart's own Candle format (timestamp, open, hi, lo, close, volume), not ChartCandleData. These calls go to the chart directly, bypassing DXcharts React's data flow.

To get the chart instance, use the chartReactAPI.onChartCreated callback first.

reference — Chart Data Provider, Data series


Q332: We have implemented the dxStudies (new build and old build) based on the documentation using Vite, keeping the setup minimal. Unfortunately, we encountered the same problem with dxStudies.​

It shows the indicators to be selected in the graph, however nothing is drawn in the indicator section. Here is the link for the minimal implementation. Please replace the dxCharts distribution files in the relevant folder (inside dxchart.lib) to review our setup. We would appreciate any guidance or recommendations you might have to resolve this issue, as this have turned into a blocker for now"

A:

Even a minimal implementation needs the mandatory providers. Studies are calculated from candle data, so without a ChartDataProvider there is nothing to calculate them on. Also, the code limits the list of available studies to three ('Aroon', 'SROC', 'MACD'); without that limit, all available studies appear in the list. Please share a more complete implementation, with all mandatory providers, if the problem remains.

Since DXcharts React 5.17.1, web workers work with Vite without extra setup. On older versions, Vite has issues with web workers, so disable them:

<div className="App" style={{ height: 576, width: 800 }}>
<ChartReactApp dependencies={{
...
chartReactConfig: { disableWorkers: true },
}} />
</div>

reference — Bundling — Vite, Bundling — Older versions (before v5.17.1), Getting started with providers


Q333: When creating financial indicators. dxStudies module isn't available: TypeError: Cannot read properties of undefined (reading 'kotlin-kotlin-stdlib-js-ir') << Here is the problem, according to documentation we have followed.​

However in production build, the above file is missing.

A: 1) check that @dx-private/dxstudies package is a direct dependency in the project.

  1. check that the dxStudies module files (@dx-private/dxstudies/dxstudies.js, and for older ESM builds also @dx-private/dxstudies/kotlin-kotlin-stdlib-js-ir.js) are available to import, and that the path or module name resolves correctly in your bundler/build system.

  2. check that bundler/build system supports ES6 imports and ES6 dynamic imports

Current dxStudies packages ship as a single module (dxstudies.js / dxstudies.mjs).

reference — Bundling, Packages


Q334: The graph does not load in normal mode, but works in incognito (because ad blocker is not installed there).​

I think this is the root cause. DXChart is making a call to firebase_anallytics. This is blocked by the Add blocker. because when I disable add blocker the site works as expected. Graph In Normal mode Graph in Incognito mode I think this is the root cause. DXChart is making a call to firebase_anallytics. This is blocked by the Add blocker. because when I disable add blocker the site works as expected.

A: Analytics (Firebase) is turned on or off when the DXcharts React package is built, not in the chart config. A build with analytics disabled doesn't call Firebase at all. Contact DXcharts support to get a build with analytics disabled; it's also the quickest way to confirm that the ad blocker is the cause.


Q335: Regarding YAxisLabelsProvider.​

I have tried it to show bid and ask lines. I am unregistering and registering new provider every time price changes. Is that the right way to do it to respond to changing prices? What do you think of the code. function updateYLabels(bidPrice: number, askPrice: number) { if (!chartRef.current) { return; } console.log('Updating Y labels', bidPrice, askPrice); const bidLabel: VisualYAxisLabel = { y: bidPrice, labelText: 'Bid: ' + bidPrice.toFixed(4), mode: 'line-label', bgColor: 'red', textColor: 'white' }; const askLabel: VisualYAxisLabel = { y: askPrice, labelText: 'Ask: ' + askPrice.toFixed(4), mode: 'line-label', bgColor: 'green', textColor: 'white' }; const labelGroup: LabelGroup = { labels: [ askLabel, bidLabel, ] }; const yLabelsProvider: YAxisLabelsProvider = { getUnorderedLabels() { return [ labelGroup ] } } if (yLabelsProviderIdRef.current !== '') { chartRef.current?.yAxis.unregisterYAxisLabelsProvider('latest', yLabelsProviderIdRef.current); } const id = chartRef.current?.yAxis.registerYAxisLabelsProvider(yLabelsProvider, 'latest'); yLabelsProviderIdRef.current = id; // chartRef.current.yAxis.deleteSimpleYAxisLabel('bid'); // chartRef.current.yAxis.deleteSimpleYAxisLabel('ask'); // chartRef.current.yAxis.addSimpleYAxisLabel('bid2', bidLabel); // chartRef.current.yAxis.addSimpleYAxisLabel('ask2', askLabel); } There are issues with this. The lines are not in the right place and only one of the two lines is shown.

A: You don't need a custom labels provider for this: Bid and Ask lines are built in. Send the bid and ask prices as service data from your ChartDataProvider (subscribeServiceData, fields bid and ask). Once the chart receives them, the Bid/Ask option appears in the Y-axis right-click menu, and you can set its display mode in the chart config.

reference — Y-Axis Price Labels, Chart Data Provider


Q336: I am implementing min / max trade size using dependencies.chartReactConfig.trading.defaultOrderQuantity (for min trade size) and .maxOrderQuantity (for max trade size).This works fine for initial chart load, but I need to be able to set these values dynamically when I change instrument on the chart instance. I can see that you have api.setTradingQuantity(), but nothing like api.setMinTradingQuantity() or api.setMaxTradingQuantity(). Can I achieve this in some other way at the moment?​

A: Yes. Call chartReactAPI.setTradingMaxQuantity(max, chartId?) and chartReactAPI.setTradingMinQuantity(min, chartId?), for example when the instrument changes. To set the initial limits, use initialChartReactSettings.trading.minQuantity and maxQuantity (and quantity / quantityStep for the default quantity and step): the order entry reads them from there, so the chartReactConfig.trading values are not applied. The minimum can't be above the maximum, so when you move the range, set the two in an order that keeps min ≤ max. Set the current quantity with setTradingQuantity(), and listen to changes with onOrderEntryQuantityChanged, onMinOrderQuantityChanged and onMaxOrderQuantityChanged.

On versions before these setters, the limits can only be set at startup.

reference — Trading — Configuration for trading, Supported APIs


Q337: This is just something I noticed and am sharing for your info, as we might not use this functionality anyway: I noticed that the onPositionDblClick callback is not being called when I double click on a position label.All the other callbacks in the screenshot below work.​

A: onPositionDblClick was added in 5.13.5. In earlier versions it isn't called; update to 5.13.5 or later.

reference — Supported APIs


Q338: Regarding our suggestion / request for additional callbacks, the main reason we’re asking for these callbacks is that, as things stand, the user actions I listed happen entirely within the chart and remain invisible to our application until the action finishes. That means we have no way to “mirror” those interactions in our UI or ticket system as they happen.​

I’m open to exploring an override (if that’s feasible with the plain JS version of the library?), but are there recommended best practices for capturing these interactions without adding more callbacks to your core API?

A: chartReactAPI has callbacks that track an order while it's being dragged, independent of the UI: onOrderDragStart, onOrderDragTick (called as the order moves, with the order at its new price) and onOrderDragEnd. They let you mirror the price change in your own UI or ticket as it happens.

reference — Trading — Order click and drag callbacks


For take profit / stop loss, i.e.: “Add take profit” / “Add stop loss” start (this would be triggered when the user has clicked on the position or order UI element to show the “Add take profit” / “Add stop loss” label and has also clicked on one of those so that the ‘drag’ (without left mouse click in this case) can start, but before moving the mouse “Add take profit” / “Add stop loss” move (or ‘during’, or ‘change’) (this would follow the start callback whenever the user moves the UI element and before they click the left mouse button to set it; we would like to see the price level passed to the callback function so that we can mirror it in our trade ticket) “Add take profit” / “Add stop loss” end (this would happen once the user has clicked the left mouse button to set it) For LMT / STP order drag-start (we could then use this to, for example, display our trade ticket in preparation for updates to the values on the ticket while the chart UI element is being dragged) drag-during drag-end (although we can probably use the existing updateOrder callback to determine drag-end otherwise) These are just ideas for the callbacks, of course, but in summary, it would be useful for us to know when these things start happening, are in the process of happening, and stop happening (along with related values) so that we can hook the rest of our UI into them and make it dynamic.

A: Some of these are available now:

  • LMT / STP order drag: onOrderDragStart, onOrderDragTick (with the order at its new price) and onOrderDragEnd.
  • Take profit / stop loss placement end: onProtectionOrderPlacementEnd. If you subscribe to it, the protection order isn't created until your callback calls confirm() (or cancel() to abort).

On desktop there are no start and move callbacks for TP/SL placement. On touch devices, where the new protection order is dragged, onOrderDragStart and onOrderDragTick also fire during placement. When you need full control over these interactions, we recommend building your own trading UI via an override.

reference — Trading — Order click and drag callbacks, Trading — Confirmation popup before creating a protection order, Trading — Custom trading UI


Q340: Background: As your library’s observePositions / observeOrders data callback functions expect the full set of positions / orders when called, this is what we do whenever market price updates happen, but in reality there are a variety of different reasons that we would want to (and do) send the current set of positions / orders to the chart, depending on what our back-end is telling us about the state of the positions / orders.​

The issue: I have noticed that when we start dragging an order on the chart, if our app sends the chart the updated set of orders as part of one of the various updates it might be doing, the chart redraws the being-dragged order UI element back at its current price. I have attached a video showing what I mean. I appreciate that we could avoid re-sending the orders to the chart if it’s just a market price update, as the current price is not related to the order and is not shown by the order UI element – but as I mentioned, there are various other reasons we might need to refresh the orders on the chart from time to time.

A: To avoid the dragged order jumping back, don't send a new set of orders to the chart while the user is dragging one. You can tell when a drag starts with chartReactAPI.onOrderDragStart, and pause your order updates then. onOrderDragEnd is called when the order is dropped at a new price, but not when the drag ends at the original position, or when a new Take Profit / Stop Loss is being placed. So don't rely on it alone to resume your updates: also resume after a short timeout. If you still see the jump on a recent version with updates paused, contact DXcharts support with a recording.

observePositions / observeOrders expect the full set of positions / orders on each call; many integrations rely on this contract.

reference — Trading — Supplying orders & positions to chart, Trading — Order click and drag callbacks


Q341: I’ve noticed on the shortcut menu on our chart that market orders are showing a zero price:​

On your demo chart at https://devexperts.com/dxcharts-demo, a price sometimes shows on the shortcut menu for market orders, but sometimes is zero. E.g. if it’s showing AAPL and I show the shortcut menu, there are figures there. If I then change the market to USD/CHF, the shortcut menu figures seem to be the same as the AAPL ones, and if I then refresh the page (still on USD/CHF), the shortcut menu figures show as zero. On https://devexperts.com/dxcharts-demo/trading-platform, a price on the shortcut menu for market orders always shows, but both figures are the same (the SELL price, I believe). Going back to our chart: When I select one of buy market / sell market, a price does come through in the limitPrice and stopPrice fields: …but this is the price showing on the “order menu” (right-hand-side axis) when the shortcut menu was opened. Being a market order (orderType: “market”), am I correct in saying that it’s expected that we will simply ignore the limitPrice and stopPrice fields, as our system will fill this order at whatever the current price is?

A: Yes. For an order with orderType: 'market', fill it on your side at the current market price and ignore limitPrice / stopPrice. The chart still fills those two fields: before 5.20.3, a market order created from the right-click menu carried the price under the cursor; since 5.20.3 a market order carries the ask price (buy) or the bid price (sell).

In the right-click menu, Buy market shows the ask and Sell market shows the bid, taken from the ServiceData your ChartDataProvider.subscribeServiceData sends for the current symbol. If bid / ask are not provided, the chart uses the close of the last candle. Both buttons showing the same price was a defect, fixed in 5.12.2. To hide the prices in the menu, set chartReactConfig.rightClickMenu.tradingButtons.showMarketPrice: false.

reference — Trading — Supported order types, Y-Axis Price Labels — ServiceData Interface, API Reference - Configuration — rightClickMenu.tradingButtons


Q342: UIOverrides is not available to us because we are using the widget version. As such, your function addCustomToolbarButtons() is not available to us, so we have our own functionality to add buttons to the toolbar, which we call from our own onChartCreated() function registered with api.onChartCreated(). The sequence below shows this:​

Note: resolveApiCreated is the resolve function provided by a Promise surrounding our call to DXChart.createWidget() that we await when the user opens a chart. As I now understand that onApiCreated() is not called only once, I now null the resolveApiCreated function once called, so that it’s not called again when we change layouts. Originally, our code to add the maximise icon and the custom toolbar buttons was elsewhere, to run as a one-off. But since discovering that changing layouts causes the toolbar to reset, I have moved this code into our onChartCreated() callback so that our custom icon / buttons are re-applied when changing layouts. This all works. However, onApiCreated() is being called three times when changing the layout from the layout menu. This results in our custom toolbar icon / buttons to be added multiple times upon layout change. Your demo at https://devexperts.com/dxcharts-demo behaves in the same way: onApiCreated() is called three times (when changing layout), as shown below: From what you have said, it’s my understanding that the expected behavior when changing layout is that onApiCreated() should be called only once by the library.

A: onApiCreated is not a one-time callback. When you switch to another layout or change the number of charts in the multichart layout, the charts are destroyed, created again and registered with the API one by one, and onApiCreated is called once for each chart as it is registered. So the code in it must be safe to run several times. Some extra calls were a defect, fixed in 5.14.1: since then the callback is no longer called while the old charts are removed.

Buttons that you add to the toolbar DOM yourself are not kept when the chart re-renders the toolbar. The widget accepts uiOverrides (build components with DXChart.React.createElement), so add your buttons with uiOverrides.Toolbar.ToolbarButtons instead; helpers such as addCustomToolbarButtons are available in DXChart.uiOverridesUtils.toolbarButtons. Buttons defined this way are part of the toolbar and stay after a layout change.

reference — Ways to customize DXcharts widget — Toolbar, Overriding Toolbar buttons, Getting started with API


Q343: I resolved the first issue where onApiCreated() was being called multiple times; this was due to an error in my code causing createLayout() to fail.​

However, I am still seeing onApiCreated() called three times every time I go to the layout menu and change to a different layout. I’m not expecting onApiCreated() to be called at all as a result of changing the layout, and this is causing other problems; I have checked for any other errors/warnings in our code and can’t see any. I am also seeing that when I change layout, any buttons that I have added to the top toolbar are no longer there and I have to re-add them; is this expected behavior?"

A: Being called on a layout change is expected: switching to another layout destroys the charts and creates them again, and onApiCreated is called once for each chart as it is registered with the API (see Q342 and Q358). Make the code in it safe to run more than once and keep a reference to the latest API object.

Buttons you add to the toolbar DOM yourself are lost when the toolbar re-renders. Buttons defined with uiOverrides.Toolbar.ToolbarButtons are part of the toolbar and stay after a layout change; the widget supports uiOverrides too.

reference — Overriding Toolbar buttons, Ways to customize DXcharts widget — UI overrides


Q344: We have changed our chart layouts strategy from “one layout per instrument” to “multiple layouts” and, as such, we are now using the library’s standard built-in layout functionality, including showing the layouts menu on the toolbar. I am currently experiencing an issue where even when we return a populated ChartLayoutData object in LayoutProvider.getLayouts(), the library still calls createLayout() with a default layout passed in. Is this expected behavior, please?​

A:

No, that's not expected. The chart calls createLayout() with a default layout only when it can't use what getLayouts() returned: the promise rejects or resolves with nothing, layouts is empty, selectedLayoutId is empty, or selectedLayoutId doesn't match the id of any layout in layouts. In the last case the browser console shows Error while fetching layouts data. Make sure getLayouts() resolves with a ChartLayoutData object whose selectedLayoutId is the id of one of its layouts:

getLayouts(): Promise<ChartLayoutData>;

reference — Layout Provider — Default layout and selected layout, Layout Provider — API reference


Q345: I have noticed that when calling api.changeInstrument(newInstrument), the callback SymbolSuggestProvider.onInstrumentChanged() is not called. I was wondering if this is by design or not.​

A: Same as Q297. This is by design: SymbolSuggestProvider.onInstrumentChanged is called when the user changes the instrument in the UI, so that your app learns about the change. When you call api.changeInstrument yourself, your code already knows the instrument is changing. To listen for every instrument change, including api.changeInstrument, use api.onInstrumentChanged.

reference — Symbol Suggest Provider — API reference, Supported APIs


Q346: The issue here is that only one point from the scatter is plotted per candlestick width on the x-axis. This means that we may have many points within a 1 hour candle be reduced down to a single point, through some unknown method. I have attached two screenshots, one of another libraries method of candle+scatter charting (which has it's own issues) and the dxcharts.​

Additionally, we can see that on the left-most candle in the dxcharts screenshot, we have points plotted for the red and yellow series, despite there being no data in those series for the hour around that candle. I believe this is because it draws a line between the last datapoint (around 11am) and the next available point (around 2pm) and then plots the interpolated value. This can lead to false conclusions about the data in that series. Here are two more screenshots showing how the the scatter series has interpolated plots for many hours when there is no data in the series, but there is data in the primary candle series Hopefully there is a way around this in the API?

A: This is how additional series work. Every point of an additional series takes one candle slot of the main series on the X axis, so the chart shows at most one point per main-series candle: points of a compare series are matched to main-series candles by timestamp, and several points within one candle end up in the same slot. Where a compare series has no point for a main-series candle, the chart fills the gap with a copy of the nearest earlier point (or the next one, before the series' first point), which is why values appear where your series has no data. There is no option to change this. A smaller aggregation period for the main series gives the additional series more slots.

reference — Compare charts, Data series — Set multiple series


Q347: We would like to hide the “Synchronize Drawings” icon in the left sidebar of the chart. We do not plan to implement this functionality right now and would like to hide it.​

Can you please provide us with the logic to remove it? When we comment it out in the code, the area where the icon should be still displays as an empty space.

A: You can hide it with config:

chartReactConfig: {
drawings: {
sidebar: {
footer: {
synchronizeDrawings: { enabled: false },
},
},
},
},

The button is then not rendered at all, so no empty space is left. The same footer object hides the other footer buttons: magnetMode, drawingMode, hideAllDrawings and deleteAllDrawings. On older versions, the only way is to replace the whole footer with the uiOverrides.DrawingsSidebar.DrawingsSidebarFooter override.

This config works in the React library (ChartReactApp). The widget currently doesn't pass drawings.sidebar.footer on to the chart, so with the widget hide the button with CSS instead: .SidebarSyncDrawingsButton { display: none; } (class names are listed in COMPONENTS_CLASSNAME).

reference — Configuring drawings — Enabling and disabling buttons in drawings sidebar footer, Overriding the Sidebar component, CSS override — Library export (COMPONENTS_CLASSNAME)


Q348: My question now is about the chart's dimensions. The solution I’m using is the Widget, and it only accepts parameters in px. I wanted to know if there’s a way to use %, or could you provide me with the ID of the container element so I can adjust the size?​

A: Leave out width and height. Without them the chart's root element (#chart-react-wrapper) takes width: 100% and height: 100% of the container element you pass to createWidget, so size that container with CSS (%, vh, flex and so on). The width and height props are numbers in pixels and switch the chart to a fixed size only when both are set. Size your own container rather than styling #chart-react-wrapper, which repeats on a page with several charts.

reference — Using DXcharts with Vanilla apps — createWidget function, API Reference - Configuration — fixedSize


Q349: We are implementing a non-React version of DX Charts. How do we remove the logo with the vanilla js DX chart library. See the screenshot below​

A: The widget accepts uiOverrides, so you can hide the logo the same way as in the React library — pass a Logo component that renders nothing:

DXChart.widget.createWidget(container, {
uiOverrides: { Logo: () => null },
});

On older widget versions, hide it with CSS:

#dxcharts_logo_container {
display: none;
}

reference — Default logo — Removing the Logo, Ways to customize DXcharts widget — UI overrides


Q350: How to enable cropping of candles with the option to extend them into the future?​

Is there a way to update the candles on demand?

A: Your ChartDataProvider decides how many candles to return for each requestHistoryData call, and the first request and later lazy-loading requests can return different amounts, so you can start with a cropped range. To replace the chart's candles at any later moment, for example to extend them up to the current date, pass the complete new set of candles to the updateCallback that requestHistoryData receives. You can also pass only the new candles, with updateCallback(candles, { mode: 'merge' }).

reference — Chart Data Provider — updateCallback, Chart Data Provider — Merging updates into history, Chart Data Provider — Lazy loading


Q351: Our use case is to trigger fetch for candles until current date - a replay button which will generate all the candles until today.​

I use ChartDataProvider.requestHistoryData but we also use updateCallback because as you said, we need to use it to manual updating of ALL historical chart data. updatecallback is now working, but a new issue came up. As this was covered by DXfeed and they couldn't find the issue, The other hypothesis is to be Dxcharts bug.

A: This was a defect: when you scrolled back in history, the chart could call requestHistoryData with a changed symbol if the symbol contained =. The first fix, in 5.14.1, broke lazy loading; both are fixed in 5.14.4, so use 5.14.4 or later. For a replay that loads candles up to today, return the candles from requestHistoryData and push later history with the updateCallback it receives; updateCallback(candles, { mode: 'merge' }) adds candles without replacing the history already loaded.

reference — Chart Data Provider — updateCallback, Chart Data Provider — Merging updates into history


Q352: I’m encountering an issue with updating the chart data in our implementation. Specifically, when the chart initially loads (e.g., displaying data from 01.01.2024 to 10.01.2024), triggering the updateCallback function successfully fetches and updates the candles up to the current date.​

However, if we scroll back in time (e.g., before 01.01.2024) and then trigger the updateCallback, the update does not work as expected. This behavior suggests a potential issue with the chart’s handling of historical data updates.

A: Don't use updateCallback for lazy loading on scroll. The chart calls ChartDataProvider.requestHistoryData itself when the user scrolls to the oldest loaded candle; load the next chunk with its arguments (symbol, aggregation, options.fromTime, options.toTime) and return it as Promise<ChartCandleData[]>. By default updateCallback replaces all history the chart has loaded, including the older candles that came from lazy loading, so if you use it, pass the complete history, not just the latest part. Or call updateCallback(candles, { mode: 'merge' }) to merge candles into the loaded history by timestamp instead.

reference — Chart Data Provider — Lazy loading, Chart Data Provider — updateCallback, Chart Data Provider — Merging updates into history


Q353: Is it possible to remove icon from sidebar?​

A: Yes, depending on the icon:

  • Drawing tools: choose which drawings the sidebar lists with chartReactConfig.drawings.drawingsList.
  • Footer buttons: hide each one with chartReactConfig.drawings.sidebar.footer.<button>.enabled: false, where <button> is magnetMode, drawingMode, synchronizeDrawings, hideAllDrawings or deleteAllDrawings. The widget currently ignores this footer config; there, hide a button with CSS, for example .SidebarSyncDrawingsButton { display: none; } (see COMPONENTS_CLASSNAME for the other class names).
  • The whole sidebar: chartReactConfig.drawings.sidebar.enabled: false.
  • Custom sidebar: replace parts of it with your own components through uiOverrides.DrawingsSidebar (DrawingsSidebarComponent, DrawingsSidebarHeader, DrawingsSidebarFooter).

reference — Configuring drawings — Managing the list of drawings, Configuring drawings — Enabling and disabling buttons in drawings sidebar footer, Overriding the Sidebar component, CSS override — Library export (COMPONENTS_CLASSNAME)


Q354: Are fractional price increments supported?​

A: Yes. Prices can be shown in the 1/32 format used for US Treasury contracts (132'02 = 132 + 2/32). Turn it on with initialChartConfig.components.yAxis.treasuryFormat: { enabled: true }, or at runtime with chart.setTreasuryFormat({ enabled: true }). The price axis then uses 1/32 steps, and the price axis, legend and trading labels show prices in this format.

reference — Price precision — Treasury (1/32) price format, Price precision


Q355: Is it possible to increase font size​

A: Yes. The chart UI (toolbar, menus, popups) takes its font sizes from the CSS variables --font-size-s, --font-size-m, --font-size-l and --font-size-xl; override them in your CSS. Text drawn on the chart canvas (axes, price labels) uses the fontSize options in initialChartConfig.components, for example xAxis.fontSize and yAxis.fontSize.

reference — Fonts — 3. Changing font sizes, Fonts (DXcharts Lite) — Font configuration


Q356: is there a method we can call from to tell the graph to refresh?​

A: There is no refresh method in ChartReactAPI. To reload the candles, pass a fresh, complete history to the updateCallback that ChartDataProvider.requestHistoryData receives; by default it replaces the loaded history. To rebuild the whole chart, unmount and mount ChartReactApp again (with the widget, call destroy() and then createWidget() again). Calling api.changeInstrument with the symbol that is already selected does nothing.

reference — Chart Data Provider — updateCallback, Using DXcharts with Vanilla apps — createWidget function


Q357: How to accesses React state from provider callbacks​

A: There may be many possible solutions, the main thing is that they solve your problem and are convenient. You gave Redux as an example. Redux itself is an abstract JS library that is not tied to React. The react-redux library makes the connection with React. The inconvenience in this case arises when data from Redux needs to be used in the Chart and React is used to transfer it (i.e. useSelector is used). Although it is possible to directly connect chart providers with Redux.

const store = useStore();
const chartDeps = useMemo(() => {
// ....
return {
chartDataProvider: {
// ....
subscribeServiceData: (symbol, callback) => {
const subscription = store.subscribe(() => {
const newServiceData = selectServiceData(store.getState());
if (newServiceData !== oldServiceData) {
callback(newServiceData);
}
});
},
},
};
}, [store]);

But if you have a state defined via useState. Then of course the easiest way is to pass it via ref.

In this case, it is not necessary to use useEffect, you can simply assign the ref value directly in the body of the react component.

reference — Getting started with providers in DXcharts React, Chart Data Provider — API reference


Q358: Is onApiCreated called once for one render of the graph? Am I right in assuming there is one ChartReactAPI and many ChartWithModules?​

A: Yes: one ChartReactAPI serves all charts on the screen, and each chart is its own ChartWithModules instance. When you switch to another layout or change the number of charts (for example from 1 to 4), the charts are destroyed and created again, and onApiCreated is called once for each chart as it is registered, each time with a new ChartReactAPI object. Inside it, api.onChartCreated(cb) calls cb(chartId, chart) right away for every chart registered with that API at that moment. Old chart instances are not reused after such a re-creation, so drop references to old API and chart objects and make your handlers safe to run more than once (for example, key them by chartId).

reference — Getting started with API — DXcharts React API, Multichart


Q359: What are the consequences of turning workers off?​

A: Workers are used to calculate indicators, to prepare the timezone list and to build Renko bricks. With chartReactConfig.disableWorkers: true this work runs in the main thread instead, which may affect performance. The widget disables workers by default; set disableWorkers: false in its dependencies.chartReactConfig to use them. Since 5.17.1 workers work with all bundlers, including Vite, so you only need to disable them on older versions or in unit tests.

reference — API Reference - Configuration — disableWorkers, Bundling — Older versions (before v5.17.1)


Q360: Why is this happening? “Failed to create studies webworker Error: Workers disabled”​

A: Same as Q327. This warning is printed when workers are turned off with chartReactConfig.disableWorkers: true, which is also the default in the widget. The chart then calculates indicators in the main thread, so if you turned workers off on purpose you can ignore it. To use workers, set disableWorkers: false.

reference — API Reference - Configuration — disableWorkers, Bundling — Older versions (before v5.17.1)


Q361: We see this often in the console. Why? “Warning: findDOMNode is deprecated”.​

A: Older versions of DXcharts React used the deprecated findDOMNode. It was removed in 5.15.0 together with the React 19 migration, so the warning no longer comes from DXcharts code. React prints this message in development builds only.

reference — Migration guide — React 19 migration, Getting started with DXcharts React — React version requirements


Q362: Why do we get this, “The type of data has been switched: Last → Market”?​

A: The instrument has type: 'FOREX' in your SymbolSuggestProvider. When a FOREX instrument is opened while the price type is Last, the chart switches the price type to Market (mark) and shows this notification. You can turn this off with chartReactConfig.autoApplyPriceType: false (default true). If the instrument is not FOREX, correct its type in your provider.

reference — API Reference - Configuration — autoApplyPriceType, Symbol Suggest Provider, dxFeed integration — dxFeed Cryptocurrency Instruments Case


Q363: How can I make charts updates faster for live candles?​

A: If you use @dx-private/dxchart-dx-feed-data-provider, upgrade it. Before DXcharts 5.15.0 (provider 0.7.x), its dxLink adapter asked the feed to aggregate live updates over 10 seconds by default, which delayed live candles. Since 5.15.0 (provider 0.8.0), the adapter no longer requests an aggregation period, so live updates are applied as the feed sends them. The acceptAggregationPeriod option is still accepted in the adapter config but has no effect, and the update frequency is not configurable in the provider. With your own ChartDataProvider, the update rate depends on how often your provider calls the subscribeCandles callback.

reference — dxFeed integration — Create dxFeed chart data provider, Chart Data Provider — Data flow


Q364: How to make symbol name to be shown on a price scale by default?​

A: The symbol is shown on the price scale as the description of the last price label. Descriptions are off by default; turn them on in initialChartConfig:

initialChartConfig: {
components: {
yAxis: {
labels: {
descriptions: true,
settings: {
lastPrice: { mode: 'label', type: 'badge' },
},
},
},
},
},

mode and type of the last price label are configurable; the description is not drawn when mode is 'none'. This applies to layouts that don't have saved price-scale settings yet. At runtime, use chart.mainPane.mainExtent.yAxis.changeLabelsDescriptionVisibility(true).

reference — Y-Axis Price Labels — Showing Label Descriptions, Y-Axis Price Labels — Label Modes


Q365: Is it possible to specify precision for order quantity?​

A: Yes. Set the number of decimal places for the order quantity with chartReactConfig.trading.quantityPrecision (default 0), or at runtime with api.setTradingQuantityPrecision(precision, chartId?).

reference — Supported APIs, API Reference - Configuration — trading.quantityPrecision


Q366: which part of the layout should I be looking at to find the default drawing color? We already have a layout provider using the code you shared, and that saves chart colors correctly, but I'm just not sure where to find the default drawing color in layouts.​

A: The default color of new drawings isn't stored in the layout. It comes from the drawingsConfig dependency of ChartReactApp (per theme); pass your own drawingsConfig to change it. The layout stores only the drawings users have created:

  • Before 5.19.0, a drawing's colors are part of the drawing: layout => charts[index] => drawings => "<symbol>" => drawing (array item) => properties. The exact fields differ by drawing type; search for lineColor.
  • Since 5.19.0, color fields are not stored in the drawing. Colors that differ from the defaults are stored in charts[index].chartCoreConfig.themes[<theme>].drawings[<drawingId>].

reference — Configuring drawings — Default drawing colors, Layout Provider — Layout configs store only non-default values, Migration guide — Drawings: Support for themes on drawingsConfig


Q367: we’re curious if the library version is compatible with a mobile app built using React Native?​

A: DXcharts React renders to the browser DOM and an HTML canvas (it needs react-dom), so it can't run as React Native components. The only way to use it in a React Native app is inside a WebView, the same way as in native mobile apps; for example, load the widget in the WebView page.

reference — Getting started with DXcharts widget


Q368: What does ChartDataProvider.subscribeServiceData do?​

A: subscribeServiceData(symbol, callback) is how your provider streams quote data that isn't part of the candles. Call callback with a ServiceData object whenever it changes: bid, ask, prevDayClosePrice and prePostMarketClose. The chart uses it for the Bid/Ask, Previous Day Close and Pre/Post Market Close labels on the price axis, and uses bid / ask as the prices of market orders in trading (falling back to the last price when they are missing). The chart subscribes once per symbol and calls unsubscribeServiceData(symbol) when no chart shows that symbol any more. Both methods are required in ChartDataProvider; if you don't have this data, implement them as no-ops.

reference — Y-Axis Price Labels — Providing Data for Labels, Chart Data Provider — API reference


Q369: how can access ChartComponent.doActivate() from dx api and how it is used?​

A: doActivate() is a protected method of chart entities, so you can't call it directly. Call the public activate() instead: it calls doActivate() once if the entity isn't active yet (and does nothing for a disabled entity), then activates the entity's children. Get the chart instance from the API:

api.onChartCreated((chartId, chart) => {
chart.chartComponent.activate();
});

Chart components are already active after the chart is created, so you normally need activate() only after deactivate(). The window.__CHART_INSTANCE_<n> globals are debug helpers that exist only in non-production builds or in debug mode; don't rely on them.

reference — ChartComponent, Getting started with API — Using DXcharts React API


Q370: dx applyUponCreation (no specific question it has been sent to the chat just like that)​

A: applyUponCreation is a per-chart setting (aggregationPeriod.applyUponCreation, default true) that controls what happens when a user creates a new aggregation period: with true the chart switches to the new period right away; with false the period is only added to the list. This is useful, for example, when you add several periods at once. Set the initial value with initialChartReactSettings: { aggregationPeriod: { applyUponCreation: false } }, or change it at runtime with api.setApplyPeriodUponCreation(apply, chartId?). The setting is saved in the layout with the other chart settings.

reference — Supported APIs, API Reference - Configuration — initialChartReactSettings


Q371: observable changeAggregationPeriod​

A: changeAggregationPeriod is an internal function, not an observable. To change the aggregation period from your code, call api.changePeriod(period, chartId?) from ChartReactAPI. To react to every period change, whether the user made it or changePeriod did, subscribe with api.onPeriodChanged((chartId, period) => ...); it returns an unsubscribe function. To read the current period, use api.getChartInfo(chartId).period.

reference — Supported APIs


Q372: dx onInstrumentChangedTimeframeViewportEffect​

A: onInstrumentChangedTimeframeViewportEffect is an internal effect, not part of the public API. It implements the timeframe viewport strategy for instrument changes. Before the new instrument's candles arrive, it remembers the visible time range and the selected timeframe preset. When the new candles are set, it re-applies the preset if one was selected. Otherwise, with the 'timeframe' strategy it restores the same time range and auto-scales the Y axis, because price ranges differ between instruments; with 'basic', or if there is nothing to restore, it resets the viewport to the default zoom.

It runs only when viewportStrategy.instrument is not 'candles'. The default is 'candles', which keeps the number of visible candles instead, so with default settings this effect does nothing. Choose the strategy with api.setInstrumentViewportStrategy('timeframe' | 'candles' | 'basic') or with initialChartReactSettings.viewportStrategy.instrument.

reference — Scaling — Candles viewport, Scaling — React viewport configuration, Supported APIs


Q373: disable timeframe toolbar​

A: Same as Q190. Timeframe presets can be disabled via chartReactConfig:

chartReactConfig: {
timeframePresets: { mode: 'none' },
}

'none' hides the timeframe presets bar, 'default' shows the presets without the add and edit buttons, and 'full' (the default) shows everything. To replace or remove the component itself, override uiOverrides.Footer.TimeframePresetsComponent instead (see Q377).

reference — API Reference - Configuration — timeframePresets.mode, Overriding the Footer component


Q374: What does setAggregationTimeframeChangeStrategy() do?​

A: It sets how the chart keeps the viewport when the aggregation period changes: 'smart' keeps the same time range where possible (the number of visible candles changes), and 'basic' resets the viewport to the default number of candles. Pass a chartId to apply it to one chart only; without it, it applies to all charts.

The method is deprecated. Use setAggregationViewportStrategy('timeframe' | 'candles' | 'basic') instead (setInstrumentViewportStrategy does the same for instrument changes). When viewportStrategy.aggregations is set, it takes precedence over the old setting, and its default is 'candles', so with default settings setAggregationTimeframeChangeStrategy has no visible effect.

reference — Supported APIs, Scaling — Candles viewport


Q375: Please define "service data"​

A: Same as Q368. Service data is quote information that complements the main candle data of a trading instrument and is updated in real time. In this case:

export interface ServiceData { prevDayClosePrice?: number; prePostMarketClose?: number; bid?: number; ask?: number; }

So it allows you to display more complete trading information on the chart: the bid and ask labels on the price axis, the previous day close and pre/post-market close labels, and the market price used for Buy/Sell Market orders. Your ChartDataProvider supplies it through subscribeServiceData (see Q398).

reference — Y-Axis Price Labels — Providing data for labels


Q376: dX to cancel requestHistoryData and can I cancel a chart historical data​

A: No. The chart doesn't pass a cancellation signal to requestHistoryData, and there is no API to cancel a request that was already sent. What you can rely on:

  • When the instrument or aggregation changes, the chart sends a new request and stops listening to the previous one for that chart, so a late response to the old request is ignored. If you want to stop the outdated backend call, do it inside your provider, for example with an AbortController per chartId.
  • chartReactConfig.dataTimeout (default 12000 ms) is how long the chart waits for the Promise returned by requestHistoryData. If it doesn't settle in time, the chart stops waiting and continues with no data. It doesn't send the request again, and a response that arrives later is not applied, so raise dataTimeout if your backend is slow.
  • unsubscribeCandles(subscriptionId) is called when the chart no longer needs a live candle subscription. It ends live updates only; it doesn't affect history requests.

reference — Chart Data Provider — Data fetching using requestHistoryData, API Reference - Configuration — dataTimeout


Q377: How to disable timeframe toolbar​

A: Same as Q373. There are two ways:

  1. Config (recommended): set timeframePresets.mode in chartReactConfig. 'none' turns the presets bar off; 'default' and 'full' (the default) show it.
  2. UI override: replace TimeframePresetsComponent in uiOverrides.Footer, the same way the toolbar and footer override examples do. A component that renders nothing removes it.
import { ChartReactApp } from '@dx-private/dxchart5-react/dist/chart/chart-react-app';
import { PartialChartReactConfig } from '@dx-private/dxchart5-react/dist/config/chart-react-config';

// 1. config
const chartReactConfig: PartialChartReactConfig = {
timeframePresets: {
mode: 'none', // to turn off, or 'default' / 'full'
},
};

// 2. UI override
const uiOverrides = {
Footer: {
TimeframePresetsComponent: () => null, // remove the component
},
};

export const YourApp = () => (
<ChartReactApp dependencies={{ ...YOUR_PROVIDERS, chartReactConfig }} uiOverrides={uiOverrides} />
);

Use one of the two; with mode: 'none' the override isn't rendered at all.

reference — API Reference - Configuration — timeframePresets.mode, Overriding the Footer component, Overriding the Toolbar component


Q378: Do you have an example of uiOverride for instrument suggest​

A: Yes. uiOverrides.InstrumentSuggest receives instrument (the current symbol) and onInstrumentChanged; call onInstrumentChanged with the selected Instrument and the chart switches to it. Search results are not passed in, so in a real project search through the same SymbolSuggestProvider you pass in dependencies.symbolSuggestProvider (see Q128). Example with a fixed list:

import React, { useState, useCallback } from 'react';
import { ChartReactApp } from '@dx-private/dxchart5-react/dist/chart/chart-react-app';
import { InstrumentSuggestComponentProps } from '@dx-private/dxchart5-react/dist/chart/containers/instrument-selector/instrument-selector.model';
import { Instrument } from '@dx-private/dxchart5-react/dist/chart/model/instrument.model';
import { CREATE_MOCK_PROVIDERS } from '@dx-private/dxchart5-react-mock-providers';

// example list of instruments that you should get from your API in a real project
const instruments: Instrument[] = [
{ symbol: 'AAPL', description: 'Apple Inc', type: 'STOCK', priceIncrements: [0.01] },
{ symbol: 'GOOGL', description: 'Alphabet Inc Class A', type: 'STOCK', priceIncrements: [0.01] },
{ symbol: 'MSFT', description: 'Microsoft Corp', type: 'STOCK', priceIncrements: [0.01] },
{ symbol: 'TSLA', description: 'Tesla Inc', type: 'STOCK', priceIncrements: [0.01] },
{ symbol: 'AMZN', description: 'Amazon.com Inc', type: 'STOCK', priceIncrements: [0.01] },
];

const CustomInstrumentSuggest: React.FC<InstrumentSuggestComponentProps> = ({ instrument, onInstrumentChanged }) => {
const [isOpen, setIsOpen] = useState(false);
const [searchValue, setSearchValue] = useState('');

const filteredInstruments = instruments.filter(
instr =>
instr.symbol.toLowerCase().includes(searchValue.toLowerCase()) ||
(instr.description ?? '').toLowerCase().includes(searchValue.toLowerCase()),
);

const handleInstrumentSelect = useCallback(
(selectedInstrument: Instrument) => {
onInstrumentChanged(selectedInstrument);
setSearchValue('');
setIsOpen(false);
},
[onInstrumentChanged],
);

return (
<div style={{ position: 'relative', minWidth: '200px' }}>
<input
type="text"
value={searchValue || instrument || ''}
onChange={e => setSearchValue(e.target.value)}
onFocus={() => setIsOpen(true)}
placeholder="Search instruments..."
style={{ width: '100%', padding: '8px 12px', border: '1px solid #ccc', borderRadius: '4px', fontSize: '14px' }}
/>
{isOpen && (
<div
style={{
position: 'absolute',
top: '100%',
left: 0,
right: 0,
backgroundColor: 'white',
border: '1px solid #ccc',
borderTop: 'none',
borderRadius: '0 0 4px 4px',
maxHeight: '200px',
overflowY: 'auto',
zIndex: 1000,
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
}}>
{filteredInstruments.length > 0 ? (
filteredInstruments.map(instr => (
<div
key={instr.symbol}
onClick={() => handleInstrumentSelect(instr)}
style={{
padding: '8px 12px',
cursor: 'pointer',
borderBottom: '1px solid #eee',
display: 'flex',
justifyContent: 'space-between',
}}
onMouseEnter={e => (e.currentTarget.style.backgroundColor = '#f5f5f5')}
onMouseLeave={e => (e.currentTarget.style.backgroundColor = 'transparent')}>
<div>
<strong>{instr.symbol}</strong>
<div style={{ fontSize: '12px', color: '#666' }}>{instr.description}</div>
</div>
<span style={{ fontSize: '11px', color: '#999' }}>{instr.type}</span>
</div>
))
) : (
<div style={{ padding: '12px', color: '#666', textAlign: 'center' }}>No instruments found</div>
)}
</div>
)}
{/* Overlay to close the list on an outside click */}
{isOpen && (
<div
style={{ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, zIndex: 999 }}
onClick={() => setIsOpen(false)}
/>
)}
</div>
);
};

// UI override
const uiOverrides = {
InstrumentSuggest: CustomInstrumentSuggest,
};

export const YourApp = () => <ChartReactApp dependencies={{ ...CREATE_MOCK_PROVIDERS() }} uiOverrides={uiOverrides} />;

reference — Symbol Suggest Provider — Custom InstrumentSuggest override, UI overrides


Q379: how to provide a layoutProvider to the dxchart chart?​

A: Implement the LayoutProvider interface and pass your instance to the chart as dependencies.layoutProvider. The Layout Provider page has a complete implementation that stores layouts in localStorage; the same one is available as createLocalStorageLayoutProvider() in the mock providers package:

import { ChartReactApp } from '@dx-private/dxchart5-react/dist/chart/chart-react-app';
import { createLocalStorageLayoutProvider } from '@dx-private/dxchart5-react-mock-providers';

export const YourApp = () => (
<ChartReactApp
dependencies={{
...YOUR_PROVIDERS,
layoutProvider: createLocalStorageLayoutProvider(), // or your own LayoutProvider implementation
}}
/>
);

reference — Layout Provider — How it works, Provider setup examples — Quick start


Q380: how i can add programatic drawing to the favourites?​

A: Favourite drawings are part of the user data that your UserDataProvider stores: UserData.favoriteDrawings is an array of drawing types (for example ['line', 'arrow']) and custom drawing ids. The chart reads it from getUserData() when it starts, and calls setUserData() whenever the user changes their favourites.

To add a favourite from your code, include the drawing type or custom drawing id in favoriteDrawings in the data that getUserData() returns. Calling setUserData() yourself only writes to your storage: the running chart doesn't read user data again, so the change shows up the next time the chart is created.

reference — User Data Provider — What can be user-defined data in DXcharts React


Q381: how to override positions component with ui override feature. positon component of trading feature.​

A: Pass your component as uiOverrides.trading.Position. It receives OverrideProps<PositionProps>, so the original props are in originalProps. Example that renders the quantity and the P&L:

import React, { memo } from 'react';
import { ChartReactApp } from '@dx-private/dxchart5-react/dist/chart/chart-react-app';
import { ChartReactAPI } from '@dx-private/dxchart5-react/dist/chart/view-models/api/chart-react-api.view-model';
import { OverrideProps } from '@dx-private/dxchart5-react/dist/chart/ui-overrides';
import { PositionProps } from '@dx-private/dxchart5-react/dist/chart/components/trading/order/position.component';
import { defaultPositionPLFormatter } from '@dx-private/dxchart5-react/dist/chart/model/trading/position.model';
import {
PositionContainerStyled,
PositionStyled,
PositionSectionDelimiter,
} from '@dx-private/dxchart5-react/dist/chart/components/trading/order/position.styled';
import { OrderSectionStyled } from '@dx-private/dxchart5-react/dist/chart/components/trading/order/components/order.styled';
import { PositionLineStyled } from '@dx-private/dxchart5-react/dist/chart/components/trading/order/components/side.styled';
import { CREATE_MOCK_PROVIDERS } from '@dx-private/dxchart5-react-mock-providers';

const Position = memo<OverrideProps<PositionProps>>(({ originalProps: props }) => {
const { position, horizontalLineWidth, halfOrderHeight, isLineVisible = true, y, currency } = props;
const { disabled, model, selected = false } = position;
const { side, pl, quantity } = model;
const yCoord = y ? y - halfOrderHeight : 0;
const positive = pl > 0;
// the same P&L formatter the built-in component uses
const formatPL = position.formatter ?? defaultPositionPLFormatter;

return (
<div style={{ width: '130px' }}>
<PositionContainerStyled $disabled={disabled} $yCoord={yCoord}>
<PositionStyled disabled={disabled} side={side} $positive={positive} selected={selected}>
<OrderSectionStyled>{quantity}</OrderSectionStyled>
<PositionSectionDelimiter $positive={positive} margin="both" />
<OrderSectionStyled>{formatPL(pl, currency)}</OrderSectionStyled>
</PositionStyled>
{isLineVisible && (
<PositionLineStyled
x={'101%'}
y={halfOrderHeight}
width={horizontalLineWidth}
pl={pl}
disabled={disabled}
/>
)}
</PositionContainerStyled>
</div>
);
});

export const OverridingPositionComponent = () => {
const onApiCreated = (api: ChartReactAPI) => {
api.onChartCreated((_chartId, _chartInstance) => {});
};

return (
<ChartReactApp
dependencies={{
...CREATE_MOCK_PROVIDERS(),
chartReactConfig: {
trading: {
enabled: true,
},
},
onApiCreated,
}}
uiOverrides={{
trading: {
Position,
},
}}
/>
);
};

reference — Overriding the Order component — Position integration and overriding, Trading — Custom trading UI


Q382: How to increase the precision to 4 digits in the last price label and also the crosshair label​

A: Precision of last candle and crosstool labels is the same as precision of the instrument, so the instrument precision should be changed, it should be done in symbol suggest provider. The example would be priceIncrements: [0.0001]. More details are on the Price precision page.

reference — Price precision — How to manage priceIncrements in DXcharts React, Symbol Suggest Provider


Q383: I need to reload / refresh the whole chart object, not just the data​

A: Same as Q356. There is no reload method; to rebuild the whole chart, destroy it and create it again:

  • With createChart (DXcharts React without JSX) or createWidget (the widget), call destroy() on the object it returned, then create the chart again.
  • With the ChartReactApp component, unmount it and mount it again, for example by changing its React key.
  • With DXcharts Lite, call chart.destroy(), then create a new chart.

reference — Using DXcharts with Vanilla apps — Using API, Unmount


Q384: how to set it so we get the wicks in the code​

A: It's part of the chart config: components.chart.showWicks (default true).

  • DXcharts React: set the initial value in initialChartConfig. Users can also switch it in chart settings (Candle wick), and that choice is saved in the layout.
  • DXcharts Lite: pass the same option in the config you create the chart with. To change it at runtime, call chart.data.setShowWicks(true | false), which also redraws the chart; assigning chart.config.components.chart.showWicks directly doesn't redraw.
// DXcharts React
initialChartConfig: {
components: { chart: { showWicks: false } },
}

reference — Chart configuration — showWicks, API Reference - Configuration — initialChartConfig


Q385: How to create orders on chart load programatically​

A: You can do it via the order provider. The chart shows whatever your observeOrders callback receives, so pass your initial orders to that callback as soon as the chart calls observeOrders(symbol, callback). observeOrders and observeExecutedOrders must return an unsubscribe function. Example with an in-memory store:

import { OrderProvider } from '@dx-private/dxchart5-react/dist/providers/trading/order.provider';
import { Order, OrderWithId } from '@dx-private/dxchart5-react/dist/chart/model/trading/order.model';
import { ExecutedOrder } from '@dx-private/dxchart5-react/dist/chart/model/executed-orders.model';
import { ReplaySubject } from 'rxjs';

export const createCustomOrderProvider = (): OrderProvider => {
let lastId = 0;
const generateId = () => `custom_order_${++lastId}`;

const orders: Record<string, Record<string, OrderWithId>> = {};
const ordersBySymbol: Record<string, ReplaySubject<OrderWithId[]>> = {};
const executedOrdersBySymbol: Record<string, ReplaySubject<ExecutedOrder[]>> = {};

const getOrdersSubject = (symbol: string) => {
if (!ordersBySymbol[symbol]) {
ordersBySymbol[symbol] = new ReplaySubject<OrderWithId[]>(1);
}
return ordersBySymbol[symbol];
};

const getExecutedOrdersSubject = (symbol: string) => {
if (!executedOrdersBySymbol[symbol]) {
executedOrdersBySymbol[symbol] = new ReplaySubject<ExecutedOrder[]>(1);
}
return executedOrdersBySymbol[symbol];
};

const triggerOrders = (symbol: string) => getOrdersSubject(symbol).next(Object.values(orders[symbol] ?? {}));

// example orders to create programmatically
const createInitialOrders = (symbol: string) => {
const initialOrders: OrderWithId[] = [
{ id: generateId(), orderType: 'limit', type: 'original', side: 'buy', limitPrice: 150.0, quantity: 100 },
{ id: generateId(), orderType: 'stop', type: 'original', side: 'sell', stopPrice: 160.0, quantity: 50 },
];
orders[symbol] = {};
initialOrders.forEach(order => {
orders[symbol][order.id] = order;
});
triggerOrders(symbol);
};

const createOrder = (symbol: string, order: Order): Promise<string> => {
const newOrder: OrderWithId = { ...order, id: generateId() };
orders[symbol] = { ...orders[symbol], [newOrder.id]: newOrder };
triggerOrders(symbol);
return Promise.resolve(newOrder.id);
};

return {
createOrder,
createOcoOrders(symbol, _parentOrderId, ocoOrders) {
const [first, second] = ocoOrders;
return Promise.all([
first ? createOrder(symbol, first) : Promise.resolve(''),
second ? createOrder(symbol, second) : Promise.resolve(''),
]);
},
updateOrder(symbol, order) {
if (orders[symbol]?.[order.id]) {
orders[symbol][order.id] = order;
triggerOrders(symbol);
}
return Promise.resolve();
},
deleteOrder(symbol, order) {
if (orders[symbol]?.[order.id]) {
delete orders[symbol][order.id];
triggerOrders(symbol);
}
return Promise.resolve();
},
observeOrders(symbol, callback) {
const subscription = getOrdersSubject(symbol).subscribe(callback);
if (!orders[symbol]) {
createInitialOrders(symbol);
}
return () => subscription.unsubscribe();
},
observeExecutedOrders(symbol, callback) {
const subscription = getExecutedOrdersSubject(symbol).subscribe(callback);
return () => subscription.unsubscribe();
},
};
};

Pass it as dependencies.orderProvider and enable trading (chartReactConfig.trading.enabled).

reference — Order Provider — Key methods, Migration guide — OrderProvider and PositionProvider interface changes, Trading — Supplying orders & positions to chart


Q386: UserDataProvider implemnetation​

A: you can find example here User Data Provider

reference — User Data Provider — How it works


Q387: how to change the toolbar of the devexperts charts?​

A: you can find examples here: Overriding the Toolbar component and Overriding Toolbar buttons.

reference — Overriding the Toolbar component, Overriding Toolbar buttons, UI overrides


Q388: const ds = pane.createDataSeries(); ds.setDataPoints([candles.value, indicator.data]). With this code i expect that rendered two lines, but only indicator.data actually rendered. Why?​

A: setDataPoints accepts a one- or a two-dimensional array, but a two-dimensional array is still one series: each inner array is a separate segment of the same line (that's how you draw a line with gaps), drawn with the same series settings on the same scale. It doesn't create a second line. To draw two lines, create two data series:

const candlesSeries = pane.createDataSeries();
candlesSeries.setDataPoints(candlePoints);

const indicatorSeries = pane.createDataSeries();
indicatorSeries.setDataPoints(indicatorPoints);

Each point must have timestamp and close (DataSeriesPoint). In a series created with pane.createDataSeries(), points are placed on the X axis by matching their timestamp to the candles of the main series, so use timestamps from the main series.

reference — Panes — Pane component and data series, Data series


Q389: When there are no layouts, what should we set selectedLayoutId to?​

A: Return layouts: [] with selectedLayoutId: '', or reject the getLayouts() Promise. If layouts is empty or selectedLayoutId is empty, the chart creates a default layout named "Default Layout" and passes it to your createLayout(). The id that createLayout() resolves with becomes the new layout's id and the selectedLayoutId. Only if createLayout() rejects does the chart keep the default layout in memory with the id ''.

When you do return layouts, selectedLayoutId must be the id of one of them. A populated layouts array with an empty selectedLayoutId is treated as "no layouts", so the chart creates a default layout again.

reference — Layout Provider — Default layout and selected layout, Layout Provider — API reference


Q390: Quick question: can you please let me know how to set volume to the “Buy” and “Sell” buttons on the chart (top-left). Default its showing 100.( I want to set initial volume,max volume allowed and stepper for increase or decraese.​

A: You can set the initial quantity, the step of the +/- buttons and the minimum and maximum quantity, and change them at runtime.

Set the initial values in initialChartReactSettings.trading:

initialChartReactSettings: {
trading: {
quantity: 150, // initial quantity, default 100
quantityStep: 20, // step of the +/- buttons, default 1
minQuantity: 1, // default 0
maxQuantity: 5000, // default 1000
},
},

The order entry reads these values from the chart settings, which are also saved in the layout, so the chartReactConfig.trading values (defaultOrderQuantity, quantityStep, minOrderQuantity, maxOrderQuantity) are not applied.

To change the values at runtime, for example per instrument, use ChartReactAPI: api.setTradingQuantity(150), api.setTradingQuantityStep(20), api.setTradingMinQuantity(1) and api.setTradingMaxQuantity(5000). Each takes an optional chartId. A layout saved earlier keeps the values it was saved with, so use these methods to change them for existing layouts.

reference — API Reference - Configuration — initialChartReactSettings, Supported APIs


Q391: We have attempted to get the chart setting to work that allows you to select the price type on the price axis as Bid, Last, Ask or Market. The Last always plots. How do we implement so that it works correctly?​

A: Same as Q215. Two things are needed:

  1. Your ChartDataProvider must return candles for the selected price type. The chart doesn't build bid, ask or mark candles itself: it passes the type as options.priceType ('last', 'mark', 'bid' or 'ask') to requestHistoryData and subscribeCandles, and requests the data again when the user changes it. If your provider ignores options.priceType, you'll always see the same (last) prices.
  2. By default (chartReactConfig.autoApplyPriceType: true) the chart sets the price type from the instrument type whenever the instrument changes, including the first one: 'last' for STOCK and CRYPTO instruments (or 'mark' when a compare instrument is FOREX), and 'mark' instead of 'last' for FOREX. To keep the price type you set, use autoApplyPriceType: false.

Set the initial price type with:

initialChartReactSettings: {
candlesData: {
price: '...', // one of "last", "mark", "bid", "ask"
},
},

or at runtime with api.setPriceType(priceType, chartId?). chartReactConfig.priceTypes lists the types users can choose (default ['last', 'mark', 'bid', 'ask']); if the requested type isn't in that list, the chart uses the first item of the list.

reference — Chart Data Provider — Price types, API Reference - Configuration — autoApplyPriceType, Supported APIs


Q392: We are not able to get the Volume Weighted Average Price Indicator to plot on a chart. We have attempted to pass in the VWAP value, but it does not display.​

A: Same as Q322. DXcharts calculates VWAP itself, so a VWAP value you pass in the candle data is not plotted. The vwap field of ChartCandleData is deprecated and the VWAP study doesn't read it.

For each candle, VWAP is the cumulative sum of typical price × volume divided by the cumulative volume since the start of the trading session the candle belongs to. So the study needs:

  1. Trading sessions. Implement TradingSessionsProvider and pass it as dependencies.tradingSessionsProvider. A candle whose timestamp is not inside any session returned by generateSessions() gets no VWAP value. The default provider used when you don't pass one returns no sessions, which is why VWAP stays empty.
  2. volume on each candle.
  3. Optionally typicalPrice on each candle. If you don't provide it, (high + low + close) / 3 is used.

reference — Trading Sessions Provider — VWAP, Chart Data Provider — updateCallback


Q393: Is there any way to set the parent container for the studies panel that appears when the 'f' toolbar icon is clicked?​

At the moment, it appears to be added under the <BODY> tag.

A: Yes. The studies panel is a popup, and by default popups are attached to the <body> element (chartReactConfig.popups.showOutside is true) so that they overlay the page and aren't clipped by the chart container's overflow or z-index. You can change that:

  • chartReactConfig.popups.showOutside: false attaches popups to the chart's own root element.
  • uiOverrides.OutsideContainer.Popup attaches popups to an element you pass. It takes precedence over showOutside. OutsideContainer.Popover does the same for popovers such as dropdowns.
<ChartReactApp
dependencies={{ ...YOUR_PROVIDERS }}
uiOverrides={{
OutsideContainer: {
Popup: document.getElementById('chart-popups') ?? undefined,
},
}}
/>

Both options apply to all popups (studies, chart settings, drawing settings), not only the studies panel. The element must already exist in the DOM when the chart renders.

reference — UI overrides — Popup and popover containers, API Reference - Configuration — popups.showOutside


Q394: When i right click on chart Buy Market is showing as Nan. how to control this?. Can you throw me some light on this?​

A: The Buy Market price is the ask, and the Sell Market price is the bid, that your ChartDataProvider sends through subscribeServiceData. If bid or ask is undefined, the chart uses the close of the last candle instead. NaN usually means your provider sends NaN (or something that isn't a number) as bid or ask, so check what you pass to the subscribeServiceData callback: send numbers, or leave the field out until you have a quote. If bid and ask are fine or not sent, check that the close of your last candle is a number, because that is the fallback.

reference — Y-Axis Price Labels — Bid/Ask labels, Chart Data Provider — API reference


Q395: regarding the indicators template on the web. when saving a template in chart mode, the template is saved under the indicators templates. however, when the user goes to a different tab and then later returns to charts, the template is no longer saved.​

A: The chart doesn't store indicator templates itself; they live in your indicatorsTemplateProvider. When the chart is created again (for example when your app remounts it after a tab switch), it loads the templates by calling getTemplates(). So a template disappears if createTemplate() doesn't persist it, if getTemplates() doesn't return it, or if your provider is created again with empty state.

To rule out your implementation, try the localStorage provider from the mock providers package:

import { createLocalStorageIndicatorsTemplateProvider } from '@dx-private/dxchart5-react-mock-providers';

// in your dependencies
indicatorsTemplateProvider: createLocalStorageIndicatorsTemplateProvider(),

Note that the in-memory createMockIndicatorsTemplateProvider(), which CREATE_MOCK_PROVIDERS() uses, loses its templates whenever it is created again, so it isn't a good test for this.

reference — Indicator Templates Provider — How it works


Q396: What is the id of the "Default Layout"?​

A: It has no fixed id. "Default Layout" is the name of the layout the chart creates when getLayouts() returns no layouts. Its id is whatever your LayoutProvider.createLayout() resolves with (the mock and localStorage providers generate a random string). If createLayout() rejects, the chart uses ''. The mock layout provider starts with selectedLayoutId: '0' and an empty layouts array; that '0' is a placeholder, not a layout id. See Q389.

reference — Layout Provider — Default layout and selected layout


Q397: How can I programmatically select a different layout?​

A: Use api.selectLayout(layoutId). It switches the chart to that layout and calls your layoutProvider.updateSelectedLayout(layoutId) so you can save the selection. If that layout is already selected, nothing happens. It throws if the chart has no layout with that id. Don't call layoutProvider.updateSelectedLayout() yourself for this: the chart calls that method to notify your storage, and calling it directly doesn't change the chart.

reference — Layout Provider — Default layout and selected layout, Supported APIs


Q398: how to use subscribeServiceData​

A: Same as Q368. subscribeServiceData is part of the ChartDataProvider that you implement; the chart calls it. When the chart needs quotes for a symbol, it calls subscribeServiceData(symbol, callback). Call callback with a ServiceData object (bid, ask, prevDayClosePrice, prePostMarketClose, all optional) whenever the values change. When it no longer needs them, the chart calls unsubscribeServiceData(symbol).

import { ServiceData, ServiceDataProvider } from '@dx-private/dxchart5-react/dist/providers/chart-data-provider';

const subscriptions = new Map<string, () => void>();

// add these two methods to your ChartDataProvider
export const serviceDataMethods: ServiceDataProvider = {
subscribeServiceData(symbol: string, callback: (data: ServiceData) => void) {
// yourQuoteFeed is your own real-time source
const unsubscribe = yourQuoteFeed.subscribe(symbol, quote =>
callback({ bid: quote.bid, ask: quote.ask, prevDayClosePrice: quote.prevClose }),
);
subscriptions.set(symbol, unsubscribe);
},
unsubscribeServiceData(symbol: string) {
subscriptions.get(symbol)?.();
subscriptions.delete(symbol);
},
};

reference — Y-Axis Price Labels — Implementing ServiceDataProvider, Chart Data Provider — Data flow


Q399: How can we set the parent container for the studies window?​

A: Same as Q393. Attach popups, which include the studies window, to your own element with uiOverrides.OutsideContainer.Popup, or to the chart's root element with chartReactConfig.popups.showOutside: false:

<ChartReactApp
dependencies={{ ...YOUR_PROVIDERS }}
uiOverrides={{
OutsideContainer: {
Popup: document.getElementById('chart-popups') ?? undefined,
},
}}
/>

The rightClickMenus.studiesMenu override only replaces the content of the studies right-click menu; it doesn't change where the studies window is attached.

reference — UI overrides — Popup and popover containers, Overriding right-click menu elements


Q400: Can I plot only a specific fixed time range on the chart?​

A: You can set the visible time range from your code with setTimestampRange(start, end) on the chart instance (timestamps in milliseconds). Call it after the candles are loaded:

let setTimeRange = (start: number, end: number) => {};

const onApiCreated = (api: ChartReactAPI) => {
api.onChartCreated((chartId, chart) => {
setTimeRange = (start: number, end: number) => {
chart.data.setTimestampRange(start, end);
};
});
};

// ...later, once the candles are loaded
setTimeRange(new Date('2025-01-01').getTime(), new Date('2025-01-31').getTime());

This sets the viewport only: the user can still scroll and zoom, and the chart sets the viewport again when the instrument or aggregation changes. To plot only the candles in that range, return only those candles from your requestHistoryData.

reference — Scaling — API axis range, Chart Data Provider — Data fetching using requestHistoryData


Q401: Can you guide me what setting I can override in order to change the default zoom of the chart? Currently it shows like data from the past 1-2 hours with tens or hundreds of candles. I would like to change this to a more "balanced zoom state" where I can see about 25 candles on the phone's screen. See attached screenshots of current and desired layout.​

A: Use scale.defaultViewportItems in initialChartConfig (default 100). It sets how many of the latest candles the chart shows when it opens without a saved viewport, and when the zoom is reset (for example, by double-clicking the X-axis). For about 25 candles:

<ChartReactApp
dependencies={{
...otherDependencies,
initialChartConfig: {
scale: { defaultViewportItems: 25 },
},
}}
/>

If the layout your Layout Provider returns has a saved viewport, the chart restores that viewport instead.

reference — Scaling — Basic scale, Chart configuration — scale.defaultViewportItems


Q402: Is there any way to set the parent container for the studies panel that appears when the 'f' toolbar icon is clicked?​

At the moment, it appears to be added under the <BODY> tag.

A: Same as Q393. By default (chartReactConfig.popups.showOutside: true), the studies panel and the other popups are rendered in a portal attached to document.body. You can change where they go:

  • Set chartReactConfig.popups.showOutside: false to render popups and popovers inside the chart's root element. The chart container then gets overflow: hidden, so popups can't extend beyond it.
  • Pass your own DOM element in uiOverrides.OutsideContainer.Popup. All popups, including the studies panel, are appended to it; uiOverrides.OutsideContainer.Popover does the same for popovers. This takes precedence over showOutside.
const popupContainer = document.getElementById('my-popup-container');

<ChartReactApp
dependencies={dependencies}
uiOverrides={popupContainer ? { OutsideContainer: { Popup: popupContainer } } : {}}
/>

The element must already exist when the chart renders.

reference — UI overrides — Popup and popover containers, API Reference - Configuration — popups.showOutside


Q403: We are not able to get the Volume Weighted Average Price Indicator to plot on a chart. We have attempted to pass in the VWAP value, but it does not display.​

A: Same as Q392. DXcharts calculates VWAP itself, so a VWAP value you pass in the candle data is not plotted: the vwap field of the candle data is deprecated and the VWAP study doesn't read it. The study needs:

  1. Trading sessions. Implement a Trading Sessions Provider and pass it as dependencies.tradingSessionsProvider. VWAP accumulates values within each trading session, and a candle that isn't inside any session gets no VWAP value. The default provider, used when you don't pass one, returns no sessions.
  2. volume on each candle.
  3. Optionally typicalPrice on each candle. Without it, (high + low + close) / 3 is used.

reference — Trading Sessions Provider — VWAP, Chart Data Provider — Data fetching using requestHistoryData


Q404: We have attempted to get the chart setting to work that allows you to select the price type on the price axis as Bid, Last, Ask or Market. The Last always plots. How do we implement so that it works correctly?​

A: Same as Q391. Two things are needed:

  1. Your Chart Data Provider must return candles for the selected price type. The chart doesn't build bid, ask or mark candles itself: it passes the type as options.priceType ('last', 'mark', 'bid' or 'ask') and requests the data again when the user changes it. If your provider ignores options.priceType, you'll always see the same (last) prices.
  2. By default (chartReactConfig.autoApplyPriceType: true), the chart sets the price type from the instrument type whenever the instrument changes: 'last' for stock and crypto instruments, 'mark' for forex. To keep the price type you set, use autoApplyPriceType: false.

Set the initial price type in ChartReactApp.dependencies:

initialChartReactSettings: {
candlesData: {
price: '...', // one of "last", "mark", "bid", "ask"
},
},

chartReactConfig.priceTypes lists the types users can choose (default ['last', 'mark', 'bid', 'ask']). If the requested type isn't in that list, the chart uses the first item of the list.

reference — Chart Data Provider — Price types, API Reference - Configuration — autoApplyPriceType


Q405: When creating a protection order for an existing position, a temporary order ID is assigned to the position. In cases where the backend fails to create the order, our createOrder function in the ordersProvider returns a rejected promise.​

However, even after this failure, the temporary order ID remains linked to the position. This causes issues in our UI — for example, in the position component, we check if an order ID exists to decide whether to show the "Create Protection Order" entry point. Since the temporary ID is still present, the entry point is hidden incorrectly. We attempted to reset the position state on failure by updating it via dataCallback with the previous state, but the temporary order ID is not being cleared. Expected behavior: On order creation failure, the temporary order ID linked with the position should be removed/reset so that the position reflects the correct state and the UI entry point can be shown again. Steps to reproduce: Create a protection order for an existing position. 2. Simulate backend failure in createOrder (reject the promise). 3. Observe that the temporary order ID still exists on the position object.

A: When createOrder rejects, the chart removes the temporary protection order from the screen, but it doesn't unlink the temporary id from the position. The id is reset the next time your Position Provider emits that position, so after a failed createOrder, emit the position again with its real protectionOrderIds.

Ids that the provider doesn't send come back as undefined, so the position can then have protectionOrderIds: [undefined, undefined] instead of no field. If your position component only tests that protectionOrderIds exists, test its entries instead.

reference — Position Provider — Protection Orders, Order Provider — Protection Orders


Q406: Some of price history requests triggered by the requestHistoryData function take very long to finish (get a response). Because of this when I change the aggregation, the chart will wait a little bit and display “No data available”. When the request of price history finishes and returns the candle data the chart will not update and it will still display “No data available”. Right now we have a workaround to adjust the from and to datetime so that the requests don’t take long to finish. We would like a way to adjust the timeout of the requestHistoryData, we want to make it wait up until 2 minutes before returning “No data available”.​

A: The chart waits for the requestHistoryData promise for at most chartReactConfig.dataTimeout milliseconds (default 12000, 12 seconds). If the promise doesn't resolve in time, the chart treats the request as failed, shows "No data available" and ignores the late response, including later updateCallback calls for that request. To wait longer, raise the timeout:

<ChartReactApp
dependencies={{
...otherDependencies,
chartReactConfig: {
dataTimeout: 2 * 60 * 1000, // wait up to 2 minutes
},
}}
/>

The timeout applies when the chart requests history for the main and compare instruments, for example on load or after an aggregation change. Lazy-loading requests for older candles aren't limited by it.

reference — Chart Data Provider — Request timeout, API Reference - Configuration — dataTimeout


Q407: We are currently having a problem where if you make two orders or positions and they get merged (collapsed) onto the dxchart you are not able to click them to add a stop loss or a take profit.​

We are using: "name": "@dx-private/dxchart5-react", "version": "5.15.4", We are using Next.js 15.5.0, and react 19.1.1.

A: Grouped orders and positions work the same way as single ones: when you add a stop loss or take profit, the chart calls createOrder with a protection order (type: 'sl' or 'tp') whose originalItemId is the id of the parent order or position, exactly as you emitted it from observeOrders / observePositions. The id you return from createOrder is then linked to the parent; your Order and Position Providers must also emit the parent with protectionOrderIds containing that id. If it fails only for grouped items, there might be a problem with finding the parent id inside the group: check how your code maps backend orders to DXcharts orders. A protection order is also an order, so if ids or other properties are generated differently for it, the parent can't be found.

createOrder: async (symbol: string, order: Order): Promise<OrderId> => {
if (order.type === 'sl' || order.type === 'tp') {
// the id of the parent order or position, as you emitted it
const parentId = order.originalItemId;
const price = order.orderType === 'stop' ? order.stopPrice : order.limitPrice;
await sendProtectionOrderToBackend(parentId, order.type, price); // your backend call
// return a unique id for the new protection order
return `${order.type}-${parentId}-${Date.now()}`;
}
// ...create a regular order and return its id
},

reference — Order Provider — Protection Orders, Trading — Stop loss and Take profit orders


Q408: Some of price history requests triggered by the requestHistoryData function take very long to finish (get a response). Because of this when I change the aggregation, the chart will wait a little bit and display “No data available”. When the request of price history finishes and returns the candle data the chart will not update and it will still display “No data available”. Right now we have a workaround to adjust the from and to datetime so that the requests don’t take long to finish. We would like a way to adjust the timeout of the requestHistoryData, we want to make it wait up until 2 minutes before returning “No data available”.​

A: Same as Q406. You can directly set the timeout as an option in chartReactConfig. The default value is 12 seconds, passed to the dataTimeout key (in milliseconds).

Here's an example:

<ChartReactApp
dependencies={{
...otherDependencies,
chartReactConfig: {
dataTimeout: 2 * 60 * 1000,
},
}}
/>

reference — Chart Data Provider — Request timeout, API Reference - Configuration — dataTimeout


Q409: Is it possible to have separate default chart view for each of the assets? Like MSFT will have RSI and MACD and channel drawing, while APPL will have BB and line drawing tool (these are just examples it can be pretty much any combination of asset + indicator + drawing tool)​

A: Drawings are already kept per instrument: a layout stores them as drawings: Record<symbol, Drawing[]>, and the chart shows only the drawings of the current instrument. Indicators (studies) are kept per chart, not per instrument. To show a different set of indicators for each asset, set them when the instrument changes:

const STUDIES_BY_SYMBOL: Record<string, string[]> = {
MSFT: ['RelativeStrengthIndex', 'MACD'],
AAPL: ['BollingerBands'],
};

const onApiCreated = (api: ChartReactAPI) => {
api.onInstrumentChanged((chartId, instrument) => {
const studyIds = STUDIES_BY_SYMBOL[instrument.symbol];
if (studyIds) {
// replaces the studies currently on that chart
api.setStudiesByIds(studyIds, chartId);
}
});
};

You can also prepare complete layouts, as the demo does with a JSON layout: add the indicators and drawings in the UI, copy the layout object your Layout Provider receives, and serve it from your Layout Provider. For example, with the local storage provider from the mock providers package:

import { createLocalStorageLayoutProvider } from '@dx-private/dxchart5-react-mock-providers';
import complexLayout from './layouts/complex.json';

const layoutKey = 'layoutsComplex';
const complexLayoutData = {
selectedLayoutId: '1',
theme: 'dark',
layouts: [{ id: '1', name: 'Complex Layout', lastUpdateTimeStamp: Date.now(), ...complexLayout }],
};
// the provider reads its data from localStorage under this key
localStorage.setItem(layoutKey, JSON.stringify(complexLayoutData));

<ChartReactApp dependencies={{ ...otherDeps, layoutProvider: createLocalStorageLayoutProvider(layoutKey) }} />;

api.selectLayout(layoutId) switches to another saved layout.

reference — Layout Provider — What is a layout in DXcharts React?, Studies — Custom studies UI, Supported APIs


Q410: Can we push text programmatically on the chart? It's either through some custom component we'll have to write or through "text" drawing tool​

A: Use the text drawing. Build a drawing object with type: 'text', one key point (a timestamp and a price value) and the text in properties.textValue; take the other properties from the defaults:

import { DEFAULT_DRAWINGS_CONFIG } from '@dx-private/dxchart5-react/dist/config/drawings-config';
import { Drawing } from '@dx-private/dxchart5-react/dist/chart/model/drawing.model';

const textDrawing: Drawing<'text'> = {
id: `text_${Date.now()}`,
type: 'text',
visible: true,
locked: false,
keyPoints: [{ timestamp: 1735689600000, value: 150 }],
properties: { ...DEFAULT_DRAWINGS_CONFIG.text.properties, textValue: 'My note' },
};

DEFAULT_DRAWINGS_CONFIG uses the dark theme's colors; for another theme, take defaultDrawingsConfigWithPalette[theme].text.properties from the same module.

Add it with api.addDrawing(textDrawing, chartId). It goes to the instrument currently shown on that chart. You can also use the chart's DrawingsComponent (chart.drawings, available in api.onChartCreated). setDrawings replaces all drawings, so merge with getDrawings():

const current = chart.drawings.getDrawings();
chart.drawings.setDrawings({ ...current, AAPL: [...(current.AAPL ?? []), textDrawing] });

reference — Accessing DrawingsComponent from DXcharts React — Adding drawings from external storage, Custom Drawings — Add and remove instances


Q411: After selecting a drawing, the following control will be displayed. What is its name?​

Is it possible to disable/remove this widget for a specific drawing? e.g. Drawings that were generated by us. If not, is there a way to disable the selection function on the drawing?

A: It's the drawing settings toolbar (DrawingsToolbarContainerStyled). It has the human-readable CSS class DrawingsToolbar, and CSS is the best way to customize it, for example to hide it:

.DrawingsToolbar {
display: none;
}

This hides the toolbar for all drawings. There is no option to hide it, or to disable selection, for individual drawings.

reference — CSS override — Reference: all available class names


Q412: is it possible to disable the Editing Dialog when a drawing is double-clicked?​

A: The editing dialog has the human-readable CSS class DrawingsPopup, so you can hide it with CSS:

.DrawingsPopup {
display: none;
}

This also hides the dialog when it's opened from the settings button of the drawing toolbar. By default, the dialog is rendered in document.body, outside the chart's container, so don't scope this selector under your chart wrapper element.

reference — CSS override — Reference: all available class names, UI overrides — Popup and popover containers


Q413: How to manage the layer at code level? Can I move all my generated drawings into a new layer programmatically?​

A: You can do it with ChartReactAPI.setLayerItems(layerItems, chartId). It takes the whole layers tree per instrument (Record<symbol, LayerItem[]>) and replaces it. A layer is a group item such as { id: 'group_1', type: 'group', name: 'My layer', items: [...], itemsVisibility: [] }: id and itemsVisibility are required, and itemsVisibility can be empty. The drawings of the layer go in items; set each one's groupId to the group's id, as the chart does when you move a drawing into a group.

Handle it with care, because drawings and layer items are easy to break:

  • Build the whole tree in one form. api.onLayerItemsChanged gives you the chart's form, where each drawing row carries its drawing model in drawing: move those rows into your new group and pass the tree back. The other form is the one stored in layouts, where a drawing row is { id: 'drawing_<drawingId>', type: 'drawing', name: 'My drawing', drawingId: '<drawingId>' } and refers to a drawing already on the chart. The chart decides which form you passed from the first drawing in the tree, so don't mix the two.
  • setLayerItems re-creates the chart's drawings from the tree and keeps only the drawings that are inside a group. Pass the complete tree, with your new group and every other drawing you want to keep.

reference — Supported APIs


Q414: Here are using Text and Price Line to indicate current orders and positions. Without enabling the Trading feature, do you have any other charting methods you can recommend for representing orders/positions on a chart?​

A: Without the trading feature, you can draw the order and position levels yourself, for example with a custom Y-axis labels provider or a custom drawer.

If you enable trading only to show orders and positions, you can limit what users can do with them: chartReactConfig.trading.addNewOrderEnabled: false disables creating new orders from the order entry, and chartReactConfig.trading.takeProfitStopLossEnabled: false removes the Take Profit and Stop Loss buttons from orders and positions.

Also, if orders are to be created on the chart through some custom control or just via the API, it's possible to create orders programmatically using the provider.

reference — Trading — Configuration for trading, Y-labels, Custom drawer


Q415: Is it possible to enable the Trading feature (Trading from Chart) but remove the order actions from the right-click menu?​

A: Yes. You can hide the order actions of the right-click menu with config:

chartReactConfig: {
rightClickMenu: {
backgroundMenu: {
buyMarketButton: { enabled: false },
sellMarketButton: { enabled: false },
buyLimitButton: { enabled: false },
sellLimitButton: { enabled: false },
},
},
},

These flags also hide the same buttons in the menu of the main data series. Alternatively, pass your own element lists through uiOverrides.rightClickMenus (BackgroundMenuElements and DataMenuElements) without the keys 'BuyMarketButton', 'SellMarketButton', 'BuyLimitButton', 'SellLimitButton' and 'TradingDivider'; the removeMenuElementsByKey helper does that for you. These are the available rightClickMenus overrides:

rightClickMenus: {
yAxisMenu: ComponentType<RCMenuOverrideProps<YAxisConfiguratorPopoverProps>>;
backgroundMenu: ComponentType<RCMenuOverrideProps<BackgroundMenuProps>>;
studiesMenu: ComponentType<RCMenuOverrideProps<StudiesMenuContentProps>>;
drawingsMenu: ComponentType<RCMenuOverrideProps<DrawingsMenuProps>>;
legendMenu: ComponentType<RCMenuOverrideProps<LegendMenuProps>>;
dataMenu: ComponentType<RCMenuOverrideProps<DataMenuProps>>;
dataCompareMenu: ComponentType<RCMenuOverrideProps<DataMenuProps>>;
orderMenu: ComponentType<RCMenuOverrideProps<OrderMenuProps>>;
positionMenu: React.FC<RCMenuOverrideProps<PositionMenuProps>>;
YAxisMenuElements: YAxisMenuElementDeclaration[];
BackgroundMenuElements: BackgroundMenuElementDeclaration[];
StudiesMenuElements: StudiesMenuElementDeclaration[];
DrawingsMenuElements: DrawingsMenuElementDeclaration[];
LegendMenuElements: LegendMenuElementDeclaration[];
DataMenuElements: DataMenuMainElementDeclaration[];
DataCompareMenuElements: DataMenuCompareElementDeclaration[];
OrderMenuElements: Array<RCMenuElementDeclaration>;
PositionMenuElements: Array<RCMenuElementDeclaration>;
}

reference — Overriding right-click menu elements — Hiding menu items via config, Overriding right-click menu elements — Removing default items by key


Q416: How to remove/disable the ‘x’ (Close Order) action from position widget?​

A: The close button has the human-readable CSS class CloseOrderButton. Orders use the same class, so scope the rule to positions. With styled-components, scope it under the position container (PositionContainerStyled, exported from @dx-private/dxchart5-react/dist/chart/components/trading/order/position.styled) in the styled wrapper around your chart:

${PositionContainerStyled} {
.CloseOrderButton {
display: none;
}
}

With plain CSS, add a data field to your positions, for example data: { kind: 'position' }. It is rendered as a data-* attribute on the position element:

[data-kind='position'] .CloseOrderButton {
display: none;
}

reference — CSS override — Reference: all available class names, Styling — Styled-components cascades


Q417: After selecting a drawing, the settings control will be displayed. Is it possible to disable/remove this widget for a specific drawing? e.g. Drawings that were generated by us.​

A: Same as Q411. We have DrawingsToolbar as our human-readable CSS class, and CSS is the best way to customize it, for example .DrawingsToolbar { display: none; }. This hides the toolbar for all drawings; there is no option to hide it for individual drawings.

reference — CSS override — Reference: all available class names


Q418: is it possible to disable the Editing Dialog when a drawing is double-clicked?​

A: Same as Q412. We have DrawingsPopup as our human-readable CSS class, so you can hide the dialog with .DrawingsPopup { display: none; }. This also hides it when it's opened from the drawing toolbar's settings button. The dialog is rendered in document.body by default, so don't scope the selector under your chart wrapper.

reference — CSS override — Reference: all available class names, UI overrides — Popup and popover containers


Q419: How to manage the layer at code level? Can I move all my generated drawings into a new layer programmatically?​

A: Same as Q413. You can do it with the setLayerItems API, but be very careful not to break something, since drawings and layer items are very easy to break. setLayerItems takes the whole layers tree per instrument, replaces it and re-creates the chart's drawings from it, keeping only the drawings that are inside a group. A group needs an id, type: 'group', a name, its drawings in items and an itemsVisibility array (can be empty). Read the current tree with api.onLayerItemsChanged, whose drawing rows carry their drawing model in drawing, move the rows into your new group and pass the complete tree back. Don't mix those rows with rows in the layout form (drawingId instead of drawing) in one tree.

reference — Supported APIs


Q420: How to change the formatter for volume​

A: The value for volume is taken from the candles, so it can be changed in your ChartDataProvider, but the legend still formats it: it adds a K/M/B suffix and applies the instrument's price precision.

There is no API to change the volume formatter in the legend. A UI override doesn't help either: the only legend override, uiOverrides.Legend.Header, replaces the order entry part of the legend, while the values are formatted inside the chart's legend view-model.

reference — Price precision


Q421: Do we need to create a protection order on the OrderProvider to set a take-profit or stop-loss for a market position? If so, what values should I set for price, and orderType respectively?​

A:

Yes, take profit and stop loss for a market position are protection orders (the ones with the originalItemId key and type 'tp' or 'sl').

const slOrder: Order = {
type: 'sl',
orderType: 'limit',
limitPrice: 140.0, // with orderType 'limit'
side: 'sell', // opposite to buy position
quantity: 100,
originalItemId: positionId,
};

Use limitPrice with the 'limit' orderType and stopPrice with the 'stop' orderType. When you emit the order from observeOrders, give it an id, and put that id in the position's protectionOrderIds ([stopLossId, takeProfitId]).

reference — Order Provider — Protection Orders, Position Provider — Protection Orders


Q422: For setting the connection between position and open orders, only one SL and one TP order can be linked via setting protectionOrderIds. What if I have multiple TP/SL on the same position?​

A: The chart was not designed for several protection orders of the same kind on one item. protectionOrderIds has one slot for a stop loss and one for a take profit ([stopLossId, takeProfitId]), and the chart uses it to know which of them are attached: once a slot is filled, the matching "add SL" or "add TP" button is hidden. You can still emit more protection orders from observeOrders, with type: 'sl' or 'tp' and originalItemId set to the position id. They are drawn as protection orders, but only the ids in protectionOrderIds are linked to the position.

reference — Position Provider — Protection Orders, Trading — Stop loss and Take profit orders


Q423: How to change the colours for drawings​

A:

Here is how you can change the colors of the drawing labels on the axes and of the drawing info panel, per theme:

initialChartConfig: {
// Configure colors for drawing labels on X and Y axes
// These colors will be used for labels that appear when drawings are added to the chart
themes: {
dark: {
drawingsTheme: {
xAxis: {
labelColor: 'rgba(0, 150, 255, 1)', // Text color for X-axis labels
highlightColor: 'rgba(0, 150, 255, 0.1)',
},
yAxis: {
labelColor: 'rgba(0, 200, 100, 1)', // Background color for Y-axis labels
highlightColor: 'rgba(0, 200, 100, 0.1)',
},
textColor: 'rgba(0, 150, 255, 1)', // Text color for drawing info panel
textBg: 'rgba(20, 20, 19, 0.7)', // Background color for drawing info panel
},
},
},
},

The default colors of the drawings themselves (lines, fills and text of each drawing type) come from dependencies.drawingsConfig, which takes a config per theme. It replaces the built-in config, so start from the defaults (defaultDrawingsConfigWithPalette from @dx-private/dxchart5-react/dist/config/drawings-config) and change only the drawing types you need.

reference — Configuring drawings — Measure box and axis labels, Migration guide — Drawings: Support for themes on drawingsConfig, API Reference - Configuration — drawingsConfig


Q424: When the items are too close together, they will be grouped together. Is it able to prioritize the items on the grouped container? Let’s say we want to pick the LMT order at top instead of PnL.​

A: Set chartReactConfig.trading.customTradingGroupComparator. Items in a group are sorted with this comparator (by default, by price), and the first one is shown on top of the collapsed group. For example, to put limit orders on top, then other orders, then positions:

import { TradingGroupComparator } from '@dx-private/dxchart5-react/dist/chart/model/trading/trading.model';
import { VisualOrder } from '@dx-private/dxchart5-react/dist/chart/model/trading/order.model';
import { VisualPosition } from '@dx-private/dxchart5-react/dist/chart/model/trading/position.model';

const rank = (item: VisualOrder | VisualPosition): number => {
if (item.type === 'position') {
return 2;
}
return item.model.orderType === 'limit' ? 0 : 1;
};

const limitOrdersFirst: TradingGroupComparator = (a, b) => rank(a) - rank(b);

// in ChartReactApp dependencies
chartReactConfig: {
trading: { customTradingGroupComparator: limitOrdersFirst },
},

In earlier versions, you can replace the group component with your own through uiOverrides.trading.GroupOrder and put your priority logic there. The Order component page shows the same technique for RegularOrder. The built-in GroupOrder uses internal helper functions that aren't exported, so copying it also means copying those helpers.

reference — Trading — Ordering items in a trading group, Overriding the Order component


Q425: How to extend the drawing’s right-click menu with an additional option like "Create signal." -​

A: The customization of the DrawingsMenuElements can be done through uiOverrides.rightClickMenus. There is a helper function addCustomMenuElements (import it from @dx-private/dxchart5-react/dist/chart/ui-overrides/rc-menus) which can be used for this purpose. The documentation has full information and a code example.

reference — Overriding right-click menu elements — addCustomMenuElements, Overriding right-click menu elements — Source code


Q426: . How to get price information from drawing lines​

A:

Here are the changes to get access to drawingsComponent after click onSelect:

// this could be other way on your choice to transfer data to the menu item, just for example
const chartInstancesRef = useRef<Map<string, ChartWithModules>>(new Map());

const getDrawingsComponent = (chartId = '0') => {
const chartInstance = chartInstancesRef.current.get(chartId);
if (chartInstance) {
return chartInstance.drawings;
}
console.warn('Chart instance not ready yet');
return null;
};

const onApiCreated = (api: ChartReactAPI) => {
api.onChartCreated((chartId, chartInstance) => {
chartInstancesRef.current.set(chartId, chartInstance);
const drawingsComponent = chartInstance.drawings;
console.log('>>>>>>>>>>>>>>>>> ' + chartId, drawingsComponent);
});
};

const CustomBackgroundItem = () => {
return createElement(
MenuItem,
{
value: 'custom-bg',
onSelect: (a: unknown) => {
const drawingsComponent = getDrawingsComponent('0');
const drawings = drawingsComponent?.getDrawings();
if (drawingsComponent) {
console.log('on Select', { a, drawingsComponent, drawings });
}
},
},
createElement('span', null, 'Create signal'),
);
};

const customDrawingsMenuElements: DrawingsMenuElementDeclaration[] = [
createElement(CustomBackgroundItem),
'BringToFrontButton',
'SendToBackButton',
'MenuDivider',
'LockDrawingButton',
'HideDrawingButton',
];

const rightClickMenus = {
DrawingsMenuElements: customDrawingsMenuElements,
};

return createElement(ChartReactApp, {
dependencies,
onApiCreated,
uiOverrides: { rightClickMenus },
});

getDrawings() returns the drawings per instrument symbol. The prices are in each drawing's keyPoints: every key point has a timestamp and a value, which is the price.

reference — Accessing DrawingsComponent from DXcharts React, Overriding right-click menu elements — Adding custom items


Q427: Is it possible to hide the left, top, and bottom toolbars and use a single custom bottom toolbar instead? Also, can we support a bottom-sheet–style mobile integration as shown in the video? The docs only mention customizing the top toolbar.​

A: Hiding and replacing the toolbars, yes. A bottom-sheet-style mobile UI isn't built in: you'd build it yourself as your own component, for example rendered through Footer.FooterComponent.

There is an example for the top toolbar in Overriding the Toolbar component, and the same can be applied to the other UI overrides. These are the overrides for all toolbars, top, side and footer:

Toolbar: {
ToolbarButtons: Array<ToolbarButtonDeclaration>;
ToolbarContainer: Element;
ToolbarComponent: ComponentType<ChartToolbarProps>;
CompareChartSuggest: ComponentType<CompareChartSuggestComponentProps>;
};
DrawingsSidebar: {
DrawingsSidebarComponent: ComponentType<OverrideProps<DrawingSidebarProps>>;
DrawingsSidebarHeader: ComponentType<OverrideProps<DrawingsSidebarHeaderProps>>;
DrawingsSidebarFooter: ComponentType<OverrideProps<DrawingsSidebarFooterProps>>;
};
Footer: {
FooterComponent: ComponentType<OverrideProps<ChartFooterProps>>;
TimeZoneComponent: ComponentType<OverrideProps<TimeZoneDropdownProps>>;
TimeframePresetsComponent: ComponentType<OverrideProps<TimeframePresetsProps>>;
DrawingGroupsDropdown: ComponentType<OverrideProps<TimeframePresetsProps>>;
SwitchAxisButtonsProps: ComponentType<OverrideProps<SwitchAxisButtonsProps>>;
};

To hide the built-in top toolbar and drawings sidebar, set chartReactConfig.toolbar.enabled: false and chartReactConfig.drawings.sidebar.enabled: false. Then render your own bottom toolbar through Footer.FooterComponent.

reference — Overriding the Toolbar component, Overriding the Sidebar component, Overriding the Footer component, UI overrides — Available UI overrides


Q428: Is it possible to customize the candle shape (e.g., slightly rounded edges, etc.)?​

A: You can use chart.chartComponent.registerDataSeriesTypeDrawer to change the candles drawing.

const RoundedCandleDrawer = {
config: chart.config.components.chart,

draw(ctx, points, model, hitTestDrawerConfig) {
if (!model.colors?.candleTheme) return;

const visualCandles = points.flat();
ctx.lineWidth = this.config.candleLineWidth || 1;

for (const visualCandle of visualCandles) {
this.drawRoundedCandle(ctx, hitTestDrawerConfig, model, visualCandle);
}
},

drawRoundedCandle(ctx, hitTestDrawerConfig, candleSeries, visualCandle) {
const { candleTheme, activeCandleTheme } = candleSeries.colors;
const direction = visualCandle.name;
const currentCandleTheme = visualCandle.isActive ? activeCandleTheme : candleTheme;

const baseX = candleSeries.view.toX(visualCandle.startUnit);
const width = candleSeries.view.xPixels(visualCandle.width);
const bodyH = visualCandle.bodyHeight(candleSeries.view);

const [lineStart, bodyStart, _bodyEnd, _lineEnd] = visualCandle.yBodyKeyPoints(candleSeries.view);
const bodyEnd = bodyStart === _bodyEnd ? bodyStart + 1 : _bodyEnd;
const lineEnd = lineStart === _lineEnd ? lineStart + 1 : _lineEnd;

const candleColor = currentCandleTheme[`${direction}Color`];
const wickColor = direction === 'none' ? candleColor : currentCandleTheme[`${direction}WickColor`];

// Drawing a wick
if (this.config.showWicks) {
ctx.strokeStyle = hitTestDrawerConfig.color || wickColor;
ctx.beginPath();
const wickX = visualCandle.x(candleSeries.view);
ctx.moveTo(wickX, lineStart);
ctx.lineTo(wickX, bodyStart);
ctx.moveTo(wickX, bodyEnd);
ctx.lineTo(wickX, lineEnd);
ctx.stroke();
}

// Padding
const paddingPercent = this.config.candlePaddingPercent || 0.25;
const paddingWidthOffset = Math.max((width * paddingPercent) / 2, 1);
const paddingBaseX = baseX + paddingWidthOffset;
const paddingWidth = width - paddingWidthOffset * 2;

// Rounding radius (adapts to the width of the candle)
const radius = Math.min(paddingWidth / 4, Math.abs(bodyH) / 4, 5);

// Draw the candle body with rounded corners
ctx.fillStyle = hitTestDrawerConfig.color || candleColor;
ctx.beginPath();

if (ctx.roundRect && radius > 0 && paddingWidth >= 4) {
// We use roundRect if available and the candle is wide enough
ctx.roundRect(paddingBaseX, bodyStart, paddingWidth, bodyH, radius);
} else {
// Fallback for narrow candles or older browsers
ctx.rect(paddingBaseX, bodyStart, paddingWidth, bodyH);
}

ctx.fill();

// Border (optional)
if (this.config.showCandlesBorder) {
ctx.strokeStyle = hitTestDrawerConfig.color || wickColor;
ctx.stroke();
}
},
};

chart.chartComponent.registerDataSeriesTypeDrawer('candle', RoundedCandleDrawer);

// then you probably would need to fireDraw() to apply changes
chart.mainCanvasModel.fireDraw();

You can get access to a certain chart via onApiCreated. Define the drawer inside onChartCreated, where chart is available:

const onApiCreated = (api: ChartReactAPI) => {
api.onChartCreated((chartId, chart) => {
// define RoundedCandleDrawer here
chart.chartComponent.registerDataSeriesTypeDrawer('candle', RoundedCandleDrawer);
chart.mainCanvasModel.fireDraw();
});
};

reference — Custom drawer — Redraw a specific canvas, Getting started with API


Q429: We also need support with adding indicators to the chart programmatically. We don’t mean custom indicators, but the existing built-in ones.​

A: There is a way to add indicators programmatically, to do so you need to:

  1. Get the indicator template from DEFAULT_STUDIES_LIST
  2. Convert the template to the Option type format with fromRawStudiesSettings (required by current setStudies API) and change the values you need
  3. Call api.setStudies() in the onApiCreated callback

Step 1: Get Indicator Templates

First, import DEFAULT_STUDIES_LIST to access all available indicator definitions:

import { DEFAULT_STUDIES_LIST } from '@dx-private/dxchart5-react/dist/config/studies-list';

// Get all available indicators with their default parameters
const allStudies = DEFAULT_STUDIES_LIST();

// Find a specific indicator template
const smaTemplate = allStudies.find(s => s.id === 'SMA');

Step 2: Understanding the Option Type

The setStudies method expects parameters and lines in Option format from fp-ts library, while the templates from DEFAULT_STUDIES_LIST hold plain values. Convert a template with fromRawStudiesSettings, then wrap only the values you change with some from fp-ts/Option (fp-ts is a dependency of @dx-private/dxchart5-react; add it to your own dependencies to import it directly):

import { some } from 'fp-ts/Option';
import { fromRawStudiesSettings } from '@dx-private/dxchart5-react/dist/chart/model/studies.model';

Step 3: Add Indicator on Application Start

Use the onApiCreated callback to add indicators when the chart is ready:

import { some } from 'fp-ts/Option';
import { ChartReactAPI } from '@dx-private/dxchart5-react/dist/chart/view-models/api/chart-react-api.view-model';
import { TStudySettings, fromRawStudiesSettings } from '@dx-private/dxchart5-react/dist/chart/model/studies.model';
import { DEFAULT_STUDIES_LIST } from '@dx-private/dxchart5-react/dist/config/studies-list';

const onApiCreated = (api: ChartReactAPI) => {
// Find SMA template to use as a base
const smaTemplate = DEFAULT_STUDIES_LIST().find(s => s.id === 'SMA');

if (!smaTemplate) {
console.error('SMA indicator template not found');
return;
}

// Convert the template to the Option format. This also gives the study a new unique uuid,
// and keeps every parameter and line the indicator needs, including hidden ones.
const sma = fromRawStudiesSettings(smaTemplate);

// Create SMA indicator with custom parameters
const customSMA: TStudySettings = {
...sma,
// Change Length from the default 9 to 20
parameters: sma.parameters.map(parameter =>
parameter.id === 'length' ? { ...parameter, value: some(20) } : parameter,
),
// Change the line color and thickness
lines: sma.lines.map(line => ({
...line,
thickness: some(2),
colors: some(['#FF0000']),
})),
};

// Add the indicator to chart with id '0'
api.setStudies([customSMA], '0');
};

And pass it to Chart Component:

<ChartReactApp
// ... other props
onApiCreated={onApiCreated}
/>

Available Indicator IDs

You can find all available indicator IDs by importing DEFAULT_STUDIES_IDS:

import { DEFAULT_STUDIES_IDS } from '@dx-private/dxchart5-react/dist/config/studies-list';

// Examples:
// DEFAULT_STUDIES_IDS.SMA
// DEFAULT_STUDIES_IDS.MACD
// DEFAULT_STUDIES_IDS.BollingerBands
// DEFAULT_STUDIES_IDS.RelativeStrengthIndex (RSI)

setStudies replaces the chart's whole list of studies. To keep the studies that are already on the chart, include them: api.setStudies([...api.getChartInfo('0').studies, customSMA], '0'). If you only need built-in indicators with default parameters, api.setStudiesByIds(['SMA', 'MACD']) is enough.

reference — Studies — Custom studies UI, Supported APIs


Q430: Do you officially support Next.js 16+ (incl. Turbopack dev)​

A: We don't officially test or ship a dedicated setup for Next.js, including Next.js 16 and Turbopack, but customers integrate DXcharts with Next.js. It's a client-side component, so render ChartReactApp only in the browser: in a client component ('use client') or with next/dynamic and ssr: false. The setup notes are in Next.js and Electron.

reference — Using DXcharts with React-based apps — Next.js and Electron, Bundling


A: Vite is supported since DXcharts React 5.17.1. The library creates its web workers from self-contained blob code, so workers work with Vite in both development and production, and the earlier Vite worker limitation no longer applies. Add the required vite.config.ts settings from the Bundling page (the color alias, worker.format: 'es' and the optimizeDeps.include list). On versions before 5.17.1, disable workers with chartReactConfig.disableWorkers: true.

If your framework renders on the server (TanStack Start does by default), mount the chart on the client only, the same way as with Next.js: the chart needs browser APIs such as canvas, Web Workers and localStorage.

reference — Bundling — Vite, Bundling — Required configuration, Using DXcharts with React-based apps — Next.js and Electron


Q432: Which UI surfaces are safe to override via uiOverrides (toolbar, drawings sidebar, context menus, order ticket, dialogs)?​

A: Yes, all of them are supported uiOverrides areas:

  • toolbar — Toolbar (ToolbarComponent, ToolbarButtons, ToolbarContainer, CompareChartSuggest)
  • drawings sidebar — DrawingsSidebar (DrawingsSidebarComponent, DrawingsSidebarHeader, DrawingsSidebarFooter)
  • context menus — rightClickMenus (the menu components and the element list of each menu)
  • order ticket — trading.OrderEntry, plus RegularOrder, ProtectionOrder, Position and GroupOrder for the trading items on the chart
  • dialogs — the settings dialog tabs through ChartSettingsTabs; OutsideContainer.Popup and OutsideContainer.Popover set where popups and popovers are mounted

One exception: rightClickMenus.OrderMenuElements and rightClickMenus.PositionMenuElements are declared in the type but currently have no effect. Override the orderMenu and positionMenu components instead.

There are 3 levels of customization: CSS (human-readable class names), config (API level) and uiOverrides (full control). Prefer config where it covers your case.

reference — UI overrides — Available UI overrides (type definition), Ways to customize DXcharts, Overriding the Order Entry component, Overriding right-click menu elements, Overriding settings tabs


Q433: Are there any UI parts that are effectively non-overridable / library-owned or require styled-components overrides?​

A: Most of the UI can be customized without styled-components: through config (chartReactConfig), CSS (human-readable class names, also exported as COMPONENTS_CLASSNAME) or uiOverrides. The parts that aren't React components are drawn on canvas: candles and other series, axes, price labels, drawings and the crosshair. Customize those through initialChartConfig, the palette and themes, or a custom drawer. For example, chart.chartComponent.registerDataSeriesTypeDrawer replaces how a series type is drawn. If you find a part of the UI you can't customize, let us know and we can consider adding support for it.

reference — Ways to customize DXcharts, CSS override — How to find class names, UI overrides, Palette, Custom drawer


Q434: Are there any UI parts that are effectively non-overridable / library-owned or require styled-components overrides?​

A: Same as Q433. Most of the UI can be customized without styled-components: through config (chartReactConfig), CSS (human-readable class names, also exported as COMPONENTS_CLASSNAME) or uiOverrides. The parts that aren't React components are drawn on canvas: candles and other series, axes, price labels, drawings and the crosshair. Customize those through initialChartConfig, the palette and themes, or a custom drawer. For example, chart.chartComponent.registerDataSeriesTypeDrawer replaces how a series type is drawn. If you find a part of the UI you can't customize, let us know and we can consider adding support for it.

reference — Ways to customize DXcharts, CSS override — How to find class names, UI overrides, Palette, Custom drawer


Q435: In dxcharts-lite (Open source version) we observed that after initializing the chart with a config, we couldn’t find a supported API to update core config later (beyond user interactions). Question: In enterprise (dxchart5-react), what is the supported pattern to dynamically update chart settings at runtime (theme switch, toggling features, adding/removing studies, changing available drawings, switching symbol/timeframe) without full teardown/reinit? If reinit is required, what lifecycle do you recommend to avoid leaks and preserve state?​

A: Most runtime changes go through ChartReactAPI and don't need a re-initialization:

  • theme — changeTheme
  • symbol and timeframe — changeInstrument, changePeriod, setTimeframePreset
  • studies — setStudies, setStudiesByIds, addCustomStudy, removeCustomStudy
  • drawings — addDrawing, removeDrawing, registerCustomDrawings
  • chart settings and chart type — setChartSettings, changeChartType
  • trading — setTradingQuantity and the other setTrading* methods
  • localization — updateLocalization

chartReactConfig and initialChartConfig are read once, when ChartReactApp is created. To change a config option at runtime (for example, the list of available drawings), re-mount the chart: change the React key of ChartReactApp, or call destroy() on the object returned by createChart and create the chart again.

To keep the user's state across a re-initialization, keep it in your providers: when the chart is created again, it loads the saved layout (symbol, aggregation, studies, drawings and chart settings) from your LayoutProvider.

reference — Supported APIs, Getting started with API, Config override, Layout Provider


Q436: For “modules / add-ons” (drawings, studies, chart types) can we build and register our own custom add-ons (custom drawings, custom indicators/studies, custom overlays, custom chart types), or are we limited to the built-in modules? If custom is supported, what extension API exists and what are the compatibility guarantees across versions?​

A: Custom studies — yes, in JavaScript. Add them at runtime with ChartReactAPI.addCustomStudy() and persist them with a Custom Studies Provider.

Custom drawings — yes. Register drawing definitions at runtime with ChartReactAPI.registerCustomDrawings(), then add instances with addDrawing(). See Custom Drawings.

Custom overlays — if you mean custom data series — yes. For other canvas graphics, use a custom drawer.

Custom chart types — chart.chartComponent.registerDataSeriesTypeDrawer(type, drawer) registers a drawer for a new series type, or replaces the default drawer of an existing type such as 'candle'.

Compatibility: extension APIs follow the same versioning and migration policy as the rest of the library (see Q453). Changes that need action on your side are listed in the Migration guide.

reference — Custom studies, Custom Studies Provider, Custom Drawings, Data series, Custom drawer, ChartComponent API, Migration guide


Q437: Candle data contract (REST history + WS (SSE) live updates)​

Do you have a reference implementation for REST snapshot + WS (SSE) incremental candles in JSON?

A: Yes, the Chart Data Provider page has examples. The chart doesn't connect to your backend itself, so any transport works: return the REST snapshot from requestHistoryData, and push each incremental candle from your WebSocket or SSE stream to the callback you receive in subscribeCandles. The chart calls unsubscribeCandles when it no longer needs the stream. Candles are plain JSON objects of type ChartCandleData (time, open, high, low, close, volume).

reference — Chart Data Provider — Data flow, Chart Data Provider — Candle data fields, Provider setup examples — Chart Data Provider


Q438: Which fields are mandatory for candles (OHLCV + time), and which fields are optional but supported?​

A: In ChartCandleData, the type that requestHistoryData and the subscribeCandles callback use, the required fields are time (candle timestamp in milliseconds), open, high, low, close and volume. Optional fields:

  • id — generated from the timestamp, prices and volume if omitted
  • impVolatility — when provided, the Momentum indicator offers Implied Volatility as a price option
  • openInterest
  • typicalPrice — used by the built-in VWAP indicator; replaces the deprecated vwap field

reference — Chart Data Provider — Candle data fields, Chart Data Provider — Data fetching using requestHistoryData


A: Handle these in your data provider; the chart doesn't detect gaps or reconnects on its own.

  • Market closed: send only the candles that exist. Candles are placed one after another, so periods without candles don't leave empty space on the chart.
  • Reconnect: reconnect your feed and resume pushing updates to the subscribeCandles callback. The chart keeps its subscriptions.
  • Backfill and reconciliation: fetch the missing candles and pass them to the updateCallback you received in requestHistoryData. By default it replaces the whole history, so send the full array. Or pass { mode: 'merge' } as the second argument to merge the candles by timestamp instead.

If you use dxFeed market data, the dxFeed data provider that comes in the package covers these cases.

reference — Chart Data Provider — Handling connection loss, Chart Data Provider — Merging updates into history, dxFeed integration


Q440: Does DXcharts treat the last (in-progress) candle as mutable, while considering historical candles immutable?​

A: Mostly. Live updates from the subscribeCandles callback are matched to the last candle by timestamp: an update with the timestamp of the last candle, or a timestamp inside its period, replaces that candle, and an update with a later timestamp adds a new candle. Historical candles aren't locked, though: a live update whose timestamp matches an older candle replaces that candle as well. To revise history on purpose, use the updateCallback you received in requestHistoryData (see Q439).

reference — Chart Data Provider — Data flow, Chart Data Provider — updateCallback


Q441: In case of overlaps or late updates for the same candle timestamp, how does the engine resolve conflicts (overwrite vs merge vs ignore)?​

A: The latest update wins, and candles are matched by timestamp. A candle with the timestamp of an existing candle replaces that candle as a whole; fields aren't merged. A candle with a newer timestamp is appended. This applies to live updates from the subscribeCandles callback and to updateCallback with { mode: 'merge' }. With the default replace mode, updateCallback replaces the whole history. If your feed can deliver duplicate or out-of-order updates, resolve them in your provider before you push them to the chart.

Your provider can also implement the optional disconnect() and reconnect() methods: ChartReactApp calls reconnect() when it mounts and disconnect() when it unmounts. The dxFeed data provider that comes in the package implements both.

reference — Chart Data Provider — updateCallback, Chart Data Provider — Handling connection loss


Q442: When candle data is revised (e.g. last candle updates or post-reconnect reconciliation), are indicators and studies automatically recalculated, or is this responsibility pushed to the data provider layer?​

A: Studies are recalculated automatically when candle data changes: fully when the history is set or replaced, and again when the last candle is updated or older candles are added by lazy loading. You don't need to trigger it from the data provider. If your provider implements lazy loading, handle the fullData flag so studies get the complete history.

reference — Studies, Chart Data Provider — fullData


Q443: Web Workers usage & requirements: Which subsystems run in workers (studies, aggregation, rendering)? Are workers optional in production, and what changes (if anything) when disableWorkers=true?​

A: Web Workers are used for studies calculations (built-in and custom JS studies), for parsing timezones (the timezone list in the footer) and for building Renko bricks. Rendering runs on the main thread. Candle aggregation isn't done by the chart: your data provider returns candles for the requested aggregation period.

Workers are optional. With disableWorkers: true, the chart uses the synchronous studies provider instead of the worker-based one, so studies are calculated on the main thread; timezones and Renko bricks are calculated on the main thread as well.

reference — Bundling — How it works, API Reference - Configuration — disableWorkers


Q444: CSP + Workers: What is the minimal CSP configuration needed for workers in your default setup?​

A: The production build of the library creates its workers (studies, timezones, Renko) from blob: URLs, so your policy must allow blob: for workers: worker-src 'self' blob:. Without worker-src, browsers fall back to child-src and then to script-src, so a policy whose script-src doesn't include blob: blocks the workers. An example policy to start from:

Content-Security-Policy: default-src 'self'; img-src 'self' blob: data:; font-src 'self' data:; style-src 'self' 'unsafe-inline'; worker-src 'self' blob:; script-src 'self' 'unsafe-eval'
  • style-src 'unsafe-inline': styles are injected at runtime by styled-components.
  • script-src 'unsafe-eval': needed only if you use custom JS studies or custom drawings restored from storage, because their code is compiled with new Function(). DXScript may need it as well.
  • If your data comes from other hosts, add them to connect-src.

If you can't allow blob: workers, set chartReactConfig.disableWorkers: true; the calculations then run on the main thread.

reference — Bundling — Content Security Policy, Bundling — How it works, API Reference - Configuration — disableWorkers


A: The number of charts isn't the main factor: one chart with 10 studies can be heavier than 8 empty charts. We don't publish a "safe" number of charts. In general, share resources, at least data: one provider instance with a subscriptions map, as in our demo, is a good practice. Within one ChartReactApp, the built-in multichart (up to 8 charts) already shares one live subscription per symbol, aggregation and options. Separate ChartReactApp instances on the same page don't share subscriptions, so pass them the same provider instance and cache data in it.

reference — Multichart, Chart Data Provider — Visual lazy loading, Chart Data Provider — Performance: Prefetching chart data


A: It depends on the chart data provider implementation. In our demo we fetch all possible candles (for example, 8000), but visually show only the first 1000. The lazy-loading configuration controls when the next request is made (strategy and startLoadDistance) and can provide a default chunk-size hint (chunkSize, passed as candlesCount). A custom provider can ignore that hint and choose its own size based on symbol and aggregation. You can also implement a provider that fetches only the required older data on each lazy request.

reference — Lazy loading configuration, candlesCount



A: Caching is up to your provider. What the chart does itself:

  • Within one ChartReactApp, charts that show the same symbol, aggregation and options share one live subscription, so subscribeCandles is called once for them.
  • History requests aren't deduplicated: each chart calls requestHistoryData. Cache history in your provider. The visual lazy loading example on the Chart Data Provider page keeps a cache per subscription key and returns it immediately (stale-while-revalidate), so going back to an instrument shows its data at once.
  • Redraws are batched into one repaint per animation frame, and only the canvases affected by a change are redrawn.

Settings that affect load: chartDataOptionsSettings.maxCandlesCount caps the candles each chart keeps; chartDataOptionsSettings.lazyLoading (strategy, requestIntervalMs, chunkSize) controls how history is requested while scrolling. Keep workers enabled (the default) so studies are calculated off the main thread.

reference — Chart Data Provider — Visual lazy loading, Chart Data Provider — Lazy loading configuration, API Reference - Configuration — maxCandlesCount


Q448: High-frequency data buffering/batching: Does the library have built-in buffering/batching for high-frequency updates (e.g., accumulating multiple updates before triggering a render cycle), or should we implement batching/throttling in our data provider layer?​

A: There is no input buffer, but rendering is batched: redraw requests are combined into one repaint per animation frame, so several updates that arrive within one frame are painted once. Each update is still applied to the chart data as it arrives. For high-frequency feeds, batch or throttle in your data provider, for example by pushing the latest state of the forming candle to the subscribeCandles callback at a fixed interval.

reference — Chart Data Provider — Data flow


A: There is no recommended maximum, and by default the chart doesn't limit the number of candles: chartDataOptionsSettings.maxCandlesCount defaults to Number.MAX_SAFE_INTEGER. If you set a limit, the chart drops candles instead of failing: the initial history is cut to the newest maxCandlesCount candles, lazy loading stops requesting older history once the limit is reached, and each new live candle removes the oldest one. Without a limit, the practical constraint is browser memory.

reference — API Reference - Configuration — maxCandlesCount


Q450: Memory footprint scaling: What’s the approximate per-chart memory footprint, and how does it scale with candle count, active studies, and drawings? Especially rendering multiple charts.​

A: We don't collect this information right now. To bound memory per chart, you can cap the candles each chart keeps with chartDataOptionsSettings.maxCandlesCount (see Q449).

reference — API Reference - Configuration — maxCandlesCount


A: We don't run long-session memory tests on our demo platform, so we have no figures to share. Recommended practices:

  • Return an unsubscribe function from observeOrders, observeExecutedOrders and observePositions, and stop your feed subscription in unsubscribeCandles. The chart calls them when it no longer needs the data, for example when the symbol changes.
  • Bound the caches in your providers, for example with an LRU cache, and cap the candles per chart with chartDataOptionsSettings.maxCandlesCount.
  • When you remove a chart, unmount ChartReactApp (or call destroy() on the object returned by createChart). On unmount, the chart calls your data provider's optional disconnect().

reference — Order Provider — Key methods, Chart Data Provider — Data flow, Migration guide — OrderProvider and PositionProvider interface changes


Q452: Rendering/invalidation strategy: What is the canvas invalidation/redraw strategy—full-canvas repaint or dirty-region based—and are there known scenarios that cause excessive repaint/layout thrashing we should avoid?​

A: We have several canvases (you can inspect them in dev tools), and each one is redrawn only when something drawn on it changes; for example, a label update redraws only the canvas that holds the labels. Redraw requests are batched into one repaint per animation frame. There's no dirty-region optimization within a canvas; the split into several canvases works as an alternative.

To avoid unnecessary repaints from your own code, pass canvas ids when you trigger a redraw (chart.bus.fireDraw([canvasId])); fireDraw() without arguments redraws every canvas. In 5.20.x versions before 5.20.6, an idle chart could keep repainting its canvases on every animation frame. This was a defect, fixed in 5.20.6.

reference — Custom drawer — Redraw a specific canvas


Q453: How is DXcharts versioning handled—do you follow SemVer (and what counts as a breaking change)? How are release notes and migration guidance published per version?​

A: For breaking changes we have a Migration guide in our docs, where we describe potential issues and what to change.

We follow SemVer with the exception of the "major" version: breaking changes can come in a minor version. Some patch releases also carry migration notes (for example, 5.20.2 and 5.20.4), so check the Migration guide before every upgrade. We notify you by email before such changes and update the Migration guide.

You receive release notes with each release.

reference — Migration guide


Q454: Are we allowed/able to modify the DXcharts codebase itself (e.g., patch a bug, add a missing hook) and ship that in production? If yes, under which commercial model (source access, escrow, IP ownership options) and what does the workflow look like (forking vs vendor-provided patch builds vs “customer patch queue”)?​

A: It depends on the license agreed on. In general you submit a support request to our product and we review it. If it’s a bug that’s affecting the library we prioritize and fix it. If it’s a missing functionality/feature we might be able to introduce it in the future at some point.

If you would like to have full control over the whole product then you would need to go with the source code approach

reference — Plugins


Q455: For ZIP and Nexus approaches are there any differences in terms of version management and updating? Which one would you suggest?​

A: Normally we send you the packages as a ZIP file under specific licensing conditions; which option is available to you depends on your license agreement. Both install the @dx-private packages (dxchart5-core, dxchart5-modules, dxchart5-react, dxstudies). They differ in how you update:

  • Nexus npm registry: change the versions in package.json and reinstall with your package manager.
  • ZIP file: you receive a new archive for each version; replace the local package folders and reinstall them.

reference — ZIP file installation, Getting started with DXcharts React — Installation from Nexus npm registry


Q456: (Widget) Where can I find the different options for this setting I found in the config override page. "timeframePresets": { "mode": "full" }. Are there other modes than "full"?​

A: There are three modes:

export type PartialTimeframePresetsConfigMode = 'full' | 'default' | 'none';
  • 'full' (default): the timeframe presets in the footer, with buttons to add and edit presets
  • 'default': the presets only, without the add and edit buttons
  • 'none': no timeframe presets

reference — API Reference - Configuration — timeframePresets.mode, Ways to customize DXcharts widget — Config override


Q457: (Widget) I wanted to remove the compare button in the top toolbar. Do you have any documentation on what exactly is possible with the widget so I can move on and don't need to try?​

A: Dealing with compare icon is much easier via config which is similar between library and widget so you can fully rely on this doc: Config override. The widget takes the same chartReactConfig in dependencies.

Here is the code sample for you that will hide compare and snapshot:

dependencies: {
chartReactConfig: {
toolbar: {
enabled: true,
buttons: {
snapshot: { enabled: false },
compareChart: { enabled: false },
},
},
},
},

reference — Ways to customize DXcharts widget — Config override, Config override — Full config reference


Q458: Occasionally, we need to jump back in time and have successfully used the removeDataFrom function to do so. However, after removing the excess candles, the chart position is not ideal. It would be extremely helpful to have a way to move the last remaining candle to a given position on the x-axis of the chart without resetting the zoom level, as preserving the current zoom is crucial for a smooth user experience.​

A: After removeDataFrom is used you can use chart API function called moveXStart, which preserves zoom and creates a proper scale. It only moves the X scale without changing the zoom level, plus it respects the minCandlesOffset config.

Example of usage:

const dataPoints = chart.chartModel.mainCandleSeries.dataPoints;

chart.data.removeDataFrom(dataPoints[dataPoints.length - 30].timestamp);

const lastCandle = chart.chartModel.getLastVisualCandle();
if (lastCandle) {
const chartWidth = chart.scale.getBounds().width;
const currentZoom = chart.scale.zoomX;
const offsets = chart.scale.getOffsets();

const xEnd = lastCandle.startUnit + lastCandle.width + offsets.right;
const xStart = xEnd - chartWidth * currentZoom;

chart.scale.moveXStart(xStart);
}

You can also modify the logic of xStart variable to set X scale wherever you want.

reference — Data series — Remove a data series, Scaling — API axis range


Q459: Is it possible to hide the left, top, and bottom toolbars and use a single custom bottom toolbar instead? Also, can we support a bottom-sheet style mobile integration? The docs only mention customizing the top toolbar. Is it possible to customize the candle shape (e.g., slightly rounded edges, etc.)?​

A: Same as Q427 and Q428.

Toolbar:

There is an example for top toolbar: Overriding the Toolbar component

And the same can be applied to other UI overrides, here are the overrides for all toolbars: top, side and footer:

Toolbar: {
ToolbarButtons: Array<ToolbarButtonDeclaration>;
ToolbarContainer: Element;
ToolbarComponent: ComponentType<ChartToolbarProps>;
CompareChartSuggest: ComponentType<CompareChartSuggestComponentProps>;
}
DrawingsSidebar: {
DrawingsSidebarComponent: ComponentType<OverrideProps<DrawingSidebarProps>>;
DrawingsSidebarHeader: ComponentType<OverrideProps<DrawingsSidebarHeaderProps>>;
DrawingsSidebarFooter: ComponentType<OverrideProps<DrawingsSidebarFooterProps>>;
}
Footer: {
FooterComponent: ComponentType<OverrideProps<ChartFooterProps>>;
TimeZoneComponent: ComponentType<OverrideProps<TimeZoneDropdownProps>>;
TimeframePresetsComponent: ComponentType<OverrideProps<TimeframePresetsProps>>;
DrawingGroupsDropdown: ComponentType<OverrideProps<TimeframePresetsProps>>;
SwitchAxisButtonsProps: ComponentType<OverrideProps<SwitchAxisButtonsProps>>;
}

Candle shapes:

You can use chart.chartComponent.registerDataSeriesTypeDrawer to change the candles drawing.

const RoundedCandleDrawer = {
config: chart.config.components.chart,

draw(ctx, points, model, hitTestDrawerConfig) {
if (!model.colors?.candleTheme) return;

const visualCandles = points.flat();
ctx.lineWidth = this.config.candleLineWidth || 1;

for (const visualCandle of visualCandles) {
this.drawRoundedCandle(ctx, hitTestDrawerConfig, model, visualCandle);
}
},

drawRoundedCandle(ctx, hitTestDrawerConfig, candleSeries, visualCandle) {
const { candleTheme, activeCandleTheme } = candleSeries.colors;
const direction = visualCandle.name;
const currentCandleTheme = visualCandle.isActive ? activeCandleTheme : candleTheme;

const baseX = candleSeries.view.toX(visualCandle.startUnit);
const width = candleSeries.view.xPixels(visualCandle.width);
const bodyH = visualCandle.bodyHeight(candleSeries.view);

const [lineStart, bodyStart, _bodyEnd, _lineEnd] = visualCandle.yBodyKeyPoints(candleSeries.view);
const bodyEnd = bodyStart === _bodyEnd ? bodyStart + 1 : _bodyEnd;
const lineEnd = lineStart === _lineEnd ? lineStart + 1 : _lineEnd;

const candleColor = currentCandleTheme[`${direction}Color`];
const wickColor = direction === 'none' ? candleColor : currentCandleTheme[`${direction}WickColor`];

// Drawing a wick
if (this.config.showWicks) {
ctx.strokeStyle = hitTestDrawerConfig.color || wickColor;
ctx.beginPath();
const wickX = visualCandle.x(candleSeries.view);
ctx.moveTo(wickX, lineStart);
ctx.lineTo(wickX, bodyStart);
ctx.moveTo(wickX, bodyEnd);
ctx.lineTo(wickX, lineEnd);
ctx.stroke();
}

// Padding
const paddingPercent = this.config.candlePaddingPercent || 0.25;
const paddingWidthOffset = Math.max((width * paddingPercent) / 2, 1);
const paddingBaseX = baseX + paddingWidthOffset;
const paddingWidth = width - paddingWidthOffset * 2;

// Rounding radius (adapts to the width of the candle)
const radius = Math.min(paddingWidth / 4, Math.abs(bodyH) / 4, 5);

// Draw the candle body with rounded corners
ctx.fillStyle = hitTestDrawerConfig.color || candleColor;
ctx.beginPath();

if (ctx.roundRect && radius > 0 && paddingWidth >= 4) {
ctx.roundRect(paddingBaseX, bodyStart, paddingWidth, bodyH, radius);
} else {
ctx.rect(paddingBaseX, bodyStart, paddingWidth, bodyH);
}

ctx.fill();

// Border (optional)
if (this.config.showCandlesBorder) {
ctx.strokeStyle = hitTestDrawerConfig.color || wickColor;
ctx.stroke();
}
},
};

chart.chartComponent.registerDataSeriesTypeDrawer('candle', RoundedCandleDrawer);

// then you probably would need to fireDraw() to apply changes
chart.mainCanvasModel.fireDraw();

You can get access to certain chart via onApiCreated:

const onApiCreated = (api: ChartReactAPI) => {
api.onChartCreated((chartId, chart) => {
chart.chartComponent.registerDataSeriesTypeDrawer('candle', RoundedCandleDrawer);
});
};

reference — Overriding the Toolbar component, Overriding the Footer component, Overriding the Sidebar component, UI overrides — Available UI overrides (type definition), ChartComponent API


Q460: How to get access to drawingsComponent after click?​

A: Same as Q426. Here is the changes to get access to drawingsComponent after click onSelect:

// this could be other way on your choice to transfer data to the menu item, just for example
const chartInstancesRef = useRef<Map<string, ChartWithModules>>(new Map());

const getDrawingsComponent = (chartId = '0') => {
const chartInstance = chartInstancesRef.current.get(chartId);
if (chartInstance) {
return chartInstance.drawings;
}
console.warn('Chart instance not ready yet');
return null;
};

const onApiCreated = (api: ChartReactAPI) => {
api.onChartCreated((chartId, chartInstance) => {
chartInstancesRef.current.set(chartId, chartInstance);
const drawingsComponent = chartInstance.drawings;
console.log('>>>>>>>>>>>>>>>>> ' + chartId, drawingsComponent);
});
};

const CustomBackgroundItem = () => {
return createElement(
MenuItem,
{
value: 'custom-bg',
onSelect: (a: unknown) => {
const drawingsComponent = getDrawingsComponent('0');
const drawings = drawingsComponent?.getDrawings();
if (drawingsComponent) {
console.log('on Select', { a, drawingsComponent, drawings });
}
},
},
createElement('span', null, 'Create signal'),
);
};

const customDrawingsMenuElements: DrawingsMenuElementDeclaration[] = [
createElement(CustomBackgroundItem),
'BringToFrontButton',
'SendToBackButton',
'MenuDivider',
'LockDrawingButton',
'HideDrawingButton',
];

const rightClickMenus = {
DrawingsMenuElements: customDrawingsMenuElements,
};

return createElement(ChartReactApp, {
dependencies,
onApiCreated,
uiOverrides: { rightClickMenus },
});

reference — Accessing DrawingsComponent from DXcharts React, Overriding right-click menu elements — Adding custom items


Q461: We also need support with adding indicators to the chart programmatically. We don't mean custom indicators, but the existing built-in ones. What we want is an API/function where we can pass indicator parameters (e.g., period, source, etc.), have the indicator added via your indicator module, and then rendered on the chart. We couldn't find documentation for this in your docs.​

A: Same as Q429. There is a way to add indicators programmatically, to do so you need to:

  1. Get the indicator template from DEFAULT_STUDIES_LIST
  2. Convert the template to the Option type format with fromRawStudiesSettings (required by current setStudies API) and change the values you need
  3. Call api.setStudies() in the onApiCreated callback

Step 1: Get Indicator Templates

First, import DEFAULT_STUDIES_LIST to access all available indicator definitions:

import { DEFAULT_STUDIES_LIST } from '@dx-private/dxchart5-react/dist/config/studies-list';

// Get all available indicators with their default parameters
const allStudies = DEFAULT_STUDIES_LIST();

// Find a specific indicator template
const smaTemplate = allStudies.find(s => s.id === 'SMA');

Step 2: Understanding the Option Type

The setStudies method expects parameters and lines in Option format from fp-ts library, while the templates from DEFAULT_STUDIES_LIST hold plain values. Convert a template with fromRawStudiesSettings, then wrap only the values you change with some from fp-ts/Option (fp-ts is a dependency of @dx-private/dxchart5-react; add it to your own dependencies to import it directly):

import { some } from 'fp-ts/Option';
import { fromRawStudiesSettings } from '@dx-private/dxchart5-react/dist/chart/model/studies.model';

Step 3: Add Indicator on Application Start

Use the onApiCreated callback to add indicators when the chart is ready:

import { some } from 'fp-ts/Option';
import { ChartReactAPI } from '@dx-private/dxchart5-react/dist/chart/view-models/api/chart-react-api.view-model';
import { TStudySettings, fromRawStudiesSettings } from '@dx-private/dxchart5-react/dist/chart/model/studies.model';
import { DEFAULT_STUDIES_LIST } from '@dx-private/dxchart5-react/dist/config/studies-list';

const onApiCreated = (api: ChartReactAPI) => {
// Find SMA template to use as a base
const smaTemplate = DEFAULT_STUDIES_LIST().find(s => s.id === 'SMA');

if (!smaTemplate) {
console.error('SMA indicator template not found');
return;
}

// Convert the template to the Option format. This also gives the study a new unique uuid,
// and keeps every parameter and line the indicator needs, including hidden ones.
const sma = fromRawStudiesSettings(smaTemplate);

// Create SMA indicator with custom parameters
const customSMA: TStudySettings = {
...sma,
// Change Length from the default 9 to 20
parameters: sma.parameters.map(parameter =>
parameter.id === 'length' ? { ...parameter, value: some(20) } : parameter,
),
// Change the line color and thickness
lines: sma.lines.map(line => ({
...line,
thickness: some(2),
colors: some(['#FF0000']),
})),
};

// Add the indicator to chart with id '0'
api.setStudies([customSMA], '0');
};

And pass it to Chart Component:

<ChartReactApp
// ... other props
onApiCreated={onApiCreated}
/>

Available Indicator IDs

You can find all available indicator IDs by importing DEFAULT_STUDIES_IDS:

import { DEFAULT_STUDIES_IDS } from '@dx-private/dxchart5-react/dist/config/studies-list';

// Examples:
// DEFAULT_STUDIES_IDS.SMA
// DEFAULT_STUDIES_IDS.MACD
// DEFAULT_STUDIES_IDS.BollingerBands
// DEFAULT_STUDIES_IDS.RelativeStrengthIndex (RSI)

setStudies replaces the chart's whole list of studies. To keep the studies that are already on the chart, include them: api.setStudies([...api.getChartInfo('0').studies, customSMA], '0'). If you only need built-in indicators with default parameters, api.setStudiesByIds(['SMA', 'MACD']) is enough.

reference — Studies, Supported APIs


Q462: We are only using the parameters required for the corresponding indicator. What would be another reason for this? We can successfully show those studies (indicators) in the added list; there is no problem with that. The problem is visualization, and we cannot add default indicators (from the UI) to this list when we automatically add those indicators. Could you please further explain how to implement this feature?​

A: The usual cause is incomplete parameters or lines. Every study has its own parameters and lines, and if one is omitted the indicator isn't displayed correctly. Check StudyParameterType for the valid studyParamType values, and check the browser console for errors and warnings.

Important: parameters and lines properties must match for every indicator.

/*
Not every indicator has one line. Lines need to match for every indicator to avoid issues.
Easiest way is to modify lines in place to prevent missing something.
Or construct them separately but need to be careful and pass the correct lines.
*/
lines = baseTemplate.lines.map(line => ({
...line,
colors: some([getRandomColor()]),
studyLineType: some('LINEAR'),
thickness: some(2),
}));

setStudies replaces the chart's whole list of studies. To keep the indicators the user added from the UI, include them in the list you pass, for example api.setStudies([...api.getChartInfo(chartId).studies, ...yourStudies], chartId).

To create drawings programmatically, use drawings.setDrawing (or ChartReactAPI.addDrawing) and provide all key points: a line needs two, and most other drawings need more than one.

Important: drawings may not appear if their points are outside the loaded data. The timestamp of each point must be between the first and the last candle on the chart.

Use strict TypeScript settings when you work with the library; they catch many of these mistakes at compile time.

reference — Studies, Accessing DrawingsComponent from DXcharts React — Adding drawings from external storage, Custom Drawings — Add and remove instances


Q463: (Widget) I have a chart with one layout - Default Layout - which was created by the library (5.17.1) and which I saved to our back-end. When I make any change to the chart (e.g., scrolling it back in time slightly), updateLayout() is called, as expected. However, when I inspect the passed-in parameter (chartLayoutWithId), it's missing a large amount of data that was in the layout before updateLayout() was called.​

A: This is expected. Since 5.17.0, the chartCoreConfig and chartReactConfig parts of a stored layout contain only the values that differ from the defaults, to keep layouts small. The defaults include what you pass in initialChartConfig and initialChartReactSettings, not only the library defaults:

  • If the layout has the same value as your initialChartConfig (for example, volumes: { visible: false } in both), the layout doesn't store it.
  • Values that are set back to their defaults, such as scale.auto or trading, are removed from the layout.
  • When nothing differs, chartCoreConfig and chartReactConfig are saved as empty objects.

When the layout is loaded, the chart merges these configs with the current defaults, so nothing is lost. Values that a layout doesn't store follow your current initialChartConfig: if you change it later, saved layouts pick up the new values.

reference — Layout Provider — Layout configs store only non-default values, API Reference - Configuration


Q464: We installed the latest chart build, 5.17.1. We now get the following error message when attempting to change the symbol.​

A: The likely cause is the changed signatures of observeOrders, observeExecutedOrders and observePositions. Since 5.17.0 they must return an unsubscribe function instead of void. The chart calls that function when the symbol changes, so a provider that still returns nothing throws an error at that moment.

Return a function that stops your subscription, as in the examples in the Migration guide. If there is nothing to clean up, return () => {}; at the end of the method is enough.

reference — Migration guide — OrderProvider and PositionProvider interface changes, Order Provider — Key methods, Position Provider — Key methods