<commit_before># Configuration

The configuration is used to change how the chart behaves. There are properties to control styling, fonts, the legend, etc.

## Configuration object structure

The top level structure of Chart.js configuration:

```javascript
const config = {
  type: 'line'
  data: {}
  options: {}
  plugins: []
}
```

### type

Chart type determines the main type of the chart.

**note** A dataset can override the `type`, this is how mixed charts are constructed.

### data

See [Data Structures](../general/data-structures) for details.

### options

Majority of the documentation talks about these options.

### plugins

Inline plugins can be included in this array. It is an alternative way of adding plugins for single chart (vs registering the plugin globally).
More about plugins in the [developers section](../developers/plugins.md).

## Global Configuration

This concept was introduced in Chart.js 1.0 to keep configuration [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself), and allow for changing options globally across chart types, avoiding the need to specify options for each instance, or the default for a particular chart type.

Chart.js merges the options object passed to the chart with the global configuration using chart type defaults and scales defaults appropriately. This way you can be as specific as you would like in your individual chart configuration, while still changing the defaults for all chart types where applicable. The global general options are defined in `Chart.defaults`. The defaults for each chart type are discussed in the documentation for that chart type.<commit_msg>Fix broken link (#10640)<commit_after># Configuration

The configuration is used to change how the chart behaves. There are properties to control styling, fonts, the legend, etc.

## Configuration object structure

The top level structure of Chart.js configuration:

```javascript
const config = {
  type: 'line'
  data: {}
  options: {}
  plugins: []
}
```

### type

Chart type determines the main type of the chart.

**note** A dataset can override the `type`, this is how mixed charts are constructed.

### data

See [Data Structures](../general/data-structures.md) for details.

### options

Majority of the documentation talks about these options.

### plugins

Inline plugins can be included in this array. It is an alternative way of adding plugins for single chart (vs registering the plugin globally).
More about plugins in the [developers section](../developers/plugins.md).

## Global Configuration

This concept was introduced in Chart.js 1.0 to keep configuration [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself), and allow for changing options globally across chart types, avoiding the need to specify options for each instance, or the default for a particular chart type.

Chart.js merges the options object passed to the chart with the global configuration using chart type defaults and scales defaults appropriately. This way you can be as specific as you would like in your individual chart configuration, while still changing the defaults for all chart types where applicable. The global general options are defined in `Chart.defaults`. The defaults for each chart type are discussed in the documentation for that chart type.
{'fraction_non_alphanumeric': 0.06727272727272728, 'fraction_numerical': 0.00393939393939394, 'mean_word_length': 4.604414261460102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2615565', 'n_tokens_mistral': 788, 'n_tokens_neox': 758, 'n_words': 444}