Multiple Charts on a single page

M

Markus

I am attempting to return multiple charts on a single page. What I get
is the first chart being returned and none of the others. I am using
OWC11 and the charts returned need to be generated on the fly based on
filter data...so I can't save charts on the server as gifs and then
reference them.

Any help is appreciated
Thanks
Markus


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

chart1.ImageUrl = returnChartWeek("Week", "Areas", "areas")
chart2.ImageUrl = returnChartMonth("Month", "Areas", "areas")
chart3.ImageUrl = returnChartWeek("Week", "Total Units", "units")
chart4.ImageUrl = returnChartMonth("Month", "Total Units", "units")

End Sub


Private Function returnChartWeek(ByVal xAxisTitle, ByVal yAxisTitle,
ByVal chartType)

Dim ChartSpaceWeek As New OWC11.ChartSpace
'Microsoft.Office.Interop.OWC.ChartSpaceClass


Try
Response.Buffer = True
Response.ContentType = "image/gif"

'Return the new chart in GIF format.
ChartSpaceWeek = oCG.buildChart(xAxisTitle, yAxisTitle,
oDA.getChartDataWeek(chartType, 0, 0, 0, "", "", ""))
Response.BinaryWrite(ChartSpaceWeek.GetPicture("gif", 500, 400))
'Response.End()

Catch ex As Exception
Throw ex
End Try

End Function

Private Function returnChartMonth(ByVal xAxisTitle, ByVal yAxisTitle,
ByVal chartType)

Dim ChartSpaceMonth As New OWC11.ChartSpace
'Microsoft.Office.Interop.OWC.ChartSpaceClass


Try
Response.Buffer = True
Response.ContentType = "image/gif"

'Return the new chart in GIF format.
ChartSpaceMonth = oCG.buildChart(xAxisTitle, yAxisTitle,
oDA.getChartDataMonth(chartType, 0, 0, 0, "", "", ""))
Response.BinaryWrite(ChartSpaceMonth.GetPicture("gif", 500, 400))
'Response.End()

Catch ex As Exception
Throw ex
End Try

End Function
 
B

Bob

Markus

You are probably overwriting something. I am doing something similar in
javascript,
I create separate objects for each chant space and data set.

Ultimately my load section looks like this:

for (nGraph = 0; nGraph < nGraphs; nGraph++) {
sObject = "ChartSpace" + nGraph;
sData = "ChartData" + nGraph;
%>
<%=sObject%>.XMLData =
<%=sData%>.transformNode(xsl.documentElement);
<%
}
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top