title: SetSerieDescription - pChart not working
body: <p>I'm trying to assign a label to the x axis of a Bar Chart, the label is a normal text string stored in an array under $gsettings['axisXlabel']. Unfortunatly pCharts SetSerieDescription doesn't seem to be working as expected.</p>
  
  <p>Below is the function producing the graphs and an attachment of the current output. The part of interest is the 3 lines under /* Bind a data series to the X axis */</p>
  
  <pre><code>/**
  * function to plot bar charts
  */
  function cg_graphs_plot_bar_graph($gdata, $gsettings){
  
    $graph_data = new pData();
  
    if(isset($gdata['bar_plots2'])){ //if this is set, its a duel bar graph
      $graph_data-&gt;addPoints($gdata['bar_plots'],"surgeondata");
      $graph_data-&gt;addPoints(array(0,0,0,0),"surgeondatanull");
      $graph_data-&gt;addPoints($gdata['bar_plots2'],"everyonedata");
      $graph_data-&gt;addPoints(array(0,0,0,0),"everyonedatanull");
      $graph_data-&gt;setSerieDrawable(array("everyonedatanull"), FALSE);
      $graph_data-&gt;setSerieDescription("surgeondata",$gdata['surgeonname']);
      $graph_data-&gt;setSerieDescription("everyonedata","All Surgeons");
      $graph_data-&gt;setAxisUnit(0,"%");
  
      $surgeon = array("R"=&gt;21,"G"=&gt;0,"B"=&gt;0); //surgeon series colour
      $all = array("R"=&gt;191,"G"=&gt;160,"B"=&gt;36); //everyone series colour
      $graph_data-&gt;setPalette("surgeondata",$surgeon);
      $graph_data-&gt;setPalette("everyonedata",$all);
      $graph_data-&gt;setPalette("surgeondatanull",$surgeon);
      $graph_data-&gt;setPalette("everyonedatanull",$all);
  
    } else {
      $graph_data-&gt;addPoints($gdata['bar_plots'],"percentiles");
      $graph_data-&gt;addPoints($gdata['surgeon_bar'],"surgeonbar");
      $graph_data-&gt;setSerieDrawable(array("surgeonbar"), FALSE);
    }
    $graph_data-&gt;setAxisName(0,$gsettings['axisYlabel']);
    /* Bind a data serie to the X axis */
    $graph_data-&gt;addPoints($gdata['xaxis_names'],"Labels");
    $graph_data-&gt;setSerieDescription("Labels",$gsettings['axisXlabel']);
    $graph_data-&gt;setAbscissa("Labels");
  
    $width=540;
    $height=419;
  
    $chart = new pImage($width,$height,$graph_data);
    $chart-&gt;drawFromJPG(0,0,drupal_get_path('module', 'cg_graphs')."/images/graphbg.jpg");
  
    /* Write the picture title */ 
    $chart-&gt;setFontProperties(array("FontName"=&gt;drupal_get_path('module', 'cg_graphs')."/pChart/fonts/ARIAL.TTF","FontSize"=&gt;8));
    $chart-&gt;setFontProperties(array("R"=&gt;0,"G"=&gt;0,"B"=&gt;0));
    $chart-&gt;drawText(270,70,$gsettings['title'],array("R"=&gt;0,"G"=&gt;0,"B"=&gt;0,"Align"=&gt;TEXT_ALIGN_MIDDLEMIDDLE, "FontSize" =&gt; 12));
  
    /* Set the graph area */
    $chart-&gt;setGraphArea(70,120,490,310);
  
    /* Draw a rectangle */
    $chart-&gt;drawFilledRectangle(70,120,489,309,array("R"=&gt;255,"G"=&gt;255,"B"=&gt;255,"Dash"=&gt;FALSE, "BorderR"=&gt;201,"BorderG"=&gt;201,"BorderB"=&gt;201));
  
    /* Turn on shadow computing */ 
    $chart-&gt;setShadow(TRUE,array("X"=&gt;1,"Y"=&gt;1,"R"=&gt;0,"G"=&gt;0,"B"=&gt;0,"Alpha"=&gt;20));
  
      $format = array(
          "DisplayValues"=&gt;FALSE,
          "DisplayColor"=&gt;DISPLAY_AUTO,
          "Rounded"=&gt;FALSE,
          "Gradient"=&gt;TRUE,
          "GradientAlpha"=&gt;100,
          "GradientMode"=&gt;GRADIENT_EFFECT_CAN,
          "GradientStartR"=&gt;251,
          "GradientStartG"=&gt;220,
          "GradientStartB"=&gt;96,
          "GradientEndR"=&gt;191,
          "GradientEndG"=&gt;160,
          "GradientEndtB"=&gt;36
      );
  
    if(isset($gdata['bar_plots2'])){
        /* Draw the scale */
        $chart-&gt;drawScale(array("XMargin"=&gt;50, "Mode"=&gt;SCALE_MODE_MANUAL, "ManualScale"=&gt; $gsettings['maxmin'], "Pos" =&gt; SCALE_POS_LEFTRIGHT,'DrawXLines' =&gt; FALSE, 'GridTicks' =&gt; 500,'GridR'=&gt;0,'GridG'=&gt;0,'GridB'=&gt;0, 'LabelRotation'=&gt;0, 'AroundZero' =&gt; TRUE, 'Interleave' =&gt; 0.1));
  
        $graph_data-&gt;setSerieDrawable(array("surgeondata"), FALSE);
        $graph_data-&gt;setSerieDrawable(array("surgeondatanull"), TRUE);
    } else {
      /* Draw the scale*/
    $chart-&gt;drawScale(array("XMargin"=&gt;40, "Mode"=&gt;SCALE_MODE_MANUAL, "ManualScale"=&gt; $gsettings['maxmin'], "Pos" =&gt; SCALE_POS_LEFTRIGHT,'DrawXLines' =&gt; FALSE, 'GridTicks' =&gt; 500,'GridR'=&gt;0,'GridG'=&gt;0,'GridB'=&gt;0, 'LabelRotation'=&gt;0, 'AroundZero' =&gt; TRUE));
    }
  
    $chart-&gt;drawBarChart($format);
  
    //draw next bar with new colour.
    $format = array(
          "DisplayValues"=&gt;FALSE,
          "DisplayColor"=&gt;DISPLAY_AUTO,
          "Rounded"=&gt;FALSE,
          "Gradient"=&gt;TRUE,
          "GradientAlpha"=&gt;100,
          "GradientMode"=&gt;GRADIENT_EFFECT_CAN,
          "GradientStartR"=&gt;255,
          "GradientStartG"=&gt;230,
          "GradientStartB"=&gt;126,
          "GradientEndR"=&gt;21,
          "GradientEndG"=&gt;0,
          "GradientEndtB"=&gt;0
    );
  
    if(!isset($gdata['bar_plots2'])){ //not set? we need to draw the second one.
      //set draw series to false / true here
  
      $graph_data-&gt;setSerieDrawable(array("percentiles"), FALSE);
      $graph_data-&gt;setSerieDrawable(array("surgeonbar"), TRUE);
  
      $chart-&gt;drawBarChart($format);
    } else {
      $graph_data-&gt;setSerieDrawable(array("surgeondatanull", "everyonedata"), FALSE);
      $graph_data-&gt;setSerieDrawable(array("surgeondata", "everyonedatanull"), TRUE);
  
      $chart-&gt;drawBarChart($format);
      $graph_data-&gt;setSerieDrawable(array("everyonedatanull"), FALSE);
      $graph_data-&gt;setSerieDrawable(array("everyonedata"), TRUE);
      $chart-&gt;drawLegend(190,100,array("Style"=&gt;LEGEND_NOBORDER, "Mode" =&gt; LEGEND_HORIZONTAL)); //draw legand
    }
  
    $imagename = str_replace(' ', '-', $gdata['surgeonname']);
    $chart-&gt;render(drupal_get_path('module', 'cg_graphs')."/pChart/examples/pictures/".$imagename."-".$gsettings['name'].".png");
  }
  </code></pre>
  
  <p>And here's the output, I want to label the Xaxis, currently the label isn't showing. (sorry for removed title etc, data isn't in the public domain yet and names needed removing)</p>
  
  <p><img src="https://i.stack.imgur.com/36jgE.png" alt="Current output"></p>