Getting rid of Extra Chart!

M

marlboroguy58

Hi,
I m using OWC11 with ASP, Trying to draw simple Bar graph using data from
SQL database, i managed to draw the chart but i also have an extra chart with
it please let me know how to get rid of it.

here is the piece of code that does the charting

Set objRS1 = Server.CreateObject("ADODB.Recordset")

objRS1.Open strSQLStatement, objADODB, 1
'Response.Write("The value of " & strColName & "=" & objRS1(0))
set objCSpace = Server.CreateObject("OWC11.ChartSpace")
'set up chart and properties
set objChart = objCSpace.Charts.Add(0)
set objConstants = objCSpace.Constants

'create a clustered column chart
objChart.Type = objConstants.chChartTypeColumn3D


'add a legend
objChart.HasLegend = False

'objChart.ShowFilterHeaders = False
set objCSpace.DataSource = objRS1

objCSpace.HasMultipleCharts = False
objCSpace.HasChartSpaceLegend = False
objCSpace.HasChartSpaceTitle = False
objCSpace.DisplayFieldButtons = false
objCSpace.MinorVersion =

'set the data points and categories
'objChart.SetData objConstants.chDimSeriesNames, 0, "age"
objChart.SetData objConstants.chDimCategories, 0, "Level"
objChart.SetData objConstants.chDimValues, 0, "NOF"

'set up some additional properties
'add and format the chart title
objChart.HasTitle = True
objChart.Title.Caption = "TICS Summary"
set objFont = objChart.Title.Font
objFont.Name = "Tahoma"
objFont.Size = 10
objFont.Bold = True

'add and format a title to the category axis
set objAxis = objChart.Axes(objConstants.chAxisPositionBottom)
objAxis.HasTitle = True
objAxis.Title.Caption = "TICS Levels"
set objFont = objAxis.Title.Font
objFont.Name = "Tahoma"
objFont.Size = 8
objFont.Bold = True

'add and format a title to the value axis
set objAxis = objChart.Axes(objConstants.chAxisPositionLeft)
objAxis.HasTitle = True
objAxis.Title.Caption = "No. Of Files"
set objFont = objAxis.Title.Font
objFont.Name = "Tahoma"
objFont.Size = 8
objFont.Bold = True


'Save the current chart to a GIF file with a temporary
'filename using the FSO
set fso = Server.CreateObject("Scripting.FileSystemObject")
strFileName = fso.GetTempName()
GifFileName = strFileName
strFileName = Server.MapPath(".") & "\" & strFileName
RenName = strFileName
RenName = replace (RenName, ".tmp", ".gif")
'Response.Write(GifFileName)
GifFileName = replace (GifFileName, ".tmp", ".gif")
objCSpace.ExportPicture RenName, "gif", 800, 400
'fso.MoveFile strFileName,GifFileName
Response.Write("<IMG src =" & GifFileName & ">")
'Use On Error Resume Next to make sure we eventually delete
'the temporary GIF file even if something fails in the next
'couple of functions
on error resume next

'The GIF file has been created. Return the contents of the
'GIF file as binary data using the BinaryFileStream COM object
set objBinaryFile = Server.CreateObject("BinaryFileStream.Object")
Response.BinaryWrite objBinaryFile.GetFileBytes(CStr(strFileName))

'Delete the GIF file since it is no longer needed
objBinaryFile.DeleteFile CStr(RenName)

'clear variables
set objBinaryFile = nothing
set FSO = nothing
set objCSpace = nothing
 

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