# How to map sorted values on x-axis to integers

**URL:** https://discuss.elastic.co/t/how-to-map-sorted-values-on-x-axis-to-integers/121041
**Category:** Kibana
**Created:** [February 22, 2018, 12:05pm UTC](https://discuss.elastic.co/t/how-to-map-sorted-values-on-x-axis-to-integers/121041 "2018-02-22T12:05:44Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [February 22, 2018, 5:12pm UTC](https://discuss.elastic.co/t/how-to-map-sorted-values-on-x-axis-to-integers/121041/2 "2018-02-22T17:12:22Z")

</div>

The easiest way would be to use either Timelion or the Visual Builder for this.

Here's one post where a user is doing the offset in Timelion;

> [@Timelion and ISO Week](https://discuss.elastic.co/t/timelion-and-iso-week/115238):
>
> Hi there, I would like to compare two weeks with: .es(index=my-index, metric="sum:sessions").label('past week'), .es(index=my-index, metric="sum:sessions", offset=-1w).label('prev week') At the moment with offset=-1w I get one day more then expected and after that every day duplicated in the timeline (x-axis) so how do I tell Kibana that I want to get an iso week?

And a tutorial here which includes offset time;

> **[Getting Started with Time Series Analysis in Kibana](https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero)**
>
> A tutorial for timelion - the time series composer in Kibana - explaining everything you need to start working with timelion.

And here's some info on the Time Series Visual Builder which can also do offsets;

> **[Kibana Time Series Visual Builder](https://www.elastic.co/blog/master-time-with-kibanas-new-time-series-visual-builder)**
>
> Using Kibana's new time series visual builder feature to analyze and explore time series data living in Elasticsearch.

Regards,  
Lee

---

_[View the full topic](https://discuss.elastic.co/t/how-to-map-sorted-values-on-x-axis-to-integers/121041)._
