Skip to content

ChartPanel (Kittox Enterprise only)

The ChartPanel is a data panel controller that renders interactive charts using Chart.js. It displays a ViewTable's records as a chart with an optional data grid sidebar.

The ChartPanel is typically used as a CenterController inside a List controller, which provides filtering capability and a grid sidebar. The chart refreshes automatically when filters change.

The available chart types are: Bar, Line, Pie, and Doughnut. Bar and Line are cartesian charts (with X and Y axes), while Pie and Doughnut display slices proportional to data values.

Cartesian charts (Bar, Line)

Cartesian charts map a category field to one axis and a numeric field to the other. The chart type is determined by the Series/Series/Type value.

Bar chart example

yaml
Controller: List
  CenterController: ChartPanel
    Chart:
      Type: Cartesian
      Axes:
        Axis:
          Position: Left
          Title: _(Duration in hours)
        Axis:
          Type: Category
          Position: Bottom
      Series:
        Series:
          Type: Bar
          XField: TYPE_NAME
          YField: DURATION
          Highlight:
            StrokeStyle: black
            FillStyle: gold
          Label:
            Field: DURATION
            Display: insideEnd
  WestController: GridPanel
    Width: 500

MainTable:
  IsReadOnly: True
  Model: ACTIVITY_BY_TYPE

The WestController: GridPanel places a data grid to the left of the chart, showing the same data in tabular form. You can also use EastController: GridPanel to place the grid to the right. A draggable splitter between the grid and the chart allows the user to resize both areas interactively.

Bar Chart example from TasKitto

Series configuration

Each Series node under Chart/Series defines a data series:

PropertyDescription
TypeChart type: Bar or Line
XFieldField name for the X axis (category labels)
YFieldField name for the Y axis (numeric values)
TitleDisplay name for the series (shown in legend and tooltips)
Highlight/StrokeStyleStroke color when hovering a bar (e.g., black)
Highlight/FillStyleFill color when hovering a bar (e.g., gold)
Label/FieldField name whose value is displayed as a label on each bar
Label/DisplayLabel position: insideEnd, insideStart, outside

Axes configuration

Axes are defined under Chart/Axes as Axis subnodes:

PropertyDescription
PositionAxis position: Left, Right, Bottom, Top
TitleAxis title (localizable with _())
TypeAxis type: Category for labels (default for X), numeric for values

Polar charts (Pie, Doughnut)

Polar charts display data as slices of a circle. The chart type is Polar, and the series type determines the specific rendering.

Pie chart example

yaml
Controller: List
  EastController: GridPanel
    Width: 400
  CenterController: ChartPanel
    Chart:
      Type: Polar
      Theme: Muted
      Sprites:
        Sprite:
          X: 20
          Y: 35
          Text: _(Activities By Type)
          FontSize: 22
      Series:
        Series:
          Type: Pie3D
          AngleField: DURATION
          Label:
            Field: TYPE_NAME
            CalloutLine:
              Length: 60
              Width: 2
          Highlight:
            Margin: 40
          Title: _(Duration)
          Thickness: 50
          Distortion: 60
          Bevel: 20
          Donut: 50
      Legend:
        Docked: left
        Padding: 10
        Toggleable: True
      InnerPadding: 20
      InsetPadding: 50

MainTable:
  IsReadOnly: True
  Model: ACTIVITY_BY_TYPE

Pie Chart example from TasKitto

Pie/Doughnut series properties

PropertyDescription
TypePie, Pie3D
AngleFieldField name whose values determine slice sizes
Label/FieldField name for slice labels
Label/CalloutLine/LengthLength of the callout line connecting the label to the slice
Label/CalloutLine/WidthWidth of the callout line
TitleSeries title (displayed in tooltips)
DonutIf > 0, renders as a doughnut chart with the specified hole size
ThicknessThickness of the 3D effect (Pie3D only)
DistortionPerspective distortion amount (Pie3D only)
BevelBevel size of the 3D effect (Pie3D only)
Highlight/MarginExpansion margin when hovering a slice

Chart options

General options defined directly under the Chart node:

PropertyDefaultDescription
TypeChart type: Cartesian or Polar
ThemeColor theme for the chart (e.g., Muted)
InnerPadding0Padding between the chart area and the series
InsetPadding0Padding between the chart container and the chart area

Chart title

Use the Sprites/Sprite node to set a chart title:

yaml
Chart:
  Sprites:
    Sprite:
      Text: _(My Chart Title)
      FontSize: 22
      X: 20
      Y: 35
PropertyDescription
TextTitle text (localizable with _())
FontSizeFont size in pixels
XHorizontal position offset
YVertical position offset

If X and Y are omitted, the title is rendered centered above the chart area.

Legend

Configure the legend under Chart/Legend:

PropertyDefaultDescription
DockedtopLegend position: top, bottom, left, right
Padding0Padding around the legend area
ToggleableFalseIf True, clicking a legend item toggles the visibility of the corresponding data series

If no Legend node is defined, the legend is hidden for cartesian charts and shown at the top for polar charts.

Grid sidebar

A common pattern is to display both the chart and a data grid. Use WestController or EastController to place a GridPanel alongside the chart:

yaml
Controller: List
  CenterController: ChartPanel
    Chart:
      # ...chart config...
  WestController: GridPanel
    Width: 500

The grid and chart share the same data source and both respond to filter changes.

Automatic colors

Chart.js colors are automatically assigned from a built-in palette of 12 colors. Each data point (or series) receives a distinct color in a cyclic pattern. No manual color configuration is required.

Released under Apache License, Version 2.0.