# How can I colour my graph by size?

**URL:** <https://talk.observablehq.com/t/how-can-i-colour-my-graph-by-size/6301>\
**Category:** Help\
**Created:** [March 1, 2022, 10:57pm UTC](https://talk.observablehq.com/t/how-can-i-colour-my-graph-by-size/6301 "2022-03-01T22:57:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leomarrg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/leomarrg/32/5841_2.png) [@leomarrg](https://talk.observablehq.com/u/leomarrg)\
**Post date:** [March 1, 2022, 10:57pm UTC](https://talk.observablehq.com/t/how-can-i-colour-my-graph-by-size/6301/1 "2022-03-01T22:57:36Z")

</div>

I’m using a vega lite api and trying to color all my circles in the graph by size?  
Example:

> ```
> if(planet.size <= size)
> vl color blue
> 
> ```

Etc. Do this cases to use different colours depending on the sizes.  
I used

> vl.color().fieldQ(“st\_teff”)

But this puts a lot of different colors
