title: highchart change color of single bar in single category
body: <p>I have a columnrange graph and want to define the color of a single bar line. If you see the second set in the picture. depending on a certain condition I would liek to change this to different color. <code>$schedule[] = array($date_from, ( date('Y-m-d',strtotime($model['ProjectEndDate'])) &gt; date('Y-m-d') )? $today*1000 : $date_to);</code> if endate is not greater than today then change color to red.</p>
  
  <p><img src="https://i.stack.imgur.com/BLNxu.png" alt="enter image description here"></p>
  
  <p>How would I do this?</p>
  
  <p><strong>in view</strong></p>
  
  <pre><code>$('#container').highcharts({
      'chart':{
          'type':'columnrange',
          'inverted':true,
              },
      'exporting':{
          'enabled':true
          },
  
      'title':{
          'text':'Projects incomplete in 2013'
          },
      'xAxis':{
          'categories':&lt;?=$cat?&gt;
          },
      'yAxis':{
          'title':'Date',
          'type':'datetime',
          'dateTimeLabelFormats':{                
              'month':'%b'
          },
          'min':Date.UTC(2013,00,01)
      },
  
      'tooltip':{
          formatter: function(){  
                  return '&lt;b&gt;' +this.series.name + ':&lt;/b&gt; '+ Highcharts.dateFormat('%e %b, %Y', this.point.low) + ' - ' +  Highcharts.dateFormat('%e %b, %Y', this.point.high) +'&lt;br/&gt;' ;
                }  
          },
      'legend':{
          'enabled':false
          },
      'series':[
                  {
                      'name':'Start - End',
                      'data':&lt;?=$data?&gt;
                      },
                      {
                      'name':'Forecast',
                      'data':&lt;?=$schedule?&gt;,
                      'color': 'green'    
                      },
                      {
                      'name':'Actual',
                      'data':&lt;?=$complete?&gt;,
                      'color': 'yellow'   
                      }
                  ]
  
  });
  </code></pre>
  
  <p>In my <strong>controller</strong> I have</p>
  
  <pre><code>public function actionGraph(){      
  
          $command = Yii::app()-&gt;db-&gt;createCommand("
                  SELECT
                      view_webprojectreport.PROJECT,
                      view_webprojectreport.StartDATE,
                      view_webprojectreport.ProjectEndDate,
                      view_webprojectreport.PERCENT,
                      view_webprojectreport.ASAAREA
                  FROM
                      view_webprojectreport
                  WHERE
                  view_webprojectreport.StartDATE &gt;= '2013' AND
                  view_webprojectreport.ProjectEndDate IS NOT NULL AND
                  view_webprojectreport.PERCENT &lt; 100
                  ORDER BY
                  view_webprojectreport.PERCENT DESC
                  ")-&gt;queryAll();
  
          $series = array();
          $cat = array();
          $totalLength = array();
          $schedule = array();
          $complete = array();
  
          foreach ($command as $key =&gt; $model) {
              $cat[] = $model['PROJECT'];
              $date_from = (strtotime($model['StartDATE']) + 1*86400)*1000;
              $date_to = (strtotime($model['ProjectEndDate']) + 1*86400)*1000;            
              $totalLength[] = array($date_from,$date_to);            
  
              $today = time();
              $startdate = strtotime($model['StartDATE']); 
              $enddate = strtotime($model['ProjectEndDate']); 
              $diff_total = $enddate - $startdate;
              $diff_today = $today - $startdate;
              $percentage_date=round(($diff_today/$diff_total)*100,2);
  
  
              $duration = ( ((strtotime($model['ProjectEndDate']) + 1*86400)*1000) - ((strtotime($model['StartDATE']) + 1*86400)*1000) );         
              $burn = ((time() )*1000) - ((strtotime($model['StartDATE']) + 1*86400)*1000);
              $pBurned = $burn/$duration;
              $time = $time = strtotime( ($date_from + $pBurned) );
  
              //echo date('Y-m-d') . " : " . date('Y-m-d',strtotime($model['ProjectEndDate'])) . "&lt;br&gt;";
              // place check for calculating if project end date is in past
              $schedule[] = array($date_from, ( date('Y-m-d',strtotime($model['ProjectEndDate'])) &gt; date('Y-m-d') )? $today*1000 : $date_to); 
  
  
  
  
              $percentage_to_get = round((float)$model['PERCENT'],2);
              $percentage_of_days =  ((int)$model['PERCENT'] == 0)? 0 : floor($diff_total/100*$percentage_to_get);
              //echo date('Y-m-d', $startdate) . " : " . date('Y-m-d', $startdate + $percentage_of_days ) . "&lt;br&gt;";
              //echo $startdate . " : " . ($startdate + $percentage_of_days) . "&lt;br&gt;";
              $percentComplete = (($startdate + $percentage_of_days)+ 1*86400)*1000;  
  
              $complete[] = array($date_from,$percentComplete);
  
          }
  
  
          $series = array("series"=&gt;array(
                  array(
                      'name'=&gt;'Start - End',
                      'data'=&gt;$totalLength
                      ),
                  array(
                      'name'=&gt;'Forecast',
                      'data'=&gt;$schedule,
                      'color'=&gt; 'green'   
                      ),
                  array(
                      'name'=&gt;'Actual',
                      'data'=&gt;$complete,
                      'color'=&gt; 'yellow'  
                      )
                  ));
  
          print_r($series);
          $this-&gt;render('graph',array(                
                  'cat'=&gt;json_encode($cat),
                  "data"=&gt;json_encode($totalLength),
                  "schedule"=&gt;json_encode($schedule),
                  "complete"=&gt;json_encode($complete),
                  "series"=&gt;json_encode($series)
          ));
      }
  </code></pre>
  
  <p><strong>output of schedule</strong></p>
  
  <pre><code>[[1357689600000,1372064004000],[1360972800000,1.3686588e+12],[1359158400000,1372064004000],[1.3630464e+12,1365721200000],[1359417600000,1372064004000],[1.3709916e+12,1372064004000],[1.3686588e+12,1372064004000],[1.3681404e+12,1372064004000],[1.3699548e+12,1372064004000],[1366930800000,1372064004000]]
  </code></pre>
  
  <p>How would I incorporate the color in this?</p>
  
  <pre><code>$schedule[] = array($date_from, ( date('Y-m-d',strtotime($model['ProjectEndDate'])) &gt; date('Y-m-d') )? $today*1000 : $date_to);
  </code></pre>
  
  <p>I have found <a href="http://jsfiddle.net/Q2JMF/2/" rel="nofollow noreferrer">http://jsfiddle.net/Q2JMF/2/</a> and trying to implement but not working. graph displays nothing</p>
  
  <p><strong>My example on jsfiddle</strong> <a href="http://jsfiddle.net/shorif2000/z4HXX/2/" rel="nofollow noreferrer">http://jsfiddle.net/shorif2000/z4HXX/2/</a></p>