diff --git a/modules/ROOT/images/dashboards/parameters-and-filters/access-parameters-drawer.png b/modules/ROOT/images/dashboards/parameters-and-filters/access-parameters-drawer.png new file mode 100644 index 000000000..086524f2b Binary files /dev/null and b/modules/ROOT/images/dashboards/parameters-and-filters/access-parameters-drawer.png differ diff --git a/modules/ROOT/images/dashboards/parameters-and-filters/customers-located-at-selected-city.png b/modules/ROOT/images/dashboards/parameters-and-filters/customers-located-at-selected-city.png new file mode 100644 index 000000000..17c473ea1 Binary files /dev/null and b/modules/ROOT/images/dashboards/parameters-and-filters/customers-located-at-selected-city.png differ diff --git a/modules/ROOT/images/dashboards/parameters-and-filters/dashboard-unit-param-4.png b/modules/ROOT/images/dashboards/parameters-and-filters/dashboard-unit-param-4.png new file mode 100644 index 000000000..ed2d03d26 Binary files /dev/null and b/modules/ROOT/images/dashboards/parameters-and-filters/dashboard-unit-param-4.png differ diff --git a/modules/ROOT/images/dashboards/parameters-and-filters/filter-by-customer-city.png b/modules/ROOT/images/dashboards/parameters-and-filters/filter-by-customer-city.png new file mode 100644 index 000000000..642998e7c Binary files /dev/null and b/modules/ROOT/images/dashboards/parameters-and-filters/filter-by-customer-city.png differ diff --git a/modules/ROOT/images/dashboards/parameters-and-filters/filter-units-in-stock.png b/modules/ROOT/images/dashboards/parameters-and-filters/filter-units-in-stock.png deleted file mode 100644 index 8f0bae36e..000000000 Binary files a/modules/ROOT/images/dashboards/parameters-and-filters/filter-units-in-stock.png and /dev/null differ diff --git a/modules/ROOT/images/dashboards/parameters-and-filters/london-cypher-query-example.png b/modules/ROOT/images/dashboards/parameters-and-filters/london-cypher-query-example.png new file mode 100644 index 000000000..99575f2a9 Binary files /dev/null and b/modules/ROOT/images/dashboards/parameters-and-filters/london-cypher-query-example.png differ diff --git a/modules/ROOT/images/dashboards/parameters-and-filters/parameters-and-filters.png b/modules/ROOT/images/dashboards/parameters-and-filters/parameters-and-filters.png new file mode 100644 index 000000000..1b3b440a0 Binary files /dev/null and b/modules/ROOT/images/dashboards/parameters-and-filters/parameters-and-filters.png differ diff --git a/modules/ROOT/pages/dashboards/parameters-and-filters.adoc b/modules/ROOT/pages/dashboards/parameters-and-filters.adoc index 4a5e00bcb..fad127424 100644 --- a/modules/ROOT/pages/dashboards/parameters-and-filters.adoc +++ b/modules/ROOT/pages/dashboards/parameters-and-filters.adoc @@ -1,13 +1,17 @@ = Parameters and filters :description: Use parameters in your dashboards to further customize queries or use them in filters for node and relationship properties. - +The main way to make dashboard charts interactive is to add a filter and link it to a card using a parameter. == Parameters Parameters are associated with a specific dashboard. Each parameter has a value and type both of which you can set initially. -Display the parameters of a dashboard by using the parentheses button to show the **Parameters** drawer. +.How to access the parameters drawer +[.shadow] +image::dashboards/parameters-and-filters/access-parameters-drawer.png[] + +Display the parameters of a dashboard by using the parentheses button `{}` to show the **Parameters** drawer. .The parameters drawer [.shadow] @@ -36,6 +40,10 @@ Each parameter has an icon next to it hinting at its data type: === Using a parameter in a query +.How to set up a parameter with a number value of 4 and the name "unit_param" +[.shadow] +image::dashboards/parameters-and-filters/dashboard-unit-param-4.png[width=500] + To use a parameter in a query, prefix the parameter name with `$`. For example, to use a parameter with a number value of 4 and the name "unit_param", use `$unit_param` in your query: @@ -71,11 +79,55 @@ You can use a filter to dynamically set parameter values inside queries. === Adding a filter . In the **Dashboards** page, use **Add filter** at the bottom right. -. In the **Add filter** dialog, select a filter type: a node or relationship type, and a property. -. Use either an existing parameter or create a new one, then **Save**. +. In the **Add filter** dialog, select a filter type: a node or relationship property, date or datetime. +. Link to an existing parameter or create a new one. + +. On the right side of the dialog, there's a preview of the filter card that will be added to the dashboard - it's dynamic so you can use the dropdown too. +. Then **Save**. +. Then the next step is to take that parameter use it in a Cypher query. +. Create a card. + +.Example: Filter by customer city +image::dashboards/parameters-and-filters/filter-by-customer-city.png[] + +=== Example + +We'll make a filter to see which companies are based in a city. + +==== Define the filter: + +. In the **Dashboards** page, use **Add filter** at the bottom right. +. Select the filter type `Node property` +. Select the label `Customer` +. Select the propery `City` + +==== Link the parameter: + +. A parameter called `$customer_city` will be created automatically +. Set the default value to `London` +. **Save** + +==== Add a card: + +In the Cypher input, use the following Cypher query: + +.Cypher query for a table which displays customers within a city +[source,cypher] +---- +MATCH (n:Customer) +WHERE n.city = $customer_city +RETURN n.companyName +---- + +Like this: + +.Cypher query for a table which displays customers within a city +image::dashboards/parameters-and-filters/london-cypher-query-example.png[] + +Then, in your dashboard, you'll have cards with the filter and the table - use the filter to change cities, and you'll see the info in the customer name table change too. -.Creating a filter for the product node property `unitsInStock` -image::dashboards/parameters-and-filters/filter-units-in-stock.png[] +.Filter and table showing customers located at selected city +image::dashboards/parameters-and-filters/customers-located-at-selected-city.png[] [NOTE] ==== @@ -111,4 +163,4 @@ You can select a value from the filter card drop down to let the dashboard assig .Selecting a new value for the unitsInStock filter image::dashboards/parameters-and-filters/filter-and-card.gif[] -All cards which make use of the parameter are updated with the new value. \ No newline at end of file +All cards which make use of the parameter are updated with the new value.