Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Months / days disappear on timescale sometimes #1654

Open
0x33dm opened this issue Jul 26, 2024 · 1 comment
Open

Months / days disappear on timescale sometimes #1654

0x33dm opened this issue Jul 26, 2024 · 1 comment

Comments

@0x33dm
Copy link

0x33dm commented Jul 26, 2024

Sometimes the time days / months on the time scale will disappear after being rendered.

I'm not sure why tough, the candles are always in there, but time time sometimes disappear.

other than candles i have lines and a baseLineSeries, the baseLine series and price lines are removed / added sometimes could that be the reason?

image

this is how it renders generally:

image

@0x33dm
Copy link
Author

0x33dm commented Jul 26, 2024

Apparently, it has to do with setting data on my baseline series and only specifying 2-time data points ( which is all you need to draw a rectangle on the chart ).

I wouldn't expect to remove labels from my Time Axis in any instance since the candles are never removed from the Time Axis, and they have all the time data points should always be there the same way the Price Axis is always there as well.

Also, I have the impression this wasn't happening before, as I have been using this code for some time, I'm not sure if it has to do with new updates on the library or if I just got lucky before.


Here is how i created it:

baselineSeriesRef.current = chart.addBaselineSeries({
  lastValueVisible: false,
  baseValue: { type: 'price', price: conversionLines[1] },
  topLineColor: healthColors.lineColor,
  topFillColor1: healthColors.bottomFillColor1,
  topFillColor2: healthColors.bottomFillColor2,
  bottomLineColor: 'rgba(0, 0, 0, 0)',
  bottomFillColor1: 'rgba(0, 0, 0, 0)',
  bottomFillColor2: 'rgba(0, 0, 0, 0)'
} as BaselineSeriesPartialOptions)

And here is how i update it:

// remove old data, doesn't seem to create issues
baselineSeriesRef.current?.setData([])

const areaData = [
  {
    time: candles[0].time,
    value: conversionLines[0]
  },
  {
    time: candles[candles.length - 1].time,
    value: conversionLines[0]
  }
]

// updates with new data
baselineSeriesRef.current.setData(areaData)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant