Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default SpaceChart - can't see the chart

I have this macro in VBA excel. I can see the traces. Please advise. I
am using ChartSpace from Microsoft Office 11. Xp pro.

Thanks

Tuli

Dim oChart, oSeries1, oSeries2
Dim oAxis1, oAxis2, oConst
Dim S1(43), S2(43), S3(43) As Variant

For i = 1 To 43
S1(i) = Cells(i + 1, 2)
S2(i) = Cells(i + 1, 3)
S3(i) = Cells(i + 1, 4)
Next


Ak = Cells(i - 1, 4)

ChartSpace1.Clear
Set oConst = ChartSpace1.Constants

Set oChart = ChartSpace1.Charts.Add

Set oSeries1 = oChart.SeriesCollection.Add
oSeries1.Caption = "Current"
oSeries1.Type = oConst.chChartTypeScatterSmoothLine
oSeries1.SetData oConst.chDimXValues, oConst.chDataLiteral, S1()
oSeries1.SetData oConst.chDimYValues, oConst.chDataLiteral, S2()

Set oSeries2 = oChart.SeriesCollection.Add
oSeries2.Caption = "estimate"
oSeries2.Type = oConst.chChartTypeScatterSmoothLine
oSeries2.SetData oConst.chDimXValues, oConst.chDataLiteral, S1()
oSeries2.SetData oConst.chDimYValues, oConst.chDataLiteral, S3()


Set oAxis1 = oChart.Axes(oConst.chAxisPositionLeft)
oAxis1.Scaling.Maximum = 0.05
oAxis1.Scaling.Minimum = 0.025
oAxis1.NumberFormat = "0.0%"
oAxis1.HasMajorGridlines = True
Set oAxis2 = oChart.Axes(oConst.chAxisPositionBottom)
oAxis2.Scaling.Maximum = 30
oAxis2.Scaling.Minimum = 0
oAxis2.NumberFormat = "0"
oAxis2.HasMajorGridlines = True

oChart.HasLegend = True
oChart.Legend.Position = oConst.chLegendPositionBottom

oChart.PlotArea.Interior.Color = "white"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default SpaceChart - can't see the chart

It seems to work fine for me, what is the problem and what do you mean by
"traces".

In passing better to declare your arrays like this
Dim S1(1 to 43) as Variant, S2(1 to 43) as Variant

Regards,
Peter

"tuli" wrote in message
...
I have this macro in VBA excel. I can see the traces. Please advise. I
am using ChartSpace from Microsoft Office 11. Xp pro.

Thanks

Tuli

Dim oChart, oSeries1, oSeries2
Dim oAxis1, oAxis2, oConst
Dim S1(43), S2(43), S3(43) As Variant

For i = 1 To 43
S1(i) = Cells(i + 1, 2)
S2(i) = Cells(i + 1, 3)
S3(i) = Cells(i + 1, 4)
Next


Ak = Cells(i - 1, 4)

ChartSpace1.Clear
Set oConst = ChartSpace1.Constants

Set oChart = ChartSpace1.Charts.Add

Set oSeries1 = oChart.SeriesCollection.Add
oSeries1.Caption = "Current"
oSeries1.Type = oConst.chChartTypeScatterSmoothLine
oSeries1.SetData oConst.chDimXValues, oConst.chDataLiteral, S1()
oSeries1.SetData oConst.chDimYValues, oConst.chDataLiteral, S2()

Set oSeries2 = oChart.SeriesCollection.Add
oSeries2.Caption = "estimate"
oSeries2.Type = oConst.chChartTypeScatterSmoothLine
oSeries2.SetData oConst.chDimXValues, oConst.chDataLiteral, S1()
oSeries2.SetData oConst.chDimYValues, oConst.chDataLiteral, S3()


Set oAxis1 = oChart.Axes(oConst.chAxisPositionLeft)
oAxis1.Scaling.Maximum = 0.05
oAxis1.Scaling.Minimum = 0.025
oAxis1.NumberFormat = "0.0%"
oAxis1.HasMajorGridlines = True
Set oAxis2 = oChart.Axes(oConst.chAxisPositionBottom)
oAxis2.Scaling.Maximum = 30
oAxis2.Scaling.Minimum = 0
oAxis2.NumberFormat = "0"
oAxis2.HasMajorGridlines = True

oChart.HasLegend = True
oChart.Legend.Position = oConst.chLegendPositionBottom

oChart.PlotArea.Interior.Color = "white"



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius[_2_] Excel Programming 2 March 6th 09 04:55 PM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Charts and Charting in Excel 2 March 6th 09 04:43 PM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Setting up and Configuration of Excel 1 March 6th 09 01:57 AM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Excel Programming 0 March 6th 09 01:21 AM
Cannot Activate Chart Area in Chart. Chart Object Failed [email protected] Excel Programming 2 August 8th 06 02:38 AM


All times are GMT +1. The time now is 12:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"