Set dateTime on x-axis in PHPExcel?

Topics: Developer Forum
Sep 3, 2014 at 7:30 AM
The constructor of PHPExcel_Chart_DataSeriesValues is:

construct   (       
$dataSource = null,
$formatCode = null,
$pointCount = 0,
$dataValues = array(),
$marker = null 
I try to insert formatCode in this way:
$xAxisTickValues = array(
new PHPExcel_Chart_DataSeriesValues('String', 'worksheet!$A$2:$A$9', 'yyyy-mm-dd hh:mm:ss', NULL, 4));
but it does not work? what is wrong here?

I use PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART.

When I not use 'formatCode' my x-axis shows raw excel datetimes: 41760,41761..,and so on?instead of 2014-05-01 00:00:00,2014-05-01 12:00:00,..,

Does anyone have an good example on how to insert date and time on the x-axis in PHPExcel?
see my chart on stackoverflow:TEXT
Sep 3, 2014 at 12:42 PM
I found a solution by making a hack in PHPExcel/Writer/Excel2007/Chart.php line 493
    //$objWriter->writeAttribute('formatCode', "General");
       $objWriter->writeAttribute('formatCode', "dd/mm/yy\ hh:mm:ss;@");
Change the formatCode to "dd/mm/yy\ hh:mm:ss;@"
but why is "General" hard-coded !?