API version 1

- ‐

コンストラクタ

ChartPieItemオブジェクトを初期化します。

呼出形式一覧

呼出形式

説明

new ChartPieItem([number value[, integer title]])

ChartPieItemオブジェクトを初期化します。

戻り値一覧

戻り値

説明

void

なし

引数一覧

引数

説明

value

アイテムの値

title

ラベル文字(フォーマット指定子が使用可能。詳細はlabelプロパティを参照)

例外

なし



使用例 CRSダウンロード

Form ChartPieSeries {
   x = 0;
   y = 0;
   width = 800;
   height = 600;

   /* 1.初期化 */
   Chart testChart(Chart.CHARTTYPE_PIE){
           Width = 700;
           Height = 500;

           Function initChart(){
                   /*bgColor = "#c5ff90" ; */
                   bgColor = "WHITE" ;

                   /* 2.円グラフ作成 */
                   var cs = createSeries(Chart.SERIESTYPE_PIE);

                   /* CSVデータの作成 */
                   var cv = new CSVDocument;
                   cv << csv {
                           "予約",5
                           "新車",24
                           "中古",15
                           "廃車",5
                   } ;

                   /* 3.CSVデータを流し込み */
                   cs.load( cv ) ;

                   /* 円の表示オプション */
                   cs.endAngle = 320 ;
                   cs.holeSize = 0.2 ;
                   cs.hPosition = 0.6 ;
                   cs.pieSize = 0.8 ;
                   cs.startAngle = 15 ;
                   cs.vPosition = 0.5 ;

                   /* メソッドサンプル */
                   cs.addItem("代行",2) ;
                   var item = new ChartPieItem(3 , "追加" );
                   item.color = "#00ff00";
                   item.value = 5 ;
                   item.label = "輸入" ;
                   cs.insertItem(2, item) ;

                   cs.setLabelsPosition(0) ;
                   cs.setLabelsVisible(true);
                   print("新車は ",cs.getItem("新車") ) ;
                   print("取り扱い台数(項目順) ",cs.getItems() ) ;

                   /* cs.truncate() ; */

                   /* 4.データの表示範囲を自動調整 */
                   relayout( ) ;
           }
   }
   testChart.initChart();
}