# MatchValue Formatter Examples

## Example 1

```jsx
<SampleViz
    context={{
        colorMatches: [
            {
                match: 500,
                value: '#FF0000',
            },
            {
                match: 750,
                value: '#00FF00',
            },
            {
                match: "vis*",
                value: '#FFFFFF',
            },
        ],
    }}
    options={{
        colorOption: '> primary | seriesByIndex(0) | lastPoint() | matchValue(colorMatches, "#0000FF")' // returns #FF0000
        colorOption2: '> primary | seriesByIndex(1) | lastPoint() | matchValue(colorMatches, "#0000FF")' // returns #0000FF
        colorOption3: '> primary | seriesByIndex(2) | lastPoint() | matchValue(colorMatches, "#0000FF")' // returns #FFFFFF
    }}
    dataSources={{
        primary: {
            data: {
                columns: [[100, 200, 300, 400, 500], [600, 700, 800, 900, 1000], ["visual"]]
                fields: [{ name: 'foo' }, { name: 'bar' }, { name: 'baz' }],
            }
        }
    }}
/>
```
