Create a Single Value Visualization

Creating a Single Value indicator visualization requires configuring one or more layers. You can use the existing base type templates for a single value.

Here is an example of making a single value indicator:

  1. Add a <config> section and make it dependent on the base type template for a single value indicator:

    {
    	"depends_on" : [ "sv-indicator-template"]
    }
  2. Add a query to your layer file to acquire the data:

    <query name="myquery">
    SELECT count(*) as total FROM mytable
    </query>
  3. Add a step to your <pipeline> to execute the query:

    {
    	"steps" : [
    	    {
    	        "action" : "bigquery_query",
    	        "query_name" : "myquery" 
    	    }
    	]
    }
  4. Add rules to your <mappings> to map the single value from the DataFrame to the visualization. You also specify the title here. Note that the title does not come from the DataFrame, but is instead specified in this file.

    {
    "rules" : [
        {
            "attribute" : "title",
            "value" : "My Title Here"
        },
        {
            "attribute" : "value",
            "column_name" : "total"
        }
    ]
    }
  5. Add the visualization tag to your HTML page.

Note: The sv-indicator-template also allows for configuring the delta change as a green/red arrow. See the template for details.