project-nv / night-vision

Highly customizable charting library, created for professional traders
https://nightvision.dev
MIT License
237 stars 54 forks source link

Gap between candles because of missing weekend data #104

Closed Patricks15 closed 9 months ago

Patricks15 commented 10 months ago

Description

Is there a way to close the gaps between candles, if I only have data for 5 days of the week? So Saturday and Sunday are missing in my data row. (See the screenshot below). Because of that missing days, there is I gap in the chart, I don't like.

I also tried to switch between timestamp and index format, but then I lost the nice timeline on the x-axis.

Suggested solution

Is there already a solution for this problem? My solution would be related to the x axis format? Or can I provide a separate time data, than for all overlays?

Thank you for your help and best regards.

Alternative

No response

Additional context

image

Validations

Patricks15 commented 10 months ago

I added a codesandbox for reproduction and debugging. I build night-vision.min.js on my own and added it.

https://codesandbox.io/embed/debug-night-vision-n7rqcx?fontsize=14&hidenavigation=1&theme=dark

Patricks15 commented 10 months ago

Hey, any updates on this? Is this a bug or is there a setting to avoid this?

robinhuse commented 9 months ago

You can pass indexBased: true in your data configuration to close the gaps. { "indexBased": true, "panes": [ { "overlays": [...

Patricks15 commented 9 months ago

Perfect, that is working. Thank you

andresolbach commented 8 months ago

You can pass indexBased: true in your data configuration to close the gaps. { "indexBased": true, "panes": [ { "overlays": [...

The problem with this is, that the x-axis changes. It's not displaying the right dates for me when I use this. Any other solution?

I just want the Gap to be filled. Like, lets say the last candle is a friday at 10:59pm, then the next candle is a sunday at 11:00pm. Then the whole time from friday 10:59pm to sunday 11:00pm should be nothing, like, it should just straight skip to it to the next candle. Just like in tradingview. Its not showing the timestamps where there is no data (gaps).

Here is e.g. a gap, that should be filled (1 min Timeframe)

image