title: Use different colors depending on the number of series - Highcharts
body: <p>I am trying to figure out how to use create a bit of logic that will apply different color palettes for my highcharts graphs, depending on how many series are in the graph.</p>
  
  <p>For example, say I want to use this palette if the graph has 4 lines: </p>
  
  <pre><code> colors: ['#000', '#333', '#666', #999]
  </code></pre>
  
  <p>but I want to use this palette if the graph has 2 lines:</p>
  
  <pre><code> colors: ['#000', '#666']
  </code></pre>
  
  <p>How can I achieve this kind of conditional coloring in Highcharts? Perhaps these might help:</p>
  
  <ul>
  <li>Can I use a function as the value of the <code>colors</code> property? </li>
  <li>How do I get the number of series in a graph?</li>
  </ul>