d60
October 26, 2022, 8:54pm
1
Hello guys,
I would like to shift the following 3 sensor data to a common point in time to see how their changes for each sampling cycle.
Any ide how to achive this?
Each point belongs to a sampling cycle shares a common tag
scott
October 26, 2022, 10:06pm
2
@d60 This is exactly what experimental.alignTime()
was designed to do:
import "experimental"
// your query here
|> experimental.alignTime(alignTo: v.timeRangeStart)
1 Like
d60
October 26, 2022, 10:35pm
3
scott:
import "experimental"
Omg! Awesome!!! Thank you so much!
1 Like
scott
October 26, 2022, 11:02pm
4
Also related this topic—the graphs in the current InfluxDB UI set their view bounds using the queried time range. So when you align the different groupings to a single time, you have a lot of empty space in your graph. There is an open issue (that I created a while ago) proposing an option to set the visual bounds of the graph based on the data that is returned. Feel free to add your opinion to issue thread
opened 08:18PM - 03 Apr 20 UTC
team/ui
team/dumplings
FreeFriday
## IMPORTANT
The Query Experience (QX) team will be handling any changes to v. … variables and time range dropdowns. The original changes proposed below will not be implemented by the Dumplings UI team. For more information contact the PM and Eng Manager of the QX team: @garylfowler and @hralexander
Other ideas that the Dumplings UI team can pursue include but are not limited to:
- Enabling custom x-axis bounds on graphs
- Enabling "Shrink-to-fit" on graphs
---
__Orginal Proposal:__
For line graphs, give users the option to set the graph time range to be based on returned data, not the query time range.
_I know this was changed in https://github.com/influxdata/influxdb/issues/15908._
__Current behavior:__
The graph is always displayed with bounds defined by `v.timeRangeStart` and `v.timeRangeStop`, which I think is a good default behavior, but there are use cases where we may want to base the visualized time range on results.
__Desired behavior:__
I would like an option to have the returned data determine the bounds of the visualization (like it used to). Again, this should just be an option, not the default behavior.
__Alternatives considered:__
Creating a counter in the data to use as the x-axis. The problem is that even when I select that as the metric to use for the x-axis, the graph still honors the `v.timeRangeStart` and `v.timeRangeStop` and the data isn't visualized properly.
__Use case:__
Flux has a new `experimental.alignTime()` function that lets you align input tables to the same starting time making them easy to compare. This will be nice for things like month-over-month comparisons.

I would like the option (for the aligned graph) to have the returned results fill the width of the graph.
1 Like