SOLVED

New Contributor

# Dual plot x-axis

Hi everyone,

I am new with Kusto and hope someone can help me.

I habe timeseries sensor data and I am rendering the timestamp on the x-axis and my sensor value on the y-axis.

I would now like to compare the values of the same sensor for different timeframes. Is it somehow possible to either plot different x-axis values in the same graph, split the graph so i can have different x-axis values next to each other, or plot two completely different graphs next to each other.

Any help if it is in general possible and if so, how, would be appreciated.

2 Replies
best response confirmed by TsT89 (New Contributor)
Solution

# Re: Dual plot x-axis

one thought (which may not be great if you have a lot of series to compare, but here goes) would be "normalizing"/aligning the datetime values according to those of one arbitrary "base" series. as shown in the example below:

```let T =
datatable(value:int, dt:datetime)
[
1, datetime(2019-07-18 15:26:01),
2, datetime(2019-07-18 15:27:01),
1, datetime(2019-07-18 15:28:01),
2, datetime(2019-07-18 15:29:01),
3, datetime(2019-07-18 15:30:01),
1, datetime(2019-07-18 15:31:01),
5, datetime(2019-07-18 15:32:01),
0, datetime(2019-07-18 16:26:01),
1, datetime(2019-07-18 16:27:01),
2, datetime(2019-07-18 16:28:01),
3, datetime(2019-07-18 16:29:01),
2, datetime(2019-07-18 16:30:01),
1, datetime(2019-07-18 16:31:01),
0, datetime(2019-07-18 16:32:01),
]
;
let T_base =
T
| where dt between (datetime(2019-07-18 15:00)..1h)
| project series = "15:00 to 16:00", dt, value
;
let T_other =
T
| where dt between (datetime(2019-07-18 16:00)..1h)
| project series = "16:00 to 17:00", dt, value
;
let diff = toscalar(T_other | summarize min(dt)) - toscalar(T_base | summarize min(dt));
T_base
| union
(
T_other
| extend dt = dt - diff
)
| render timechart ```

# Re: Dual plot x-axis

Very cool, I was able to create what I wanted with that approach.

Thank you very much for your effort!