Skip to content

ChartPanel ​

Kittox Enterprise feature

The ChartPanel is part of the Kittoˣ Enterprise edition. See the Feature Matrix for the full comparison with the Open-Source edition.

The ChartPanel is a data presenter that renders interactive charts using Chart.js. It displays a ViewTable's records as a chart; a data grid can sit beside it in a region of the hosting List.

The ChartPanel is typically used as a CenterController inside a List controller, which provides filtering capability and hosts the grid sidebar as a real GridPanel in its West or East region. The chart refreshes automatically when filters change and when the grid is refreshed.

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
    Split: True

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, with the standard grid toolbar (sortable columns, Refresh). You can also use EastController: GridPanel to place the grid to the right. Split: True adds a draggable splitter between the grid and the chart so the user can 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
      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

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
    Split: True

The grid and the chart are two presenters of the same List: they share the view table and the filter panel, so a filter change reloads both, and the grid's Refresh button reloads the chart as well. The grid pages and sorts on its own; the chart always plots all the filtered records.

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.

Tooltip on hover ​

A tooltip showing the data point label and value is displayed automatically when the mouse hovers over a chart element:

  • Bar / Pie / Doughnut: hit detection covers the whole bar or slice, so the tooltip is triggered as soon as the cursor enters the shape.
  • Line: line charts use pointRadius: 4 and pointHitRadius: 4 so the hit area matches the visible dot. The tooltip is triggered when the cursor covers the dot itself.

No configuration is required. The chart automatically resizes to fit its container (e.g. when used inside a Dashboard tile or after a window resize) and the hover hit area is kept aligned with the rendered points.

Layout and spacing ​

The chart canvas keeps a consistent 16 px gap from the edges of its host card on all four sides, regardless of chart type. This is applied automatically by the framework — no configuration is needed.

For pie/doughnut charts, the visible margin between the pie circle itself and the canvas may be larger than 16 px on some sides. This is inherent to Chart.js's pie geometry: the pie is inscribed in the chart area (a square fitting inside a possibly-rectangular canvas), and the legend, when docked, occupies space within the chart area, reducing the side opposite to its position.

Released under Apache License, Version 2.0.