Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unable to set the Chart type to XY Plotter

I am trying to set the chart types to XYScatter through code. I am
using the Createobject(Excel.App...) instead of referencing the excel
object.

However, i end up setting the chart type to any of the XY Scatter (XY
Scatt with data points connected, smoothed lines, etc) but cannot
create the simple XYScatter(just points).
The chartType for XYScatter starts from 71 thru 74 (70 is the pie
chart and 75 is area chart).

Has any bdy come across such problem, any suggestions??

Thanks

Heres the code:

Set xlChart = xlChartSheet.chartobjects.Add(360, 5, 350, 250).Chart
With xlChart
.ChartType = 72
.SeriesCollection.Add Source:=xlWS.Range("A4:A" & lastRow & ", " &
xlWS.Cells(4, colCount + 1).Address & ":" & Left(xlWS.Cells(4,
colCount + 1).Address, 3) & lastRow), RowCol:=2

.SeriesCollection(1).XValues = xlWS.Range("P4:P" & lastRow)
.SeriesCollection(1).Values = xlWS.Range("E4:E" & lastRow)

.SeriesCollection(1).TrendLines.Add
.HasTitle = True
.ChartTitle.Caption = "Gas vs Power Price"
.HasLegend = False
.PlotArea.Height = 280
.PlotArea.Width = 490
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unable to set the Chart type to XY Plotter


try...

.ChartType = xlXYScatte

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Unable to set the Chart type to XY Plotter

Amit -

You need to use the correct long value for xlXYScatter, which is -4169.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Amit Kale wrote:

I am trying to set the chart types to XYScatter through code. I am
using the Createobject(Excel.App...) instead of referencing the excel
object.

However, i end up setting the chart type to any of the XY Scatter (XY
Scatt with data points connected, smoothed lines, etc) but cannot
create the simple XYScatter(just points).
The chartType for XYScatter starts from 71 thru 74 (70 is the pie
chart and 75 is area chart).

Has any bdy come across such problem, any suggestions??

Thanks

Heres the code:

Set xlChart = xlChartSheet.chartobjects.Add(360, 5, 350, 250).Chart
With xlChart
.ChartType = 72
.SeriesCollection.Add Source:=xlWS.Range("A4:A" & lastRow & ", " &
xlWS.Cells(4, colCount + 1).Address & ":" & Left(xlWS.Cells(4,
colCount + 1).Address, 3) & lastRow), RowCol:=2

.SeriesCollection(1).XValues = xlWS.Range("P4:P" & lastRow)
.SeriesCollection(1).Values = xlWS.Range("E4:E" & lastRow)

.SeriesCollection(1).TrendLines.Add
.HasTitle = True
.ChartTitle.Caption = "Gas vs Power Price"
.HasLegend = False
.PlotArea.Height = 280
.PlotArea.Width = 490
End With


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
unable to type in cell paulwl Excel Discussion (Misc queries) 2 October 8th 08 01:03 PM
Printing Chart on Plotter Rutabaga Charts and Charting in Excel 0 July 17th 07 03:38 PM
Chart not printing on plotter Excel 2000 Chris wongman Excel Discussion (Misc queries) 0 June 14th 05 10:52 AM
unable to type in selected row Andersenjoy New Users to Excel 1 May 24th 05 03:20 PM
Adding a line Chart Type to a stacked-clustered Chart Type Debbie Charts and Charting in Excel 2 January 5th 05 11:25 PM


All times are GMT +1. The time now is 10:47 PM.

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"