Adding a Sense chart into a Qlik GeoAnalytics map info bubble

    Sometimes it's neat to add a Sense chart into the popup of a layer, here's how to:

    embedchart.png

     

     

    1. Create a empty variable that will contain the id of the object that the diagram will be displayed for. This is done in the dialog that shows when you press the [x=] button at lower left in Sense.

    Example: vCurrCity

     

    2. Create the chart that will be displayed in the info bubble. Make the chart in the same app. The chart should use the variable to restrict the display to the object with the id that is in the variable.

    Example expression: Sum({<City={'$(vCurrCity)'}>}[Sales Amount])

     

    3. Find the id of the chart, using the Dev Hub->Single configurator (Object ID when right chart is selected )

     

    4. In the layer that displays the objects that you want to present info for in the info bubble,  add script that sets the variable to the current id and that shows the chart in a div that should exist in the html.

    Example html in info bubble:

    '<div id="diagram1" style="position: relative; width: 200px; height: 200px;"></div>'&

    '<script>var app = qlik.currApp(); app.variable.setContent("vCurrCity","'&City&'");app.getObject("diagram1","NQSFjMd",{noSelections: false});</script>'

     

    Don't forget to uncheck "Format Numbers" in the Info Bubble properties, otherwise it might not work.