Skip to main content
All docs
V25.2
  • Create a Dashboard Using the Designer Dialog

    • 6 minutes to read

    This tutorial creates a new application, sets up an in-memory data source, adds a TdxDashboardControl component, and uses the Dashboard Designer dialog to add data-bound Bubble Map and Chart dashboard items to the layout.

    VCL Dashboards: The Resulting Dashboard at Runtime

    Step 1 — Create & Configure a RAD Studio Project

    Create a new Delphi or C++Builder project. Place two components on the form (Tool Palette Category – DevExpress):

    TdxBackendDataConnectionManager
    Manages data sources for all dashboards in your application.
    TdxDashboardControl
    A VCL Dashboard control that displays and autoarranges data analysis elements such as grids, charts, maps, gauges, etc.

    VCL Dashboards: A Form with Required Components

    Create & Configure Data Connection Components

    1. Copy the following connection string. This string points to a sample JSON data file hosted on GitHub by DevExpress:

      Uri=https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/revenuebyindustry.json
      
    2. Double-click the TdxBackendDataConnectionManager component. In the Collection Editor dialog, select AddIn-Memory Data (JSON). This menu item creates a TdxBackendInMemoryJSONConnection component designed to load JSON data and bind it to dashboard items.

      VCL Dashboards: Create a Memory-Based JSON Data Connection Component

    3. Select the created component in the Collection Editor dialog. Paste the copied string to the ConnectionString property editor in the Object Inspector.

      VCL Dashboards: Paste the Path to a JSON File as a Connection String

    Step 2 — Configure a JSON Data Source

    Right-click the TdxDashboardControl component and select the Designer… option[1] to display the Dashboard Designer dialog. Click the hamburger button to display the Dashboard Designer menu:

    VCL Dashboards: The Dashboard Designer Dialog

    Select Data Sources to display the DATA SOURCES pane:

    VCL Dashboards: The Dashboard Designer Menu

    Click Add to display the Add Data Source dialog.

    VCL Dashboards: Display the "Add Data Source" Dialog

    Click Create data source… in the Add Data Source dialog to display the Data Source Wizard.

    VCL Dashboards: Create a Data Source

    Select JSON as the data source and click Next.

    VCL Dashboards: Select "JSON" in the Data Source Wizard

    Select the previously configured JSON connection component and click Next.

    VCL Dashboards: Select the Previously Configured Data Connection Component

    Review loaded dataset fields and click Finish.

    VCL Dashboards: Review and Select Loaded Dataset Fields

    Select the created JSON data source and click Add to close the Add Data Source dialog.

    VCL Dashboards: Add the Created JSON Data Source

    The DATA SOURCES pane lists loaded fields and corresponding data types. Click Save to complete data source configuration.

    VCL Dashboards: Save Pending Data Source Changes

    Step 3 — Create a Bubble Map Item and Bind It to Data

    A bubble map displays values as bubbles on a map according to geopoints and associated values. Bubble sizes reflect values associated with corresponding points on the map.

    Add a Bubble Map to the dashboard. Click the corresponding button on the Toolbox or in the dashboard’s empty area.

    VCL Dashboards: Create a Bubble Map Dashboard Item

    Bind the Bubble Map Item to Data

    Click within the empty map area. Select the Binding (gear) button to display the data binding callout.

    VCL Dashboards: Display the "Binding" Callout

    Click the button under LATITUDE (1) and review the list of compatible data source fields. Select the Latitude field (2).

    VCL Dashboards: Bind the Bubble Map to the "Latitude" Field

    Repeat these steps to configure remaining sections. The following table lists Bubble Map sections, fields used in this tutorial, and corresponding data types:

    Section Data Field Data Type Description
    Latitude Latitude Double The geographic latitude of the data point.
    Longitude Longitude Double The geographic longitude of the data point.
    Weight Revenue Double The bubble size. Higher values correspond to larger bubbles.

    Once you bind all fields to data, the map displays different-sized overlapping bubbles within the USA territory.

    VCL Dashboards: Data Point Bubbles on the World Map

    You can apply currency formatting to the Revenue data field. Click the Revenue button in the BINDING callout, expand the FORMAT group, and select Currency in the FORMAT TYPE combo box.

    VCL Dashboards: Change Value Formatting for the "Revenue" Field

    Configure the Bubble Map

    Click the Options (wrench) button to access map settings:

    VCL Dashboards: Display the "Options" Callout

    Select USA to display all data points on a smaller-scale map.

    VCL Dashboards: Switch to the USA Map

    Change the automatically generated map name to Revenue:

    VCL Dashboards: Rename the Bubble Map Item

    To display a legend pane for bubble sizes, scroll the OPTIONS pane down, expand the WEIGHTED LEGEND group (1), click YES (2), and select a position (3BOTTOM RIGHT, for example).

    VCL Dashboards: Add & Configure a Legend

    Step 4 — Create a Chart Item and Bind It to Data

    Click the Chart toolbox button to add a chart dashboard item under the bubble map.

    VCL Dashboards: Create a Chart Dashboard Item

    Bind the Chart Item to Data

    Select the Binding button (1) for the chart item, click Add Values (2), and select the Revenue field in the expanded pane.

    VCL Dashboards: Bind the Chart to the "Revenue" Field

    Click the Add Argument button (1) and select the Industry field (2).

    VCL Dashboards: Bind the Chart to the "Industry" Field

    Configure the Chart

    Click the Options (wrench) button (1) to access chart settings. Hide the chart caption (2):

    VCL Dashboards: Hide the Chart Caption

    You can change the legend position within the chart area. Expand the LEGEND group (1) and enable the INSIDE DIAGRAM option (2):

    VCL Dashboards: Position the Legend within the Chart Area

    Click the hamburger button and select the Save option.

    VCL Dashboards: Save Layout Changes

    Close the Dashboard Designer dialog.

    Tip

    To display data in the TdxDashboardControl component at design time, right-click the component and select the Show Content option.

    While dashboard content is visible at design time, you can use the green selector in the bottom-right corner to select the component and display its context menu.

    Step 5 — Build & Run Your First App

    Post-Build Events for WebView2 Loader DLL Deployment

    To automatically place a 32 or 64-bit WebView2Loader.dll file into the target build folder, you must:

    1. Open the Project Options dialog (select the ProjectOptions… item in the RAD Studio menu or press Ctrl + Shift + F11).
    2. Select BuildBuild Events in the tree view pane on the left and select the following option in the Target combo box:

      'All Configurations - All Platforms'

      VCL Shared Libraries: Project Options — Select the Target Platform

    3. Copy the following command line:

      copy /Y "$(BDS)\Redist\$(Platform)\WebView2Loader.dll" $(OUTPUTDIR)
      
    4. Paste the DLL deployment command line into the Commands box:

      VCL Shared Libraries: Paste the DLL Deployment Command Line

    5. Click the Save button to apply pending changes and close the Project Options dialog.

    6. Build the project. Confirm that the configured post-build event is trusted in the following dialog:

      VCL Reports: The "Trust this Project" Dialog

    All build operations in the current RAD Studio project now ensure that the platform-specific WebView2Loader.dll file version is available in the target build folder (for both Debug and Release configurations).

    Run & Test the App

    Run the app and move the mouse pointer between map bubbles and chart bars to display corresponding hints.

    VCL Dashboards: The Resulting Dashboard at Runtime

    Note that all dashboard items display predefined service buttons. Use Maximize/Restore Down buttons to temporarily expand an item (and hide others):

    VCL Dashboards: Dashboard Item Buttons

    Click the Export button to export dashboard content to any supported format.

    VCL Dashboards: Dashboard Export Options

    Click the Export button for an individual dashboard item to export its content as a separate document.

    Footnotes
    1. Alternatively, you can double-click the TdxDashboardControl component while content is hidden or unavailable at design time.

      If you displayed dashboard content at design time, right-click the green selector at the bottom-right corner of the TdxDashboardControl area.

    See Also