OWC and multiple chart types - please help!!

D

Dom

This problem is driving me mad so I hope someone can help - I've been
looking at it for days and still don't seem to figure it out....

Below is a script that I build from a database (hence the auto generated
chart ID) where a user specifies the data and the chart type to display it
- it all works fine if its just columns or just lines but if I mix the two
then it all goes wrong and I can't figure out why. I've tried almost every
different combination I can think of so if someone could explain then I
would be most grateful - from what I can tell it doesn't properly show the
SeriesCollection when the chart type changes and then displays the next
SeriesCollection properly...

Thanks in advance

Dom

<object id=Chart1408955183 classid=CLSID:0002E55D-0000-0000-C000-
000000000046 style="width:100%;height:350"></object>
<script language=vbs>
Sub Window_onload()
Dim categories(11)
Dim values(11)
Dim chConstants

Chart1408955183.Clear
Chart1408955183.Charts.Add

Chart1408955183.HasChartSpaceTitle = True
Chart1408955183.ChartSpaceTitle.Font.Size = 9
Chart1408955183.ChartSpaceTitle.Font.Bold = True
Chart1408955183.Interior.Color = "White"
Chart1408955183.ChartSpaceTitle.Caption = "No data found"

Set c = Chart1408955183.Constants

Chart1408955183.ChartSpaceTitle.Caption = "GR-12-01-BUT"

Categories(0) = "May"
Categories(1) = "Jun"
Categories(2) = "Jul"
Categories(3) = "Aug"
Categories(4) = "Sep"
Categories(5) = "Oct"
Categories(6) = "Nov"
Categories(7) = "Dec"
Categories(8) = "Jan"
Categories(9) = "Feb"
Categories(10) = "Mar"
Categories(11) = "Apr"

Chart1408955183.Charts(0).SeriesCollection.Add
Chart1408955183.Charts(0).SeriesCollection(0).SetData c.chDimCategories,
c.chDataLiteral, Categories
Chart1408955183.Charts(0).SeriesCollection(0).Type =
c.chChartTypeColumnClustered
Values(0) ="0"
Values(1) ="0"
Values(2) ="0"
Values(3) ="0"
Values(4) ="0"
Values(5) ="0"
Values(6) ="0"
Values(7) ="0"
Values(8) ="0"
Values(9) ="0"
Values(10) ="0"
Values(11) ="0"
Chart1408955183.Charts(0).SeriesCollection(0).Caption = "Closed Sol's"
Chart1408955183.Charts(0).SeriesCollection(0).SetData c.chDimCategories,
c.chDataLiteral, Categories
Chart1408955183.Charts(0).SeriesCollection(0).SetData c.chDimValues,
c.chDataLiteral, Values


Chart1408955183.Charts(0).SeriesCollection.Add
Chart1408955183.Charts(0).SeriesCollection(1).Type = c.chChartTypeLine
Values(0) ="0"
Values(1) ="0"
Values(2) ="0"
Values(3) ="0"
Values(4) ="0"
Values(5) ="0"
Values(6) ="0"
Values(7) ="0"
Values(8) ="0"
Values(9) ="0"
Values(10) ="0"
Values(11) ="0"
Chart1408955183.Charts(0).SeriesCollection(1).Type = c.chChartTypeLine
Chart1408955183.Charts(0).SeriesCollection(1).Caption = "Open SOL's >60
Days"
Chart1408955183.Charts(0).SeriesCollection(1).SetData c.chDimCategories,
c.chDataLiteral, Categories
Chart1408955183.Charts(0).SeriesCollection(1).SetData c.chDimValues,
c.chDataLiteral, Values


Chart1408955183.Charts(0).SeriesCollection.Add
Values(0) ="3"
Values(1) ="0"
Values(2) ="0"
Values(3) ="0"
Values(4) ="0"
Values(5) ="0"
Values(6) ="0"
Values(7) ="0"
Values(8) ="6"
Values(9) ="9"
Values(10) ="0"
Values(11) ="0"
Chart1408955183.Charts(0).SeriesCollection(2).Type = c.chChartTypeLine
Chart1408955183.Charts(0).SeriesCollection(2).Caption = "Open Sols"
Chart1408955183.Charts(0).SeriesCollection(2).SetData c.chDimCategories,
c.chDataLiteral, Categories
Chart1408955183.Charts(0).SeriesCollection(2).SetData c.chDimValues,
c.chDataLiteral, Values

For Each oChart in Chart1408955183.Charts
oChart.HasLegend = True
oChart.Legend.Position = c.chLegendPositionBottom
Next
End Sub
</script>
 

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