30日間の無料評価版をお試しいただけます。

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Base API リファレンス

このAPIは、「JsAPI/v3」JSファイルがページに含まれているページでのみ使用できます。以下の例を参照してください。

このAPIは、ダッシュボードコードモードでは使用できません。


Base APIには、Yellowfin APIを独自のウェブページにロードするのに役立つ多くの関数が含まれています。レポートおよびダッシュボードローダーAPIをロードする関数があり、ダッシュボードおよびレポートをロードできます。

セッション管理を支援する関数もあります。


init()

リターン

Promise

説明

Base APIを初期化します。これは、APIがページに含まれている時に呼び出されます。ロードが終了した時点で、APIの使用がこのPromiseが解決するまで待機することを示すPromiseを返します。

Yellowfin レポートAPIをページに含め、init() promiseが解決した後でレポートをロードします。

<script src="https://pathToYourYellowfinServer/JsAPI/v3"></script>
<div id="reportDiv"></div>
<script>
yellowfin.init().then(() => {
          //The Yellowfin base API has now loaded. Now load a report
          yellowfin.loadReport({
                    reportId: 'c83357db-8aef-4ec7-ab72-fce34de9ee77',
                    element: document.querySelector('div#reportDiv'),
           });

});
</script>


logoff()

リターン

なし

説明

現在のユーザーセッションを終了します。


loadReport(reportOptions)(レポートのロード)

リターン

Promise

説明

init() promiseがロードするの待ち、渡されたオプションでレポートをロードします。レポートがロードされると、渡されたelement(要素)が追加され、レポートの実行が開始されます。

promiseが解決されると、レポートオブジェクトは.then()関数に渡されます。promiseは、レポートの実行が開始される直前に解決されます。


オプションオブジェクトの一部として受け入れられるオプションがいくつかあります。

reportId(レポートID) - 必須

型:String

ロードするレポートのレポートUUIDです。これは、レポートヘッダーテーブルの公開UUIDです。

element(要素) - 必須

型:DOM Element、Selector String

レポートに描画するelement(要素)です。DOM element、またはページからelementを選択するために使用されるselectorのどちらかになります。

幅や高さが渡されない場合、レポートはelementの寸法に合わせて展開されます。

width(幅)

型:Number

レポートをピクセル単位で描画する幅です。

height(高さ)

型:Number

レポートをピクセル単位で描画する高さです。

filterValues(フィルター値)

型:Array[Object]

初期フィルター値を適用するために使用されるオブジェクトの配列です。

フィルター値についての詳細は、フィルター APIを参照してください。

オブジェクトには、次の情報が含まれます。

  • filterId - 設定するフィルターのUUID、または名前です。
  • valueOne - フィルターの最初の値です。
  • valueTwo - フィルターの二番目の値です。Between(の間)、またはNot Between(の間ではない)フィルタータイプにのみ影響します。
  • valueList - フィルター一覧に適用する値の配列です。
[{ //Set a between filter
         filterId: '1c1e0878-3bd6-402b-bad8-98202e6b8fb1',
         valueOne: 15,
         valueTwo: 35
}]


instanceName(インスタンス名)

型:String

レポートのインスタンスの識別子です。このプロパティが定義されない場合は、ランダムなIDが生成されます。つまり、インスタンス名を定義することなく同じレポートを複数回含めた場合、そのレポートは常に別のインスタンスになります。

これを設定すると、同じインスタンスのレポートの複数のビューをロードできるようになります。

//Load the report into two different elements
yellowfin.loadReport({
         reportId:'9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#firstReport'),
         instanceName: 'firstReport'
});

yellowfin.loadReport({
         reportId:'9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#secondReport'),
         instanceName: 'firstReport'
});


showToolbar(ツールバーの表示)

型:Boolean

レポートツールバーを表示するかどうかを定義します。

//Load the report with showToolbar not defined
yellowfin.loadReport({
         reportId:'9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#reportDiv');
});
//Load the report with showToolbar set to true
yellowfin.loadReport({
         reportId: '9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#reportDiv'),
         showToolbar: true
});


または、showToolbarプロパティをfalseに設定します。

//Load the report with showToolbar set to false
yellowfin.loadReport({
    reportId: '9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
    element: document.querySelector('div#reportDiv'),
    showToolbar: false
});


showTitle(タイトルの表示)

型:Boolean

レポートのツールバーにレポートタイトルを表示するかどうかを定義します。デフォルト:true

showTitle オプションをfalseに設定した場合:

//Load the report with showTitle option set to false
yellowfin.loadReport({
         reportId: '9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#reportDiv'),
         showTitle: false
});


showInfo(詳細の表示)

型:Boolean

レポートのツールバーに詳細オプションを表示するかどうかを定義します。デフォルト:true

このオプションをfalseに設定した場合:

//Load the report with showInfo option set to false
yellowfin.loadReport({
         reportId: '9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#reportDiv'),
         showInfo: false
});


showFilter(フィルターの表示)

型:Boolean

レポートのツールバーにフィルターオプションを表示するかどうかを定義します。デフォルト:true

このオプションをfalseに設定した場合:

//Load the report with showFilter option set to false
yellowfin.loadReport({
         reportId: '9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#reportDiv'),
         showFilter: false
});


showExport(エクスポートの表示)

型:Boolean

レポートのツールバーにエクスポートオプションを表示するかどうかを定義します。エクスポートオプションを使用することで、レポートをcsv、xls、pdf、txt、docなどの外部ファイル形式にエクスポートすることができます。

showExport パラメーターをfalseに設定する場合、ツールバー内のエクスポートアイコンは削除されます。

//Load the report with showExport option set to false
yellowfin.loadReport({
         reportId: '9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#reportDiv'),
         showExport: false
});


showShare(共有の表示)

型:Boolean

レポートのツールバーに共有オプションを表示するかどうかを定義します。デフォルトはtrueに設定されています。

//Load the report with showShare option set to false
yellowfin.loadReport({
         reportId: '9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#reportDiv'),
         showShare: false
});


showDisplayToggle(表示トグルの表示)

型:Boolean

レポートのツールバーにレポートのグラフ/表オプションを表示するかどうかを定義します。デフォルトはtrueに設定されています。

このオプションをfalseに設定した場合

//Load the report with this option set to false
yellowfin.loadReport({
         reportId: '9617ada1-28bc-42ef-9c3f-8b40d3d1ae61',
         element: document.querySelector('div#reportDiv'),
         showReportDisplayToggle: false
});

レポートをロードして、その名前を出力します。

yellowfin.loadReport({
          reportId: aReportId,
         element: elementToRenderTo
}).then(report => {

          //Some code to execute when the report has loaded

          console.log(report.name + ‘ has finished loading’);
});



loadDashboard(dashboardOptions)

リターン

Promise

説明

init()promiseがロードされるのを待ち、渡されたオプションでダッシュボードをロードします。ダッシュボードがロードされると、渡されたelement(要素)に追加され、ダッシュボード上のコンテンツの実行が開始されます。

dashboardOptionsオブジェクトには、いくつかのパラメーターを含めることができます。

dashboardUUI(ダッシュボードUUID) - 必須

型:String

ロードするダッシュボードの公開UUIDです。


element(要素) - 必須

型:DOM Element、Selector String

ダッシュボードに描画するelement(要素)です。DOM element、またはページからselectorの最初のインスタンスを選択するために使用されるselectorのどちらかになります。

幅や高さが渡されない場合、ダッシュボードはelement(要素)の寸法に合わせて表示されます。


filterValues(フィルター値)

型:Array[Object]

ダッシュボードの初期フィルター値を適用するために使用されるオブジェクトの配列です。

フィルター値についての詳細は、フィルター APIを参照してください。

オブジェクトには、次の情報が含まれます。

  • filterId - 設定するフィルターのUUID、または名前です。
  • valueOne - フィルターの最初の値です。
  • valueTwo - フィルターの二番目の値です。Between(の間)、またはNot Between(の間ではない)フィルタータイプにのみ影響します。
  • valueList - フィルター一覧に適用する値の配列です。
[{ //Set a between filter
         filterId: '1c1e0878-3bd6-402b-bad8-98202e6b8fb1',
         valueOne: 15,
         valueTwo: 35
}]


showToolbar(ツールバーの表示)

型:Boolean

ダッシュボードのツールバーを表示するかどうかを定義します。デフォルトではtrueに設定されています。

//Load the dashboard with showToolbar not defined
yellowfin.loadDashboard({
         reportId:'1e68d9cc-fa5a-44e2-816d-782aa40ceeae',
         element: document.querySelector('div#dashboardDiv');
});
//Load the dashboard with showToolbar set to true
yellowfin.loadDashboard({
         reportId: '1e68d9cc-fa5a-44e2-816d-782aa40ceeae',
         element: document.querySelector('div#dashboardDiv'),
         showToolbar: true
});

以下は、ツールバーが表示されたダッシュボードです。

しかし、showToolbar プロパティをfalseに設定した場合:

//Load the dashboard with showToolbar set to false
yellowfin.loadDashboard({
         reportId: '1e68d9cc-fa5a-44e2-816d-782aa40ceeae',
         element: document.querySelector('div#dashboardDiv'),
         showToolbar: false
});


showInfo(詳細の表示)

型:Boolean

ダッシュボードのツールバーに詳細オプションを表示するかどうかを定義します。デフォルト:true

このオプションをfalseに設定した場合:


showShare(共有の表示)

型:Boolean

ダッシュボードのツールバーに共有オプションを表示するかどうかを定義します。デフォルトはtrueに設定されています。

このオプションをfalseに設定した場合:

//Load the dashboard with showShare option set to false
yellowfin.loadDashboard({
         reportId: '1e68d9cc-fa5a-44e2-816d-782aa40ceeae',
         element: document.querySelector('div#dashboardDiv'),
         showShare: false
});


showFilters(フィルターの表示)

型:Boolean

ダッシュボードのツールバーにフィルターオプションを表示するかどうかを定義します。デフォルトはtrueに設定されています。

このオプションをfalseに設定した場合:

//Load the dashboard with showFilter option set to false
yellowfin.loadDashboard({
         reportId: '1e68d9cc-fa5a-44e2-816d-782aa40ceeae',
         element: document.querySelector('div#dashboardDiv'),
         showFilter: false
});


scaleCanvasTabs(キャンバスタブのスケール)

型:Boolean

キャンバスタブをスケールするかどうかを定義します。デフォルトはtrueに設定されています。

これをfalseに設定した場合、キャンバスタブは作成された通りのサイズで表示されます。この設定は、キャンバスタブを含まないサブタブでは無効です。

//Load the dashboard with scaleCanvasTabs option set to false
yellowfin.loadDashboard({
          reportId: '1e68d9cc-fa5a-44e2-816d-782aa40ceeae',
          element: document.querySelector('div#dashboardDiv'),
          scaleCanvasTabs: false
});


showGlobalContentContainer(グローバルコンテンツコンテナーの表示)

ダッシュボードの描画時にグローバルコンテンツコンテナーを表示するかどうかを定義します。

//Load the dashboard with showGlobalContentContainer option set to false
yellowfin.loadDashboard({
         reportId: '1e68d9cc-fa5a-44e2-816d-782aa40ceeae',
         element: document.querySelector('div#dashboardDiv'),
         showGlobalContentContainer: false
});




  • No labels