Linechart tile :: configuration examples

Warning

This is only available from the old home configuration and code mode. ⚠️ the chartOptions & data are deprecated, make sure to use de datasets/charts configuration.

Ex 1: Simple linechart tile

Data structure

| title_year | total_gross |
|------------|-------------|
| 1920       | 3           |
| 1979       | 129.45233333333334|
| 1965       | 134.33778975|

Config file

{
  name: 'Simple tile Line'
  source: '2018, source Toucan Toco'
  type: 'line'
  chartOptions:
    date: 'title_year'
    value: 'total_gross'
    data:
      query: [
        domain: 'time_country'
      ]
      date:
        format: "%Y"
        selector: "time_country
}

Ex 2: With units and precision

Data structure

| title_year | total_gross |
|------------|-------------|
| 1920       | 3           |
| 1979       | 129.45233333333334|
| 1965       | 134.33778975|

Config file

{
  name: 'with units and precisions'
  source: '2018, source Toucan Toco'
  type: 'line'
  chartOptions:
    date: 'title_year'
    value: 'total_gross'
    units:
      total_gross: ' $m'
    data:
      query: [
        domain: 'time_country'
      ]
      date:
        format: "%Y"
        selector: "time_country
      precision:
        total_gross: '.2f'
}

Ex 3: With tick format

Data structure

| title_year | total_gross |
|------------|-------------|
| 1920       | 3           |
| 1979       | 129.45233333333334|
| 1965       | 134.33778975|

Config file

{
  name: 'with tick format'
  source: '2018, source Toucan Toco'
  type: 'line'
  chartOptions:
    date: 'title_year'
    value: 'total_gross'
    units:
      total_gross: ' $m'
    data:
      query: [
        domain: 'time_country'
      ]
      date:
        format: "%Y"
        selector: "time_country
      precision:
        total_gross: '.2f'
}