Skip to content
Discussion options

You must be logged in to vote

Hey @olegrok,

This functionality is really very common, thanks for highlighting this!

Since v0.3.4 a special TimeScaleFitContentTrigger component designed to ease developer's life is introduced to the library. It has deps prop where you can pass array of any amount of resize triggers.
Following the "React approach" you can provide an empty array to trigger the resize only once when chart is initialized, which is probably the most common scenario.

<TimeScale>
  <TimeScaleFitContentTrigger deps={[]} />
</TimeScale>

If you need to keep the content resized dynamically, for instance, any time chart data updates, you can provide chart data as a trigger, like:

<CandlestickSeries
  data={seriesData}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by olegrok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Questions or requests for clarification
2 participants
Converted from issue

This discussion was converted from issue #126 on June 05, 2025 09:32.