2、找到函数_writePlotGroup
3、在
foreach($plotSeriesOrder as $plotSeriesIdx => $plotSeriesRef) {
之前添加代码$colorNDX=array();
$colorNDX[0] = "ff33cc";
$colorNDX[1] = "ffff00";
$colorNDX[2] = "ffc000";
$colorNDX[3] = "00b0f0";
$colorNDX[4] = "ff0000";
$colorNDX[5] = "058beb";
$colorNDX[6] = "06eb6e";
$t =$plotGroup->getPlotValues();
4、找到
$objWriter->startElement('c:dPt');
修改代码:if($t[$plotSeriesIdx]->getPointCount()<=7){这里由于是自己定制,所以只设定了7个颜色,如果超出这个范围,则用系统自带的来处理!
for($ci=0; $ci<7; ++$ci){
$objWriter->startElement('c:dPt');
$objWriter->startElement('c:idx');
$objWriter->writeAttribute('val', $ci);
$objWriter->endElement();
$objWriter->startElement('c:bubble3D');
$objWriter->writeAttribute('val', 0);
$objWriter->endElement();
$objWriter->startElement('c:spPr');
$objWriter->startElement('a:solidFill');
$objWriter->startElement('a:srgbClr');
$objWriter->writeAttribute('val', $colorNDX[$ci]);
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
}
}else{
$objWriter->startElement('c:dPt');
$objWriter->startElement('c:idx');
$objWriter->writeAttribute('val', 3);
$objWriter->endElement();
$objWriter->startElement('c:bubble3D');
$objWriter->writeAttribute('val', 0);
$objWriter->endElement();
$objWriter->startElement('c:spPr');
$objWriter->startElement('a:solidFill');
$objWriter->startElement('a:srgbClr');
$objWriter->writeAttribute('val', 'FF9900');
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
}
效果如图所示:
[img][attach]781[/attach][/img]