Table of Contents

Dashboards - Technical Details

This page is for users who wish to build custom dashboards. This is still an overview rather than a full manual, and a certain amount of familiarity with SQL and JSON data is assumed.

For clients who wish to have custom dashboards built for them, this is an additional service offered to Venture Tracker clients.

It is also worth noting that some elements of the overall functionality described need to be enabled within the VT configuration and are subject to the specific VT license type as well as user permissions.

VT (SQL) Reports

These are the basic reports used by both the simple VT Reports dashboard, but also at the core of custom dashboards. VT Reports is where a report may be run, but to create a new report, they are found under Admin Items → SQL Reports.

You can develop and test your custom reports directly in the VT Reports section of VT if you have the correct user permissions. If not, you can simply run reports which have already been developed.

Widgets

These are configured within a database table called statistics - if enabled in your global configuration, this will appear under the Admin Menu as 'Dashboard Stats'.

A display widget takes an existing SQL report and displays it on your dashboard with some additional configuration. For example, you can set the colour of the widget and an icon to be displayed (using the font-awesome icon library). To edit, you require manager permissions - see User Classes

To make an SQL report available for use within a stats widget, the SQL Report boolean - 'Used in Stats' - must be True. The stat displayed is either the content of an SQL field called ’total’ or 'count' (case insensitive), if present, or a count of the returned records if not.

Tip: When debugging, beware of using a field called TotalCount or similar. Although your query may aggregate correctly, your widget may not display what you expect. Because the field search doesn’t match either total or count, the display will count number of records, which will always be '1' for an aggregated result set

Finally you can set the order in which widgets will appear in a MiniStats Panel - this is simply a numeric ascending sort.

Once you have built a widget, it can be used in multiple Ministats panels by entering a comma separated list in the Panels field of the widget. You can also disable or enable a widget here. Disabled widgets simply do not display.

Tip: view the statistic from the statistics index table to see a preview as shown here.

Example Reports for widgets

Active BRP Panellists
 
SELECT COUNT(id) AS total 
FROM panellists 
WHERE active=1
 
Active Companies, excluding historic members
 
SELECT COUNT(Company.id) AS total
FROM companies AS Company
LEFT JOIN company_types AS CompanyType ON (Company.company_type_id = CompanyType.id)
WHERE Company.enabled=1
AND CompanyType.title NOT LIKE 'historic%'

Panels

A dashboard is simply a number of panels arranged visually on a page, with each panel showing a different kind of data representation. Panel types include:

Here is a view of the Admin Items → Custom Dashboards table with a list of panels for the example dashboard ‘Our Performance’:

Page Layout for this example will be:

Headlines (Ministats)
Member Outcomes (Pie) Member Sectors (Pie)
Funding (Cell)
Membership by Program (Pie)
Current Companies by Program (Table)

The first row represents a top level entry (no Parent) and is therefore an actual dashboard. The title (Our Performance) will appear under the Dashboards menu. The other rows are child panels within that dashboard, as seen in the Parent column. A dashboard can have any number of child panels.

Child panels display on the page in order as defined by the Order column (numerical, ascending). You may either manually edit, or use the up and down arrow icons to the right of each row on the index table to vary the order.

When adding a new panel to a dashboard, the parent should be chosen from the dropdown list and the title for that specific panel should be entered. To create a new dashboard, no parent will be set. The element type will be one of a number of pre-defined panel types, such as Tables, Pie Charts etc. selected from a dropdown list.

The screen of VT is nominally 12 columns wide, and each panel can therefore be up to 12 columns. In this list, two panels are 6 columns wide, so they will appear side by side in the final layout.

Finally, a dashboard or an individual panel will only display if it is enabled, and if it is a dashboard and set to Private, it will only display if a user is logged into VT. Otherwise, dashboards are visible even without being logged in.

Dashboard / Panel Settings

The following settings can be configured for a top level dashboard or a panel

Dashboard Only Settings

The following settings are only used for a top level dashboard

Parameters

Each panel takes a number of parameters for detailed configuration. The params field must be valid JSON. Details of parameters are given below with each panel type. There is a built in JSON editor to try and ensure correct JSON is written. No additional configuration parameters are needed for a top level entry.

The following settings are common to all panel types

Ministats Panel Params

A Ministats panel will show a collection of statistic widgets (see above). It will select widgets to display based upon a pre-defined panel name, or ‘slug’. All widgets that contain the same slug name in the configuration of the individual widget will be included in the panel, respecting the sort order and the 'enabled' flag set in the statistics table.

A Ministats panel can appear on any dashboard. The same widgets can appear in multiple panels. If you require a different combination of widgets on another dashboard, define a new slug name and add that to the required widgets. This gives a very flexible way of reusing widgets once they have been configured.

Params:

Table Panel Params

This panel will display an existing SQL Report (VT Report) in a tabular view. The required report must be selected in the main panel settings.

Params:

Pie Chart Panel Params

This panel will display an existing VT Report in a pie chart view. The required report must be selected in the main panel settings.

Params:

Example Report for a Pie Chart

Show current active companies by class of membership (company_type)

SELECT CompanyType.title AS 'class', COUNT(Company.id) AS 'value'
FROM companies AS Company
LEFT JOIN company_types AS CompanyType ON (Company.company_type_id = CompanyType.id)
WHERE Company.enabled=1
AND CompanyType.title NOT LIKE 'historic%'
GROUP BY class

For this example, the 'category' parameter would be set to 'class'. The value parameter can be left as default as the field is already called 'value' in the SQL

Cell Panel Params

This panel will display an existing handcoded cell view.

Params:

Cell panels will usually require the assistance of the VT team. If configured incorrectly, they can cause the page to fail to display at all

Other Panel Types are currently in development. The params lists for each panel type will also grow offering further flexibility and display customisation.