# Gradient Formatter Examples

## Example 1

```json
{
  "context": {
    "gradientConfig": {
      "stops": [
        50,
        100,
        150
      ],
      "colors": [
        "red",
        "green",
        "blue"
      ]
    }
  },
  "options": {
    "colorOption": "> primary | seriesByIndex(0) | gradient(gradientConfig)",
    "colorOption1": "> primary | seriesByIndex(1) | gradient(gradientConfig)"
  },
  "dataSources": {
    "primary": {
      "columns": [
        [
          0,
          50,
          230
        ],
        [
          50,
          100,
          150
        ]
      ],
      "fields": [
        {
          "name": "foo"
        },
        {
          "name": "bar"
        }
      ]
    }
  }
}
```

## Example 2

```json
{
  "context": {
    "gradientConfig": {
      "stops": [
        50,
        100,
        150
      ],
      "colors": [
        "red",
        "green",
        "blue"
      ]
    }
  },
  "options": {
    "colorOption": "> table | gradient(gradientConfig)"
  },
  "dataSources": {
    "primary": {
      "columns": [
        [
          0,
          50,
          230
        ],
        [
          50,
          100,
          150
        ]
      ],
      "fields": [
        {
          "name": "foo"
        },
        {
          "name": "bar"
        }
      ]
    }
  }
}
```
