A funcionalidade gráfica do dashboard foi expandida na v11 release 1 para suportar SVG, PNG e uma URL para una imagem (Google Chart URL). Este exemplo mostra como integrar os 3 novos tipos de gráficos no seu site na internet.
Um gráfico dashboard é criado a partir do painel de controle. O segredo para ativar a funcionalidade de gráficos é marcar a caixa de seleção "Use Chart" no editor de Dashboards.
Nota: pelo menos um campo deve ser adicionado ao dashboard para salvar o gráfico dashboard.
Neste exemplo, criamos 3 dashboards chamados PNG_Chart, SVG_Chart e Google_Chart. A partir do banco de dados final, cada gráfico dashboard será gerado a partir do método chamado DAX_DevHook_DefineChart. Assim estará dentro do método 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) ` Crear un gráfico PNG
DAX_Dev_SetDashboardPNG (->$png_pic) ` Definir PNG creado para el Dashboard
: ($ReportName_t="SVG_Chart") & ($SelectionName_t="View_1")
C_BLOB ($svg_x)
Set_Chart_SVG (->$svg_x) ` Crear un gráfico SVG
DAX_Dev_SetDashboardSVG (->$svg_x) ` Definir SVG creado para el Dashboard
: ($ReportName_t="Google_Chart") & ($SelectionName_t="View_1")
C_TEXT ($googleurl_t)
Set_Chart_GoogleURL (->$googleurl_t) ` Crear un Google Chart URL
DAX_Dev_SetDashboardImageURL (->$googleurl_t) ` Definir Google URL creado para el Dashboard
End case
End if
No arquivo HTML, o comando dax_chartViewer é executado na função onAfterInit. O comando carrega um gráfico dashboard em um <DIV> específico.
Sintaxe: 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'));