Setting the Label Distance From Category Axis in PHP

Aspose.Slides - Setting the Label Distance From Category Axis

To Set the Label Distance From Category Axis using Aspose.Slides Java for PHP, simply invoke SetLabelDistance module. Here you can see example code.

PHPCode


 # Instantiate Presentation class that represents the presentation file

$pres = new Presentation();

\# Access first slide

$sld = $pres->getSlides()->get_Item(0);

\# Adding a chart on slide

$chartType=new ChartType();

$ch = $sld->getShapes()->addChart($chartType->ClusteredColumn, 20, 20, 500, 300);

\# Setting the position of label from axis

$ch->getAxes()->getHorizontalAxis()->setLabelOffset(500);

\# Saving the presentation

$save_format = new SaveFormat();

$pres->save($dataDir . "Position.pptx", $save_format->Pptx);

print "Set label distance, please check the output file.".PHP_EOL;

Download Running Code

Download Setting the Label Distance From Category Axis (Aspose.Slides) from any of the below mentioned social coding sites: