# Latest value for custom dashboard

**URL:** <https://forums.losant.com/t/latest-value-for-custom-dashboard/1635>\
**Category:** Help\
**Tags:** dashboard\
**Created:** [March 20, 2019, 5:13pm UTC](https://forums.losant.com/t/latest-value-for-custom-dashboard/1635 "2019-03-20T17:13:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eckehard\_Fiedler](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@Eckehard\_Fiedler](https://forums.losant.com/u/Eckehard_Fiedler)\
**Post date:** [March 20, 2019, 5:13pm UTC](https://forums.losant.com/t/latest-value-for-custom-dashboard/1635/1 "2019-03-20T17:13:04Z")

</div>

just cannot figure out how to setup the data for a vega bar chart properly.

I used an example for a colored bar chart from vega that shows up correctly:

```auto
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "width": {{block.width}},  
  "height": {{block.height}},   
  "autosize": { "type": "fit", "contains": "padding" },
  "data": {
    "values": [
      { "height": "red", "b": 12 },
      { "height": "green", "b": 28 },
      { "height": "teal", "b": 35 },
      { "height": "brown", "b": 43 }
    ]
  },
  "mark": "bar",
  "encoding": {
    "y": { "field": "height", "type": "nominal" },
    "x": { "field": "b", "type": "quantitative" },
    "color": { "field": "height", "type": "nominal", "scale": null }
  }
}

```

I want to add the latest value from four different devices as bar graf.

Some help would be helpful… Man thanks!

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [March 20, 2019, 6:58pm UTC](https://forums.losant.com/t/latest-value-for-custom-dashboard/1635/2 "2019-03-20T18:58:07Z")

</div>

Good afternoon,

The [Custom Chart Block](https://docs.losant.com/dashboards/custom-chart/#vega-configuration) is a bit more difficult as the Query Name cannot be referenced with Handlebars like in other blocks. I am curious, could the [Bar Chart Block](https://docs.losant.com/dashboards/bar-chart/) be beneficial in your use case? I ask as it may save some time and is much simpler to configure. If the Bar Chart is not a good solution, let me know and we will look further into Vega Lite. 😄

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![Eckehard\_Fiedler](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@Eckehard\_Fiedler](https://forums.losant.com/u/Eckehard_Fiedler)\
**Post date:** [March 20, 2019, 8:27pm UTC](https://forums.losant.com/t/latest-value-for-custom-dashboard/1635/3 "2019-03-20T20:27:53Z")

</div>

Hy Julia,

the current charting possibilities are a bit limited in Losant, so adding Vega (or any other charting lib) will (hopefully) open a way to overcome this limitations. My question was more about undstanding, how to use vega.

There are some diagram types that are very common like carpet plots or scatter plots

![](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/0/0a05626fd4d99646fe5a9c2044d9ba699eafa1cf.jpeg)

Most of this can be provided by Vega light, but might need some data processing first. NodeRed has the perfect way to do nearly “anything” in a well organized function node.

So, I´m curious to find out what we can do with the custom chart block.

Best regards, Eckehard
