Dashboardのチャート機能がv11 relese 1で拡張され、Canvasチャートのほか、SVG、PNG、そして画像 (Google Chart URL) へのURLが利用できるようになりました。 この例では、Webページにこれら新しい3タイプのチャートを統合する方法をお見せしています。
Dashboard チャートは管理コントロールパネルで作成します。チャート機能を使用するには、Dashboardエディタで"チャートを使用する"チェックボックスをチェックします。
Note: Dashboard チャートを保存するには、一つ以上のフィールドをDashboardに追加する必要があります。
この例では、三つのDashboard、PNG_Chart、SVG_Chart、そしてGoogle_Chartが既に作成されています。バックエンドデータベースでは、
それぞれのDashboard チャートがDAX_DevHook_DefineChartメソッドで作成されます。DAX_DevHook_DefineChartには以下のように記述されています:
C_TEXT($1;$2;$3;$ReportName_t;$SelectionName_t;$ReportOwner_t)
If(Count parameters>=3)
$ReportName_t:=$1
$SelectionName_t:=$2
$ReportOwner_t:=$3
Case of
: ($ReportName_t="PNG_Chart") & ($SelectionName_t="View_1")
C_PICTURE ($png_pic)
Set_Chart_PNG (->$png_pic) ` Create a PNG Chart
DAX_Dev_SetDashboardPNG (->$png_pic) ` Set created PNG to the Dashbard
: ($ReportName_t="SVG_Chart") & ($SelectionName_t="View_1")
C_BLOB ($svg_x)
Set_Chart_SVG (->$svg_x) ` Create an SVG Chart
DAX_Dev_SetDashboardSVG (->$svg_x) ` Set created SVG to the Dashbard
: ($ReportName_t="Google_Chart") & ($SelectionName_t="View_1")
C_TEXT ($googleurl_t)
Set_Chart_GoogleURL (->$googleurl_t) ` Create a Google Chart URL
DAX_Dev_SetDashboardImageURL (->$googleurl_t) ` Set created Google URL to the Dashbard
End case
End if
HTMLファイル中、コマンドdax_chartViewerはonAfterInit関数から実行されます。このコマンドはDashboard チャートを指定した<DIV>にロードします。
シンタックス: dax_chartViewer(DashboardName, DivReference);
pngchart = new dax_chartViewer('PNG_Chart', $('pngdiv'));
svgchart = new dax_chartViewer('SVG_Chart', $('svgdiv'));
googchart = new dax_chartViewer('Google_Chart', $('googdiv'));