# 【Vega-lite】タイムスケール内のデータがグラフに表示されない

**URL:** <https://discuss.elastic.co/t/vega-lite/300342>\
**Category:** 日本語による質問・議論はこちら\
**Tags:** vega\
**Created:** [March 22, 2022, 1:20pm UTC](https://discuss.elastic.co/t/vega-lite/300342 "2022-03-22T13:20:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qoopen0815](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qoopen0815/32/103361_2.png) [@qoopen0815](https://discuss.elastic.co/u/qoopen0815)\
**Post date:** [March 22, 2022, 1:20pm UTC](https://discuss.elastic.co/t/vega-lite/300342/1 "2022-03-22T13:20:42Z")

</div>

[Gantt Chart (Ranged Bar Marks) | Vega-Lite](https://vega.github.io/vega-lite/examples/bar_gantt.html)を参考にしながらグラフを作成しています。  
50個以上の適当なデータを投入して、下記のようなグラフを作成することはできましたが、投入したデータの個数と、グラフに表示されているデータの個数が一致しません。

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

開発者ツールで`VEGA_DEBUG.view.data('hoge')`を使い、読み込んだデータを調べると、10個のデータしか取得できてないことがわかりました。

タイムスケール内のデータをすべてグラフに表示するためにはどこを修正するとよいでしょうか。アイデア等ありましたらよろしくお願いいたします。

> **Vega Liteのコード**
>
> ```json
> {
> "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
> "title": "Demo",
> "data": {
> "name": "hoge",
> "url": {
> "%context%": true,
> "%timefield%": "@timestamp",
> "index": "nested_index-*",
> "size": 10000
> },
> "format": {"property": "hits.hits"}
> },
> "mark": {"type": "bar"},
> "encoding": {
> "y": {
> "title": false,
> "field": "_source.actuator.controller.name"
> },
> "x": {
> "title": "Date/Time",
> "field": "_source.actuator.controller.enable_time",
> "timeUnit": "hoursminutesseconds"
> },
> "x2": {
> "field": "_source.actuator.controller.disable_time",
> "timeUnit": "hoursminutesseconds"
> },
> "tooltip": [
> {
> "timeUnit": "monthdate hoursminutessecondsmilliseconds",
> "field": "_source.actuator.controller.enable_time",
> "type": "temporal",
> "title": "enabled"
> },
> {
> "timeUnit": "monthdate hoursminutessecondsmilliseconds",
> "field": "_source.actuator.controller.disable_time",
> "type": "temporal",
> "title": "disabled"
> }
> ]
> }
> }
> 
> ```

  

> **indexのmapping**
>
> ```json
> {
> "mappings": {
> "properties": {
> "@timestamp": {
> "type": "date"
> },
> "_meta": {
> "properties": {
> "cbm": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> },
> "host": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> },
> "version": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> }
> }
> },
> "actuator": {
> "properties": {
> "controller": {
> "properties": {
> "disable_time": {
> "type": "date"
> },
> "enable_time": {
> "type": "date"
> },
> "name": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> }
> }
> },
> "cylinder": {
> "properties": {
> "stroke_time": {
> "type": "float"
> },
> "timestamp": {
> "type": "date"
> }
> }
> },
> "info": {
> "properties": {
> "location": {
> "properties": {
> "machine": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> },
> "shop": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> }
> }
> },
> "name": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> }
> }
> }
> }
> }
> }
> }
> }
> 
> ```

---

<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:** [April 19, 2022, 1:21pm UTC](https://discuss.elastic.co/t/vega-lite/300342/2 "2022-04-19T13:21:37Z")

</div>

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