Ir para conteúdo
Fórum Script Brasil
  • 0

Problema Com Gráfico


Denis_El_Samurai

Pergunta

Boa tarde a todos do Forum.

unsure.gif

Estou com um probleminha em um gráfico... estruturei uma tela, e coloquei um gráfico nela que está sendo gerado e funciona perfeitamente, porém, quando o gráfico é montado, ele cancela todas as linhas de comando que encontram-se abaixo dele, sendo assim ele não monta a estrutura do html... já mudei o Response.End para o final da página, e ainda assim ele não monta a estrutura... no que isso implica ? quero fazer o gráfico aparecer dentro de um determinado local, porém, ele não aparece, pois quando mudo o código de exibição para o local que eu quero que ele apareça, me retorna caracteres estranhos... e não o gráfico...

unsure.gif

A quem puder me ajudar, agradeço !

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0
cara tenta postar o código aqui pra gente dar uma olhada... as vezes facilita!

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<!-- #Include file="conn.inc" -->

<!-- #Include file="funcoes.inc" -->

<%

dim dataa

dim labelss

assunto = Request("assunto")

midia = Request("midia")

classficacao = Request("classificacao")

datahorainicio = formatadata(Request("inicio"))

datahorafinal = formatadata(Request("final"))

cliente = session.Contents("cliente")

Set Cn = Server.CreateObject ("ADODB.Connection")

Cn.Provider = strconcent

Cn.open

Set rd = Server.CreateObject ("ADODB.RecordSet")

Set rd.ActiveConnection=Cn

select case midia

case 0

nmtabela = "tbmateriasweb as midia"

case 1

nmtabela = "tbmateriasweb as midia"

case 2

nmtabela = "tbmateriasradio as midia"

case 3

nmtabela = "tbmateriastv as midia"

case 4

nmtabela = "tbmateriasimpressos as midia"

end select

if assunto = 0 then

strassunto = " AND midia.idcliente = " & cstr(cliente)

else

strassunto = " AND midia.idcliente = " & cstr(cliente) & " AND midia.idassunto = " & cstr(assunto)

end if

if classificacao = 0 then

strclassificacao = ""

else

strclassificacao = " AND midia.idclassificacao = " & cstr(classificacao)

end if

comando = "SELECT count(*) as total, tbuf.regiao from " & nmtabela & " INNER JOIN tbuf " _

& "ON midia.estado = tbuf.uf WHERE " _

& "midia.datahora >= '" & cstr(datahorainicio) & "' AND midia.datahora <= '" _

& cstr(datahorafinal) & "'" & strclassificacao & strassunto & " group by tbuf.regiao"

if midia = 0 then

nmtabela = "tbmateriasradio as midia"

comando = comando + " UNION "

comando = comando + "SELECT count(*) as total, tbuf.regiao from " & nmtabela & " INNER JOIN tbuf " _

& "ON midia.estado = tbuf.uf WHERE " _

& "midia.datahora >= '" & cstr(datahorainicio) & "' AND midia.datahora <= '" _

& cstr(datahorafinal) & "'" & strclassificacao & strassunto & " group by tbuf.regiao"

nmtabela = "tbmateriastv as midia"

comando = comando + " UNION "

comando = comando + "SELECT count(*) as total, tbuf.regiao from " & nmtabela & " INNER JOIN tbuf " _

& "ON midia.estado = tbuf.uf WHERE " _

& "midia.datahora >= '" & cstr(datahorainicio) & "' AND midia.datahora <= '" _

& cstr(datahorafinal) & "'" & strclassificacao & strassunto & " group by tbuf.regiao"

nmtabela = "tbmateriasimpressos as midia"

comando = comando + " UNION "

comando = comando + "SELECT count(*) as total, tbuf.regiao from " & nmtabela & " INNER JOIN tbuf " _

& "ON midia.estado = tbuf.uf WHERE " _

& "midia.data >= '" & cstr(datahorainicio) & "'" & strclassific & " AND midia.data <= '" _

& cstr(datahorafinal) & "'" & strassunto & strclassisicacao & " group by tbuf.regiao"

end if

'response.write (comando)

'response.end

rd.open comando

if not rd.EOF then

total = rd.fields("total")

else

total = 1

end if

Set cd = CreateObject("ChartDirector.API")

labelss = array()

dataa = array()

While not rd.Eof

ReDim preserve labelss(UBound(labelss)+1)

labelss(Ubound(labelss)) = rd.Fields("regiao")

ReDim preserve dataa(UBound(dataa)+1)

dataa(Ubound(dataa)) = rd.Fields ("total")

rd.MoveNext

Wend

Set c = cd.XYChart(600, 250)

'Add a title to the chart using Arial Bold Italic font

Call c.addTitle("Análise Regional Gráfica", "arialbi.ttf")

'Set the plotarea at (100, 30) and of size 400 x 200 pixels. Set the plotarea

'border, background and grid lines to Transparent

Call c.setPlotArea(100, 30, 400, 200, cd.Transparent, cd.Transparent, _

cd.Transparent, cd.Transparent, cd.Transparent)

'Add a bar chart layer using the given data. Use a gradient color for the bars,

'where the gradient is from dark green (0x008000) to white (0xffffff)

Set layer = c.addBarLayer(dataa, c.gradientColor(100, 0, 500, 0, &H8000, _

&Hffffff))

'Swap the axis so that the bars are drawn horizontally

Call c.swapXY(True)

'Set the bar gap to 10%

Call layer.setBarGap(0.1)

'Use the format "US$ xxx millions" as the bar label

Call layer.setAggregateLabelFormat("{value} máterias")

'Set the bar label font to 10 pts Times Bold Italic/dark red (0x663300)

Call layer.setAggregateLabelStyle("timesbi.ttf", 10, &H663300)

'Set the labels on the x axis

Set textbox = c.xAxis().setLabels(labelss)

'Set the x axis label font to 10pt Arial Bold Italic

Call textbox.setFontStyle("arialbi.ttf")

Call textbox.setFontSize(10)

'Set the x axis to Transparent, with labels in dark red (0x663300)

Call c.xAxis().setColors(cd.Transparent, &H663300)

'Set the y axis and labels to Transparent

Call c.yAxis().setColors(cd.Transparent, cd.Transparent)

'output the chart

Response.ContentType = "image/png"

Response.BinaryWrite c.makeChart2(cd.PNG)

Set c = nothing

Set cd = nothing

Response.End

%>

<head>

<title>Link TV - Análise Gráfica</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<LINK href="servicos.css" type=text/css rel=stylesheet>

</head>

<script language="JavaScript">

<!--

function Imprimir(){

if (window.print) {

window.print();

}

else {

var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGTH=0 CLASSID="CLSID:8856F961-340A-11D0-A96B00C04FD705A2"></OBJECT>';

document.body.insertAdjacentHTML('beforeEnd', WebBrowser);

WebBrowser1.ExecWB(6, 2);

WebBrowser1.outerHTML = " ";

}

}

//-->

</script>

<body>

<table width="700" border="1" cellpadding="0" cellspacing="0" bordercolor="#cccccc">

<tr>

<td colspan="2"><IMG height=84 src="images/clip_topo.jpg" width=778></td>

</tr>

<tr>

<td VAlign=top width="5%" background="images/back_bar_esq.gif"><IMG height=155 src="images/bar_esq_analise.gif" width=38></td>

<td width="95%"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="3%">&nbsp;</td>

<td width="94%">&nbsp;</td>

<td width="3%">&nbsp;</td>

</tr>

<tr>

<td class="titulotopoform">&nbsp;</td>

<td class="titulotopoform"><div align="center"><span class="titulotopoform_menor">Análise Gráfica Regional - EMPRESA </span></div></td>

<td class="titulotopoform"><div align="center" class="titulotopoform_menor"></div></td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

PRECISO QUE O GRÁFICO APAREÇA AQUI

</td>

<td>&nbsp;</td>

</tr>

<tr>

<td>&nbsp;</td>

<td><div align="center">

<input name="Submit" type="submit" class="btform" value="Voltar">

<input name="imprimir" type="button" class="btform" onClick="Imprimir()" value="Imprimir">

</div></td>

<td><div align="center">

</div></td>

</tr>

</table></td>

</tr>

<tr>

<td colspan="2"><IMG height=18 src="images/barra_inf.gif" width=778></td>

</tr>

</table>

</body>

</html>

Esse é o código, quem puder me ajudar, agradeço ... unsure.gif

Link para o comentário
Compartilhar em outros sites

  • 0

Tentou colocar isso tudo lá na coluna?:

Set c = cd.XYChart(600, 250)

'Add a title to the chart using Arial Bold Italic font
Call c.addTitle("Análise Regional Gráfica", "arialbi.ttf")

'Set the plotarea at (100, 30) and of size 400 x 200 pixels. Set the plotarea
'border, background and grid lines to Transparent
Call c.setPlotArea(100, 30, 400, 200, cd.Transparent, cd.Transparent, _
cd.Transparent, cd.Transparent, cd.Transparent)

'Add a bar chart layer using the given data. Use a gradient color for the bars,
'where the gradient is from dark green (0x008000) to white (0xffffff)
Set layer = c.addBarLayer(dataa, c.gradientColor(100, 0, 500, 0, &H8000, _
&Hffffff))

'Swap the axis so that the bars are drawn horizontally
Call c.swapXY(True)

'Set the bar gap to 10%
Call layer.setBarGap(0.1)

'Use the format "US$ xxx millions" as the bar label
Call layer.setAggregateLabelFormat("{value} máterias")

'Set the bar label font to 10 pts Times Bold Italic/dark red (0x663300)
Call layer.setAggregateLabelStyle("timesbi.ttf", 10, &H663300)

'Set the labels on the x axis
Set textbox = c.xAxis().setLabels(labelss)

'Set the x axis label font to 10pt Arial Bold Italic
Call textbox.setFontStyle("arialbi.ttf")
Call textbox.setFontSize(10)

'Set the x axis to Transparent, with labels in dark red (0x663300)
Call c.xAxis().setColors(cd.Transparent, &H663300)

'Set the y axis and labels to Transparent
Call c.yAxis().setColors(cd.Transparent, cd.Transparent)

'output the chart
Response.ContentType = "image/png"
Response.BinaryWrite c.makeChart2(cd.PNG)
Set c = nothing
Set cd = nothing
Response.End

Ou ainda definir largura e altura daquela coluna que deseja que apareça o gráfico, ok? Pode ser que resolva. Senão, voltamos à estaca zero, e tentamos outra solução...

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152k
    • Posts
      651,8k
×
×
  • Criar Novo...