<< Click to Display Table of Contents >> Navigation: »No topics above this level« TOC : Script API > JavaScript > JavaScript API > ChartObject > ChartPiePiece3D > Method >Offset |
Set the offset value to move location of a ChartPiece.
Prototype :
void Offset
(
float OffsetX,
float OffsetY
)
Arguments :
OffsetX |
X value of the offset |
OffsetY |
Y value of the offset |
Reference :
Set OffsetX to positive number to move to the right and to negative number to move to the left.
Set OffsetY to positive number to move down and to negative number to move up.
For the case of pie or gauge chart, if set “Data Label Position” option value to “Side Pos”, data label position will not be changed. Therefore, the chart may show abnormal shape if move ChartPiece location.
Example :
var ChartRootUnit = This.GetChartRootUnit();
var ChartShapeCnt = ChartRootUnit.GetShapeCount();
for(i = 0; i < ChartShapeCnt; i++) {
var ChartShape = ChartRootUnit.GetShape(i);
var ChartPieceCnt = ChartShape.GetPieceCount();
for(j = 0; j < ChartPieceCnt; j++) {
var ChartPiece = ChartShape.GetPiece(j);
if(ChartPiece.GetItemName() == "Seoul") {
ChartPiece.Offset(20, -20);
}
}
}
Available Events :