Panel Chart

The Chart dashboard panel is used for displaying a graphical chart from any data source. Chart types include:

Data sources can come from database queries or AJAX calls.

Form Fields

Examples

Example 1

Create a query to return real-time event data for a line, area, bar, or column chart.

Steps

  1. Go to the Queries UI:

    Configuration -> Databases -> Queries

  2. Click on the Add button, then set the following:

    1. Name => Real-time Event Counts by Severity

    2. Schema => Event

    3. ShardID => 1

    4. User Owner => [Public to All Users In Group]

    5. Group Owner => [Public to All Groups]

    6. Query =>

        SELECT ELT(Severity + 1, 'Normal', 'Unknown', 'Info', 'Minor', 'Major', 'Critical')                                                                                      AS Severity, 
               ELT(Severity + 1, '{"color":"\#66E066"}', '{"color":"\#D088F4"}', '{"color":"\#A1D3FE"}', '{"color":"\#FEFE66"}', '{"color":"\#FED07E"}', '{"color":"\#FE6666"}') AS Meta,
               DAYNAME(FROM_UNIXTIME(FirstReported))                                                                                                                             AS Day, 
               SUM(Count)                                                                                                                                                        AS Count 
          FROM Events
      GROUP BY Severity,
               DAYNAME(FROM_UNIXTIME(FirstReported)) 
      ORDER BY Severity,
               DAYOFWEEK(FROM_UNIXTIME(FirstReported))
      
    7. Click "Submit" to save the query.

  3. Go to the Dashboards UI:

    Configuration -> Dashboards -> Dashboards

  4. Click on the Add button, then set the following:

    • Name => Real-time Event Counts by Severity
  5. Add a "dashboard -> Chart" panel to the dashboard.

  6. Click the "Configure Panel" button, then set the following:

    • Panel Name => Real-time Event Counts by Severity

    • Database Query => Real-time Event Counts by Severity

    • Category Field => Day

    • Value Field => Count

    • Series Field => Severity

    • Meta Field => Meta

    • Click on the "View" button.

  7. Click "Submit" button to save the dashboard.

Example 2

Create a query to return real-time event data for a pie chart.

Steps

  1. Go to the Queries UI:

    Configuration -> Databases -> Queries

  2. Click on the Add button, then set the following:

    1. Name => Real-time Event Counts for Pie

    2. Schema => Event

    3. ShardID => 1

    4. User Owner => [Public to All Users In Group]

    5. Group Owner => [Public to All Groups]

    6. Query =>

      SELECT DAYNAME(FROM_UNIXTIME(LastReported)) AS Day,
             'Alarm Count'                        AS Name,
             SUM(Count)                           AS Count
        FROM Events
      
    7. Click "Submit" to save the query.

  3. Go to the Dashboards UI:

    Configuration -> Dashboards -> Dashboards

  4. Click on the Add button, then set the following:

    • Name => Real-time Event Counts for Pie
  5. Add a "dashboard -> Chart" panel to the dashboard.

  6. Click the "Configure Panel" button, then set the following:

    • Panel Name => Real-time Event Counts for Pie

    • Chart Type => Pie

    • Database Query => Real-time Event Counts for Pie

    • Category Field => Day

    • Value Field => Count

    • Meta Field => Meta

    • Click on the "View" button.

  7. Click "Submit" button to save the dashboard.