I (trying) working with function DRAW GRAPH, but i´m not make it very well. Please see the error that i´m get in my function (attach).
See bellow my source too.
Code: Select all
*----------------------------------------------------------------------------------------*
Function Gerar_Grafico(c_String) //Esta função e reponsável por gerar o gráfico
*----------------------------------------------------------------------------------------*
Local d_DataINI //Data Inicial
Local d_DataFIN //Data Final
Local c_Assunto //Assunto à filtrar
Local c_Area //Area admistrativa ou pedagógica
Local c_Curso //Curso à filtrar
Local a_Titulos := {"Coordenadores","Professores","Monitores",;
"Laboratório","Coordenação","Limpeza","Xerox",;
"Biblioteca","SAE","Gerais","Inspetores",;
"Portaria","Cantina"} //Array de títulos da legenda
Local a_Valores := {{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0}} //Array que conterá os valores da legenda
Local a_Cores := { {128,128,255}, {255,102, 10}, {55,201, 48},;
{128,128,255}, {255,102, 10}, {55,201, 48},;
{128,128,255}, {255,102, 10}, {55,201, 48},;
{128,128,255}, {255,102, 10}, {55,201, 48},;
{128,128,255} } //Array que conterá as cores da legenda e gráfico
Local a_Result //Array que conterá o resultado da QUERY SQL
Local n_V := n_H := 1 //Contador local Vertical e horizontal
DECLARE WINDOW GRAFICO // declara o form gráfico neste módulo para poder-mos usar os objetos do mesmo
if Grafico.DatePicker_1.Value > Grafico.DatePicker_2.Value
Mensagem("Data inicial não pode ser maior que a data final!")
Return
endif
a_Result := Get_PSQ(c_String,Grafico.DatePicker_1.Value,Grafico.DatePicker_2.Value)
if empty(a_Result[1][1])
Mensagem("Não foram encontrados registros com este período!")
Return
endif
while(n_V <= Len(a_Result))
if a_Result[n_V][1] >= Grafico.DatePicker_1.Value
if a_Result[n_V][1] <= Grafico.DatePicker_2.Value
a_Valores[01][1] := a_Valores[01][1]+a_result[n_V][02]
a_Valores[02][1] := a_Valores[02][1]+a_result[n_V][03]
a_Valores[03][1] := a_Valores[03][1]+a_result[n_V][04]
a_Valores[04][1] := a_Valores[04][1]+a_result[n_V][05]
a_Valores[05][1] := a_Valores[05][1]+a_result[n_V][06]
a_Valores[06][1] := a_Valores[06][1]+a_result[n_V][07]
a_Valores[07][1] := a_Valores[07][1]+a_result[n_V][08]
a_Valores[08][1] := a_Valores[08][1]+a_result[n_V][09]
a_Valores[09][1] := a_Valores[09][1]+a_result[n_V][10]
a_Valores[10][1] := a_Valores[10][1]+a_result[n_V][11]
a_Valores[11][1] := a_Valores[11][1]+a_result[n_V][12]
a_Valores[12][1] := a_Valores[12][1]+a_result[n_V][13]
a_Valores[13][1] := a_Valores[13][1]+a_result[n_V][14]
endif
endif
n_V++
enddo
Grafico.HIDE
Load window Grafico2
Grafico2.Center
Grafico2.Activate
// ERASE WINDOW Grafico2
DRAW GRAPH ;
IN WINDOW Grafico2 ;
AT 20,20 ;
TO 400,610 ;
TITLE "Estatístca de satisfação" ;
TYPE BARS ;
SERIES a_Valores ;
YVALUES a_Titulos ;
DEPTH 30 ;
BARWIDTH 30 ;
HVALUES 13 ;
SERIENAMES a_Titulos ;
COLORS a_Cores ;
3DVIEW ;
SHOWGRID ;
SHOWXVALUES ;
SHOWYVALUES ;
SHOWLEGENDS ;
NOBORDER
Return
I thanks for help me,
with best regards,