API version 1
- ‐
load¶
データを読み込みます。
読み込むデータの型やデータフォーマットはデータ系列により異なります。 実際の使用方法は各データ系列クラスを参照してください。
呼出形式一覧
呼出形式 |
説明 |
---|---|
void load(table data) |
引数に指定したデータをデータ系列に読み込みます。 |
戻り値一覧
戻り値 |
説明 |
---|---|
void |
なし |
引数一覧
引数 |
説明 |
---|---|
data |
読み込むデータ |
例外
識別子 |
説明 |
---|---|
CRS::Common::Chart::CSVDocument-1:1 |
CSVDocumentではありません |
CRS::Common::Chart::CSVDocument-1:2 |
必要な情報がありません |
使用例
CRSダウンロード
Form ChartSeries {
x = 0;
y = 0;
width = 800;
height = 600;
/* 1.初期化 */
Chart testChart(Chart.CHARTTYPE_PIE){
Width = 700;
Height = 500;
x = 5;
y = 58;
bgColor = new Brush("#fff0f0f0", Brush.NOBRUSH);
Function initChart(){
/* 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.opacity = 0.75 ;
print("ID = ",cs.id,"、不透明度= ",cs.opacity,"、データの系列種類= ",cs.type,"、データの表示=",cs.visible) ;
/* cs.truncate() ; */
/* 4.データの表示範囲を自動調整 */
relayout( ) ;
}
}
Button button1 {
x = 232;
y = 414;
width = 200;
height = 60;
title = "ボタンサンプル";
fgColor = "black";
font = new Font("HG創英角ポップ体", 14);
}
testChart.initChart();
}