# The line char date histogram different metrics are mis-aligned in the x-axis date

**URL:** <https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103>\
**Category:** Kibana\
**Created:** [July 9, 2018, 8:02am UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103 "2018-07-09T08:02:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![guanghaofan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guanghaofan/32/31153_2.png) [@guanghaofan](https://discuss.elastic.co/u/guanghaofan)\
**Post date:** [July 9, 2018, 8:02am UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/1 "2018-07-09T08:02:24Z")

</div>

while changing Metrics `Test Qty` type to `'bar'`  
the bar char adds 2 dummy point before the date point.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/a/7aa38f32732fe52e0bed31523c33dbd451f86504.png)

while changing the type to 'line', all the metrics point are aligned

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/5/156825a83803991ceb6e883ea7726212eac044f8.png)

---

<div class="post-metadata">

**Author:** ![guanghaofan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guanghaofan/32/31153_2.png) [@guanghaofan](https://discuss.elastic.co/u/guanghaofan)\
**Post date:** [July 9, 2018, 8:46am UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/2 "2018-07-09T08:46:54Z")

</div>

I got the workaround that is, set the 'bar' Chart Type Metric as the first one, then all the chart series will aligned with the first one. but this only can align the head but the bar char tail sometimes still missed.  
the last date point is missed sometimes in the dashboard.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/b/ab73f86e70f93e8e3f037aff795b0fc2b52df5be.png)

the last one bar char is missed

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/4/14ad778b8bb25b67363e685c414f3124ba762b53.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [July 9, 2018, 2:43pm UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/3 "2018-07-09T14:43:09Z")

</div>

Hey @guanghaofan, which version of Kibana are you running? Also, can you export the problematic Visualization and attach it here?

---

<div class="post-metadata">

**Author:** ![guanghaofan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guanghaofan/32/31153_2.png) [@guanghaofan](https://discuss.elastic.co/u/guanghaofan)\
**Post date:** [July 10, 2018, 2:08am UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/4 "2018-07-10T02:08:41Z")

</div>

My **Kibana** is **6.2.5-snapshot** version

In this char, the last date point is missed in the bar: 2018-05-15, Qty 1426  
**here is the screen shot**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/1/b1d36b33614b6527d26567b63b6963a421367f85.png)

**the request:**

```
{
  "size": 0,
  "_source": {
    "excludes": []
  },
  "aggs": {
    "2": {
      "date_histogram": {
        "field": "lot_start_time",
        "interval": "1d",
        "time_zone": "Asia/Shanghai",
        "min_doc_count": 1
      },
      "aggs": {
        "1": {
          "avg": {
            "field": "cal_avg_net_test_time"
          }
        },
        "4": {
          "sum": {
            "field": "cal_total_tested_units"
          }
        }
      }
    }
  },
  "stored_fields": [
    "*"
  ],
  "script_fields": {},
  "docvalue_fields": [
    "@timestamp",
    "date",
    "lot_end_time",
    "lot_start_time",
    "system_date",
    "system_time",
    "updated_time"
  ],
  "query": {
    "bool": {
      "must": [
        {
          "match_all": {}
        },
        {
          "match_phrase": {
            "mfg_step": {
              "query": "FT1"
            }
          }
        },
        {
          "match_phrase": {
            "product": {
              "query": "ANUBIS"
            }
          }
        },
        {
          "range": {
            "lot_start_time": {
              "gte": 1524110742000,
              "lte": 1526456967000,
              "format": "epoch_millis"
            }
          }
        }
      ],
      "filter": [],
      "should": [],
      "must_not": []
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![guanghaofan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guanghaofan/32/31153_2.png) [@guanghaofan](https://discuss.elastic.co/u/guanghaofan)\
**Post date:** [July 10, 2018, 2:15am UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/5 "2018-07-10T02:15:05Z")

</div>

**And the converted table since the response is beyond the limit:**  
﻿"lot\_start\_time per day",Qty,"Average cal\_avg\_net\_test\_time"  
1524067200000,2027,"22.883224487304688"  
1524153600000,5296,"23.65998020172119"  
1524240000000,3681,"22.779942648751394"  
1524326400000,3214,"23.12090015411377"  
1524412800000,3858,"22.558071408952987"  
1524499200000,2404,"22.687775135040283"  
1524585600000,4815,"22.196462631225586"  
1524672000000,6533,"23.50210018157959"  
1524758400000,6182,"22.249309921264647"  
1524844800000,6356,"21.75174026489258"  
1524931200000,8029,"23.158120091756185"  
1525017600000,6655,"22.96839244549091"  
1525104000000,7019,"23.082909150557086"  
1525190400000,6592,"23.098969239455002"  
1525276800000,7307,"23.012973403930665"  
1525363200000,6435,"22.794875144958496"  
1525449600000,5761,"23.521509170532227"  
1525536000000,7640,"22.157335826328822"  
1525622400000,7115,"22.613776793846718"  
1525708800000,6148,"22.67639992453835"  
1525795200000,7035,"23.246050039927166"  
1525881600000,4880,"23.57756699456109"  
1525968000000,6868,"22.24150900407271"  
1526054400000,3358,"24.151299794514973"  
1526140800000,2415,"22.969619750976562"  
1526227200000,2132,"22.477224826812744"  
**1526313600000,1426,"26.125600814819336"**

---

<div class="post-metadata">

**Author:** ![guanghaofan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guanghaofan/32/31153_2.png) [@guanghaofan](https://discuss.elastic.co/u/guanghaofan)\
**Post date:** [July 10, 2018, 2:23am UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/6 "2018-07-10T02:23:52Z")

</div>

> Hey @guanghaofan, which version of Kibana are you running? Also, can you export the problematic Visualization and attach it here?

I think this also happens on version **6.3.0** , this is a example that version:  
here you can see the leading and the tail are not aligned across the **bar chart** and the **line chart**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/c/cc9344ad8442763f7c90e3563db586d65eff1a71.png)

---

<div class="post-metadata">

**Author:** ![guanghaofan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guanghaofan/32/31153_2.png) [@guanghaofan](https://discuss.elastic.co/u/guanghaofan)\
**Post date:** [July 10, 2018, 2:40am UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/7 "2018-07-10T02:40:39Z")

</div>

**Another small issue:**

**the chart type are: bar-line-bar** , you can see the two bars are placed partially overlapping.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/e/1eb3ea8c9758952c0f6760915f1c7ccf09ea94fe.png)

**changing to : bar-bar-line** , now this is the normal case!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/b/6b3a19f2c7f99a4c3f2cc6eb0d316c115cb8e0f2.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [July 10, 2018, 12:04pm UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/8 "2018-07-10T12:04:13Z")

</div>

Hey @guanghaofan these seem like two separate bugs, would you mind creating two separate issues for these [here](https://github.com/elastic/kibana/issues/new/choose)

---

<div class="post-metadata">

**Author:** ![guanghaofan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guanghaofan/32/31153_2.png) [@guanghaofan](https://discuss.elastic.co/u/guanghaofan)\
**Post date:** [July 11, 2018, 3:16am UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/9 "2018-07-11T03:16:17Z")

</div>

2 issues created:

> <https://github.com/elastic/kibana/issues/20653>

  

> <https://github.com/elastic/kibana/issues/20654>

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 8, 2018, 3:16am UTC](https://discuss.elastic.co/t/the-line-char-date-histogram-different-metrics-are-mis-aligned-in-the-x-axis-date/139103/10 "2018-08-08T03:16:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
