Special
Features for Pie Charts
Data
Mapping
Enable
Data Refresh
Data
Points
Set ColorDrill Down
Set Sort Order
Hide Zero-Value data Points
Note that this chart type does not support data series, time-based zooming and histogram.
Special Features for Pie Charts
// create an IPiePropertySet objectData Mapping
IPiePropertySet hPieProperties = chart.gethPieProperties();// setExplodeRadialPos(float x)
hPieProperties.setExplodeRadialPos( .05f );// get the number of pie slices
int pieSliceCount = chart.gethLegend().areItemsHidden(0).length;// explode every sector
for( int i=0; i<pieSliceCount; i++){
hPieProperties.setExploded( i, true);
}// show data value in label
// gethValueLabel(int intA) returns handle to all labels
hPieProperties.gethValueLabel(0).setVisible(true);// show percentage value in label
// gethPercentLabel(int intA) returns handle to all labels
hPieProperties.gethPercentLabel(0).setVisible(true);// make percentage value visible in legend
hPieProperties.setPercentVisibleInLegend(true);// sets pie sector labels visible,
// gethLabel(int intA) return handle to ALL labels
hPieProperties.gethLabel(0).setVisible(true);// sets label distance from center
hPieProperties.setLabelRadialPos( (float)1.35 );// set to “sector gap” mode
hPieProperties.setExplodeUsingSectorGap( true );
Enable
Data Refresh
For information on Data
Refresh, please refer to Enable Data Refresh in
2D
DataPoints API.
Data
Points
To set properties on the
Data Points such as top label, set color, sort data points...etc, first
create an IDataPointSet object that has a handle on the chart's DataPoints.
Then, the properties can be edited through methods in the IDataPointSet.
// create an IDataPointSet object, “hDataPoints”
// that has a handle on the chart’s DataPoints
IDataPointSet hDataPoints = chart.gethDataPoints();// set data points’ color, use void setColors(java.awt.Color[] color)Set Sort Order
// color array dimension must be equal to the number of data point objects
Color[] colorSet = new Color[]{Color.yellow, Color.red, Color.blue, Color.cyan};
hDataPoints.setColors(colorSet);// sort value data, use public void setValueSortOrder(int type)Hide Zero-Value Data Points
// QbChart.ASCENDING, or DESCENDING
hDataPoints.setValueSortOrder( QbChart.ASCENDING);// sort data, use public void setSortOrder(int seriesType, int type)
// QbChart.VALUE, CATEGORY, or SERIES
hDataPoints.setSortOrder( QbChart.CATEGORY, QbChart.ASCENDING);
Drill Down// set data to be null if it is zero, so it would not show
// up in the chart as a thick black line
hDataPoints.setZeroAsNullData(true);
Dynamic
Drill Down
For information on Dynamic
Drill Down, please refer to Dynamic Drill Down
in 2D DataPoints API.
Hyperlinks
For information on Hyperlinks,
please refer to Hyperlinks in 2D
DataPoints API.
3D
Property Set
For information on 3D Property
Set, please refer to 3D Property Set in 3D
DataPoints API.
Please refer to QbChart,
ColInfo,
IColumnMap,
IDataPointSet,
IZoomInfo,
IDrillDown,
IHyperLinkSet,
HyperLink,
I3DPropertySet,
&
I3DControlPanel
in EspressChart APIDocs for additional information.