# Unable to create correct visualization

**URL:** <https://discuss.elastic.co/t/unable-to-create-correct-visualization/216725>\
**Category:** Kibana\
**Created:** [January 27, 2020, 9:15pm UTC](https://discuss.elastic.co/t/unable-to-create-correct-visualization/216725 "2020-01-27T21:15:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![plisovyi](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@plisovyi](https://discuss.elastic.co/u/plisovyi)\
**Post date:** [January 27, 2020, 9:15pm UTC](https://discuss.elastic.co/t/unable-to-create-correct-visualization/216725/1 "2020-01-27T21:15:14Z")

</div>

Hi

I created an index in Elasticsearch using elasticsearch\_dsl python module. This is just sample data, and looks as follows:

 ![Kibana_2](https://us1.discourse-cdn.com/elastic/original/3X/1/4/149e2c9b170dc89fde578f56c599f728c688d654.png)

When I try to create a histogram, Kibana displays only rounded numbers. For instance, for the current parameter, instead of displaying 0.5, it displays 0, and instead of 5.4, it displays 5. Here is an example:

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

Am I missing anything?  
Thank you for your help, I am very new to elk.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [January 28, 2020, 1:26pm UTC](https://discuss.elastic.co/t/unable-to-create-correct-visualization/216725/2 "2020-01-28T13:26:15Z")

</div>

Hi @plisovyi,

the chart should indeed show the unrounded values. A possible cause is that the "Current" field is defined as a non-floating point type in the mapping of your index. Discover shows the raw values passed to Elasticsearch during ingestion, but the visualization is using aggregations which is working with the indexed values.

Could you run `GET /simple_table_1_7/_mapping` in the dev tools console and paste the result here to check whether that's the cause? If it is, you have to change the mapping to a floating point number and re-index your data.

---

<div class="post-metadata">

**Author:** ![plisovyi](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@plisovyi](https://discuss.elastic.co/u/plisovyi)\
**Post date:** [January 28, 2020, 10:18pm UTC](https://discuss.elastic.co/t/unable-to-create-correct-visualization/216725/3 "2020-01-28T22:18:15Z")

</div>

> [@flash1293](#):
>
> `GET /simple_table_1_7/_mapping`

Hi @flash1293

Thank you for your help. I have run the command and it produced the following results:

> {  
> "simple\_table\_1\_7" : {  
> "mappings" : {  
> "properties" : {  
> "Current" : {  
> "type" : "integer"  
> },  
> "Timestamp\_from\_excel" : {  
> "type" : "date"  
> },  
> "Voltage" : {  
> "type" : "double"  
> }  
> }  
> }  
> }  
> }

So my voltage was a double and current was integer - it should be reversed. Have to be more careful. I tried running with these switched, and it now works. For reference, here is the code I am using:

> ```
> from elasticsearch_dsl import Document, Date, Integer, Text, Double
> from elasticsearch_dsl.connections import connections
> from elasticsearch.helpers import bulk
> import csv
> 
> connections.create_connection(hosts=["localhost"])
> class WordCloud(Document):
> Timestamp_from_excel = Date()
> Voltage = Integer()
> Current = Double()
> 
> class Index:
> name = "simple_table_1_7"
> doc_type = "my_type"  
> 
> WordCloud.init()
> with open('Path\\to\\your\\csv\\.csv') as f:
> reader = csv.DictReader(f)
> bulk(
> connections.get_connection(),
> (WordCloud(**row).to_dict(True) for row in reader)
> )
> 
> ```

Thanks again for the help

---

<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:** [February 25, 2020, 10:18pm UTC](https://discuss.elastic.co/t/unable-to-create-correct-visualization/216725/4 "2020-02-25T22:18:18Z")

</div>

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