M
moremotivated
Hello, I am having trouble getting my code here to write out an
appropriate GIF image for a chart using the OWC components. I am
calling the page as <img src ="theChartingPage.aspx"> , but am not
receiving the data back.
My original example worked ok, but I have done something here to mess
it up. I do have the values coming from the database, but for
simplicity sake I am going to create a static array so we can eliminate
that from the potentional problem list. Any help you can give would be
greatly appreciated!!
We will also assume the variables are all dimmed above. I get no
runtime errors here just nothing for the value :/
labelArray(0) = "Total"
labelArray(1) = "Vacant"
dataArray(0) = "1"
dataArray(1) = "3"
'Create a new chartspace:
ChartSpace1 = New OWC.ChartSpace
'Create a new chart within ChartSpace1:
occupancyChart = ChartSpace1.Charts.Add(0)
'Add a new dataseries within occupancyChart:
occupancyChart_Series1 = occupancyChart.SeriesCollection.Add(0)
'Define occupancyChart_Series1 as pie chart
occupancyChart_Series1.Type =
ChartSpace1.Constants.chChartTypeScatterLineMarkers
'Name the dataseries (name appears in Legend):
occupancyChart_Series1.SetData(OWC.ChartDimensionsEnum.chDimSeriesNames,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, "Chart1_Series1")
'Populate values from array:
occupancyChart_Series1.SetData(OWC.ChartDimensionsEnum.chDimCategories,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, labelArray)
occupancyChart_Series1.SetData(OWC.ChartDimensionsEnum.chDimValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, dataArray)
'Format the chart elements.
With occupancyChart
.HasLegend = True
.Legend.Position =
OWC.ChartLegendPositionEnum.chLegendPositionBottom
.HasTitle = True
.Title.Caption = "Total Occupancy For All Unit Types"
.Axes(0).HasTitle = True
.Axes(0).Title.Caption = "Total Units"
.Axes(1).HasTitle = True
.Axes(1).Title.Caption = "Total Vacant Units"
End With
'Return the new chart in GIF format.
Response.Buffer = True
Response.ContentType = "image/gif"
Response.BinaryWrite(ChartSpace1.GetPicture("gif", 500, 400))
Response.End()
appropriate GIF image for a chart using the OWC components. I am
calling the page as <img src ="theChartingPage.aspx"> , but am not
receiving the data back.
My original example worked ok, but I have done something here to mess
it up. I do have the values coming from the database, but for
simplicity sake I am going to create a static array so we can eliminate
that from the potentional problem list. Any help you can give would be
greatly appreciated!!
We will also assume the variables are all dimmed above. I get no
runtime errors here just nothing for the value :/
labelArray(0) = "Total"
labelArray(1) = "Vacant"
dataArray(0) = "1"
dataArray(1) = "3"
'Create a new chartspace:
ChartSpace1 = New OWC.ChartSpace
'Create a new chart within ChartSpace1:
occupancyChart = ChartSpace1.Charts.Add(0)
'Add a new dataseries within occupancyChart:
occupancyChart_Series1 = occupancyChart.SeriesCollection.Add(0)
'Define occupancyChart_Series1 as pie chart
occupancyChart_Series1.Type =
ChartSpace1.Constants.chChartTypeScatterLineMarkers
'Name the dataseries (name appears in Legend):
occupancyChart_Series1.SetData(OWC.ChartDimensionsEnum.chDimSeriesNames,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, "Chart1_Series1")
'Populate values from array:
occupancyChart_Series1.SetData(OWC.ChartDimensionsEnum.chDimCategories,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, labelArray)
occupancyChart_Series1.SetData(OWC.ChartDimensionsEnum.chDimValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, dataArray)
'Format the chart elements.
With occupancyChart
.HasLegend = True
.Legend.Position =
OWC.ChartLegendPositionEnum.chLegendPositionBottom
.HasTitle = True
.Title.Caption = "Total Occupancy For All Unit Types"
.Axes(0).HasTitle = True
.Axes(0).Title.Caption = "Total Units"
.Axes(1).HasTitle = True
.Axes(1).Title.Caption = "Total Vacant Units"
End With
'Return the new chart in GIF format.
Response.Buffer = True
Response.ContentType = "image/gif"
Response.BinaryWrite(ChartSpace1.GetPicture("gif", 500, 400))
Response.End()