Property description

The definition property defines the chart type and how it visualizes data. Dawiso supports Chart.js chart definitions for versions 4.4.3 and newer.

Example

Minimal JSON

{}
{
  "type": "api-chart",
  "definition": {
    "type": "line",
    "options": {
      "maintainAspectRatio": false,
      "plugins": {
        "legend": {
          "display": false
        }
      },
      "scales": {
        "y": {
          "beginAtZero": true
        },
        "x": {
          "grid": {
            "display": false
          }
        }
      }
    }
  }
}

Example taken from the core_dashboard_adoption package.

Nested properties

PropertyDescriptionValuesMandatory
typeChart type. The following values are supported: bar: Represents data values as vertical bars., doughnut: Represents data similarly to a pie chart but with a cut-out in the middle., line: Represents data values as points on a line., pie: Represents data values proportionally as sections of a circle., polarArea: Represents proportional value of data in a circle with varying radiuses., radar: Represents data as points stacked at an axis with the same central point. See examples of each type in the screenshot above. Note that area, bubble, and scatter chart types are not supported.stringNo
optionsAdditional properties adjusting the chart. You can configure, e.g.: Responsiveness: Responsiveness of the chart in different window sizes, e.g., maintainAspectRatio. For more information, see Responsive Charts in Chart.js documentation., Plugins: Customize the default behavior of a chart, e.g., disabling the legend “legend”: { “display”: false }. For more information, see Plugins in Chart.js documentation., Scales: Configure the x and y axes in a chart (or r for radial charts). For more information, see Axes in Chart.js documentation.jsonNo