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

Offset argument contained a NaN value. #5

Closed
hongmono opened this issue Nov 8, 2021 · 5 comments
Closed

Offset argument contained a NaN value. #5

hongmono opened this issue Nov 8, 2021 · 5 comments

Comments

@hongmono
Copy link

hongmono commented Nov 8, 2021

If I input the volume as 1, I get an error.

@hongmono
Copy link
Author

hongmono commented Nov 8, 2021

I don't want to use Volume

@h65wang
Copy link
Collaborator

h65wang commented Nov 8, 2021

Set volumeHeightFactor: 0 to hide the volume portion.

InteractiveChart(..., style: ChartStyle(volumeHeightFactor: 0,...))

@hongmono
Copy link
Author

hongmono commented Nov 8, 2021

If set it to volumeHeightFactor: 0, the volume chart is not visible. But still...

List<CandleData> data = MockDataTesla.rawData
  .map((row) => CandleData(
  timestamp: row[0] * 1000,
  open: row[1]?.toDouble(),
  high: row[2]?.toDouble(),
  low: row[3]?.toDouble(),
  close: row[4]?.toDouble(),
  volume: 0,
  ))
  .toList();

An error occurs when volume input is zeroed.

@h65wang
Copy link
Collaborator

h65wang commented Nov 8, 2021

I see, this happens when all values are equal.

A workaround (until it's fixed in a future version) is to randomly assign values to them: volume: Random().nextDouble(), ....

@hongmono
Copy link
Author

hongmono commented Nov 8, 2021

Thanks it's works!

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

2 participants