Scorecard 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: Score-card with 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: Score-card with 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

{
  name: "score-card with units"
  type: "score-card"
  chartOptions:
    value:"PIB"
    label:"country"
    data:
      query:
        domain:"widget_leaderboard"
    units:
      PIB: " €"
}

Ex3: Score-card with 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

{
  name: "score-card with variation"
  type: "score-card"
  chartOptions:
    value:"PIB"
    variation: "evolution"
    label:"country"
    data:
      query:
        domain:"widget_leaderboard"
}

Ex4: Score-card with 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

{
  name: "score-card with limits"
  type: "score-card"
  chartOptions:
    value:"PIB"
    label:"country"
    limit: 3
    data:
      query:
        domain:"widget_leaderboard"
}

Ex5: Score-card with 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

{
  name: "score-card with sentiment"
  type: "score-card"
  chartOptions:
    value:"PIB"
    variation: "evolution"
    label:"country"
    sentiment:
      evolution:
        domain:[100]
        range:['negative','positive']
    data:
      query:
        domain:"widget_leaderboard"
}

Ex6: Score-card with hidden evolution

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

{
  name: "score-card with hidden evolution"
  type: "score-card"
  chartOptions:
    value:"PIB"
    variation: "evolution"
    label:"country"
    sentiment:
      evolution:
        domain:[100]
        range:['negative','positive']
    hideEvolutionIcons: true
    data:
      query:
        domain:"widget_leaderboard"
}

Ex7: Score-card with stars rating

Data Structure

   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

{
  name: "score-card full options <%= stars(rating) %>"
  type: "score-card"
  chartOptions:
    value:"PIB"
    label:"country"
    variation: 'evolution'
    limit: 3
    sentiment:
      evolution:
        domain:[100]
        range:['positive','negative']
    units:
      PIB: " €"
    data:
      query:
        domain:"widget_leaderboard"
  source: "Toucan Toco, 2018"
}

Note that the **first line** of data returned by you query will be
used here.