Leaderboard 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.

Ex1: Leaderboard with source

leaderboard source

leaderboard source

Data Structure

   country      |     PIB       |  evolution  |  objective  |
  France        |      106503   |     52      |  127803,6   |
  Allemagne     |      187585   |      67     |  225102     |
  Italie        |       71118   |      40     |  85341,6    |
  Espagne       |       186344  |      35     |  223612,8   |
  Netherland    |       122795  |      29     |  147354     |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard with source'
  chartOptions:
    value:"PIB"
    label:"country"
    data:
      query:
        domain:"widget_leaderboard"
  source: "The Amazing TC2 team, 2018"
}

Ex2: Leaderboard with domain

leaderboard domain

leaderboard domain

Data Structure

   country      |     PIB       |  evolution  |  objective  |
  France        |      106503   |     52      |  127803,6   |
  Allemagne     |      187585   |      67     |  225102     |
  Italie        |       71118   |      40     |  85341,6    |
  Espagne       |       186344  |      35     |  223612,8   |
  Netherland    |       122795  |      29     |  147354     |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard with domain'
  chartOptions:
    value:"PIB"
    label:"country"
    domain: [0, 250000]
    data:
      query:
        domain:"widget_leaderboard"
}

Ex3 - a: Leaderboard with sort

leaderboard sort

leaderboard sort

Data Structure

   country      |     PIB       |  evolution  |  objective  |
  France        |      106503   |     52      |  127803,6   |
  Allemagne     |      187585   |      67     |  225102     |
  Italie        |       71118   |      40     |  85341,6    |
  Espagne       |       186344  |      35     |  223612,8   |
  Netherland    |       122795  |      29     |  147354     |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard with sort'
  chartOptions:
    value:"PIB"
    label:"country"
    sort: "asc"
    data:
      query:
        domain:"widget_leaderboard"
}

Ex3 - b: Leaderboard with custom sort

leaderboard sort

leaderboard sort

Data Structure

   country      |     PIB       |  evolution  |  objective  | order |
  France        |      106503   |     52      |  127803,6   | 1     |
  Allemagne     |      187585   |      67     |  225102     | 5     |
  Italie        |       71118   |      40     |  85341,6    | 2     |
  Espagne       |       186344  |      35     |  223612,8   | 4     |
  Netherland    |       122795  |      29     |  147354     | 3     |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard with custom sort 1'
  chartOptions:
    value:"PIB"
    label:"country"
    sort: "order"
    data:
      query:
        domain:"widget_leaderboard"
}

Ex4: Leaderboard with units

leaderboard units

leaderboard units

Data Structure

   country      |     PIB       |  evolution  |  objective  |
  France        |      106503   |     52      |  127803,6   |
  Allemagne     |      187585   |      67     |  225102     |
  Italie        |       71118   |      40     |  85341,6    |
  Espagne       |       186344  |      35     |  223612,8   |
  Netherland    |       122795  |      29     |  147354     |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard with units'
  chartOptions:
    value:"PIB"
    label:"country"
    # target: "objective"
    data:
      query:
        domain:"widget_leaderboard"
    units:
      PIB: " €"
}

Ex5: Leaderboard with targets

leaderboard targets

leaderboard targets

Data Structure

   country      |     PIB       |  evolution  |  objective  |
  France        |      106503   |     52      |  127803,6   |
  Allemagne     |      187585   |      67     |  225102     |
  Italie        |       71118   |      40     |  85341,6    |
  Espagne       |       186344  |      35     |  223612,8   |
  Netherland    |       122795  |      29     |  147354     |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard with target'
  chartOptions:
    value:"PIB"
    label:"country"
    target: "objective"
    data:
      query:
        domain:"widget_leaderboard"
}

Ex6: Leaderboard with sentiments / colored bars

leaderboard sentiment

leaderboard sentiment

Data Structure

   country      |     PIB       |  evolution  |  objective  |
  France        |      106503   |     52      |  127803,6   |
  Allemagne     |      187585   |      67     |  225102     |
  Italie        |       71118   |      40     |  85341,6    |
  Espagne       |       186344  |      35     |  223612,8   |
  Netherland    |       122795  |      29     |  147354     |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard with sentiment'
  chartOptions:
    value:"PIB"
    label:"country"
    data:
      query:
        domain:"widget_leaderboard"
    sentiment:
      PIB:[
        sentiment:
          domain:[0,150000]
          range:['negative','warning','positive']
      ]
}

Ex7: Leaderboard with variation

leaderboard variation

leaderboard variation

Data Structure

   country      |     PIB       |  evolution  |  objective  |
  France        |      106503   |     52      |  127803,6   |
  Allemagne     |      187585   |      67     |  225102     |
  Italie        |       71118   |      40     |  85341,6    |
  Espagne       |       186344  |      35     |  223612,8   |
  Netherland    |       122795  |      29     |  147354     |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard with variation'
  chartOptions:
    value:"PIB"
    label:"country"
    variation: 'evolution'
    data:
      query:
        domain:"widget_leaderboard"
}

Ex8: Leaderboard with limits

leaderboard limits

leaderboard limits

Data Structure

   country      |     PIB       |  evolution  |  objective  |
  France        |      106503   |     52      |  127803,6   |
  Allemagne     |      187585   |      67     |  225102     |
  Italie        |       71118   |      40     |  85341,6    |
  Espagne       |       186344  |      35     |  223612,8   |
  Netherland    |       122795  |      29     |  147354     |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard with limit'
  chartOptions:
    value:"PIB"
    label:"country"
    limit: 5
    data:
      query:
        domain:"widget_leaderboard"
}

Ex9: Leaderboard with autoHeight / custom tile size

leaderboard auto

leaderboard auto

Data Structure

   country      |     PIB       |  evolution  |  objective  |
  France        |      106503   |     52      |  127803,6   |
  Allemagne     |      187585   |      67     |  225102     |
  Italie        |       71118   |      40     |  85341,6    |
  Espagne       |       186344  |      35     |  223612,8   |
  Netherland    |       122795  |      29     |  147354     |
(...)

Configuration

{
  type: 'leaderboard'
  name:'leaderboard with autoHeight'
  autoHeight: true
  chartOptions:
    value:"PIB"
    label:"country"
    limit: 5
    data:
      query:
        domain:"widget_leaderboard"
}

Ex10: Leaderboard with stars rating

leaderboard fulloptions

leaderboard fulloptions

Data Structure

⚠️ Note that you must have a rating column in your data set, and that only the first line of your data will be returned by the stars query in this widget.

   country      |     PIB       |  evolution  |  objective  |  rating   |
  France        |      106503   |     52      |  127803,6   |    0,8    |
  Allemagne     |      187585   |      67     |  225102     |    0,8    |
  Italie        |       71118   |      40     |  85341,6    |    0,8    |
  Espagne       |       186344  |      35     |  223612,8   |    0,8    |
  Netherland    |       122795  |      29     |  147354     |    0,8    |
(...)

Configuration

{
  type: 'leaderboard'
  name: 'leaderboard <%= stars(rating) %>'
  chartOptions:
    value: "PIB"
    label: "country"
    domain: [0, 190000]
    sort: "desc"
    target: "objective"
    variation: 'evolution'
    limit: 5
    data:
      query:
        domain: "widget_leaderboard"
    sentiment:
      PIB:[
        sentiment:
          domain:[100000,150000]
          range:['negative','warning','positive']
      ]
    units:
      PIB: " €"
  source: "The amazing Toucan Toco team, 2018"
  autoHeight: true
}