Skip to content

Dynamic timeoffset in the bar chart #541

Closed Answered by dbuezas
eiderterra asked this question in Q&A
Discussion options

You must be logged in to vote

try with:

timeoffset: |
  $ex {
     const [from, to] = get('visible_range');
     const hours = (+to - +from) / 1000 / 60 / 60 ;
     const days = hours / 24;
     if (hours <= 24) return "10m";
     if (days <= 31) return "5h";
     return "5d";
  }

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dbuezas
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants