Question

How to add image from my location in the dashboard

  • 31 August 2017
  • 4 replies
  • 3528 views

How to add image from my location in the dashboard


4 replies

Userlevel 4
Badge

@himani.kala


You can follow the steps in this Discourse article to use an image as a dimension.


Alternatively, you can use plain html on a dashboard text tile to render an image, e.g:

<img src="https://your.website.com/your-image.jpg" width="100" height="100"/>


Note that you need to have the image hosted somewhere outside Looker, e.g. AWS S3 or Google Cloud Storage.

We use LookML Dashboards so that we can define standardized elements / layouts / filters once, and extend those “base” dashboards to different models (see more here Who uses LookML dashboards?).


I’d love to have system logos or other dynamic images these dashboards. Currently we’re implementing the approach @brecht linked to, where we have a “system details” explore that contains each system name, time zone, etc., and one of the attributes available there is the system logo.


What’s not ideal about this approach is that we have to use the “table” dashboard element type, which includes a header above the image (see screenshot below). I’ve tried the single_value type, but instead of rendering the image, that displays the text of the URL. I’ve looked at the visualization options for the “table” visualization type, and from what I can tell, you can modify the header text but not remove it.



I’ve come across this description of using markdown to embed images, but it doesn’t seem like you can use liquid, and you can’t reference a Looker dimension from within your Markdown, so I think that approach is out if you want a different image (dynamically) on different dashboards.


Any ideas?

Userlevel 5
Badge

Hey @TimothyBurke,


You’re correct that the table visualization type isn’t going to work here, because there’s no way to get rid of the headers. The markdown approach is also out if you need this to be dynamic, because as you mentioned there isn’t a way to use liquid or reference dimensions in Markdown.


I would say the single-value visualization seems like the way to go. I was able to make a single value viz without any extra text as a UDD; I imagine you could then “Copy Dashboard LookML” and add that to the LookML dashboard. Here are my examples:


- dashboard: pokemonremoteimg
title: PokemonRemoteImg
layout: newspaper
elements:
- name: TestRemoteImageLook
title: TestRemoteImageLook
model: 24349_image_schedule
explore: test
type: single_value
fields:
- test.image
sorts:
- test.image
limit: 500
column_limit: 50
query_timezone: America/Los_Angeles
custom_color_enabled: false
custom_color: forestgreen
show_single_value_title: false
show_comparison: false
comparison_type: value
comparison_reverse_colors: false
show_comparison_label: true
stacking: ''
show_value_labels: false
label_density: 25
legend_position: center
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: true
limit_displayed_rows: false
y_axis_combined: true
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
x_axis_scale: auto
y_axis_scale_mode: linear
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
series_types: {}
title_hidden: true
row: 0
col: 0
width: 24
height: 8

Let me know if this does the trick or if I’m missing something about the dashboard elements you’re using here.

Thanks a lot @sam - I must have been including some mixed parameters, listing out some that were relevant to tables while trying to switch to the single_value type, and that’s why it was displaying the text of the URL instead of the image itself.


When I created a new single value visualization from scratch and selected this dimension, it worked! Looks great!

Reply