デザイナー、APIを用いた円グラフの扇の隙間をカスタマイズ


円グラフの扇を間隔をあけて配置することや中心から離して配置することが可能です。

デザイナーの場合チャートの上で右クリックし、”Chart Option”を選択することで下の図の右側のウィンドウが表示されます。設定したい扇(dbase Ⅲ、word、free lance)を選択し、”Sector Gap”で隙間を空けるを選択し、”Distance from origin”に値(20%)を入力すると、左側のように設定されます。

またAPIでは下記のように指定すると同様の設定が行われます。
//Sector Gapを指定
chart.gethPieProperties().setExplodeUsingSectorGap(true);
//扇の指定
chart.gethPieProperties().setExploded(0, false);
chart.gethPieProperties().setExploded(1, true);
chart.gethPieProperties().setExploded(2, false);
chart.gethPieProperties().setExploded(3, true);
chart.gethPieProperties().setExploded(4, false);
chart.gethPieProperties().setExploded(5, true);
//隙間の広さを指定
chart.gethPieProperties().setExplodeRadialPos(0.2f);

 

また、中心から離す場合”Explode”を選択し、”Distance from origin”に値(40%)を入力すると、下のように設定されます。

同様にAPIでは

//Explodeを指定
chart.gethPieProperties().setExplodeUsingSectorGap(true);
//扇の指定
chart.gethPieProperties().setExploded(0, false);
chart.gethPieProperties().setExploded(1, true);
chart.gethPieProperties().setExploded(2, false);
chart.gethPieProperties().setExploded(3, true);
chart.gethPieProperties().setExploded(4, false);
chart.gethPieProperties().setExploded(5, true);
//隙間の広さを指定
chart.gethPieProperties().setExplodeRadialPos(0.4f);

 

 

関連するトピックス:

コメントを残す

メールアドレスが公開されることはありません。

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください