Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Question on Graph XLGraphType

I've built the following function to create graphs (based on other
functions I've seen online):

Public Function AddChartObject(objWs As Worksheet, intLeft As Integer, _
intTop As Integer, intWidth As Integer, intHeight As Integer, _
xlChartType As xlChartType) As ChartObject
Dim objChart As ChartObject
Set objChart = objWs.ChartObjects.Add(Left:=intLeft,
Width:=intWidth, Top:=intTop, Height:=intHeight)
objChart.Chart.ChartType = xlChartType
Set AddChartObject = objChart
End Function

Which I'm calling like such:
Set objChart = AddChartObject(objWs, 20, 156, 400, 252, xl3DBarStacked)

In the latter 'xl3DBarStacked' is the XLGraphType which gives me
horizontal bars in the graph. But what if I want vertical bars, what's
the constant for that.

Also, if I browse the list of XLGraphType's in the object browser, how
do I work out what kind of graph is generated without individually
trying out each constant in my AddChartObject function?

Thanks,
Wayne C.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Question on Graph XLGraphType

The vertical bars are called "columns" in Excel. You probably don't need to
try all of the constants, just try out the ones you don't recognize, and
fill in the rest. It shouldn't take to long to run a few tests.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Wayne Cressman" wrote in message
t...
I've built the following function to create graphs (based on other
functions I've seen online):

Public Function AddChartObject(objWs As Worksheet, intLeft As Integer, _
intTop As Integer, intWidth As Integer, intHeight As Integer, _
xlChartType As xlChartType) As ChartObject
Dim objChart As ChartObject
Set objChart = objWs.ChartObjects.Add(Left:=intLeft, Width:=intWidth,
Top:=intTop, Height:=intHeight)
objChart.Chart.ChartType = xlChartType
Set AddChartObject = objChart
End Function

Which I'm calling like such:
Set objChart = AddChartObject(objWs, 20, 156, 400, 252, xl3DBarStacked)

In the latter 'xl3DBarStacked' is the XLGraphType which gives me
horizontal bars in the graph. But what if I want vertical bars, what's
the constant for that.

Also, if I browse the list of XLGraphType's in the object browser, how do
I work out what kind of graph is generated without individually trying out
each constant in my AddChartObject function?

Thanks,
Wayne C.



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
Graph Question kyoshirou Excel Discussion (Misc queries) 1 September 26th 06 04:18 AM
Graph Question nikki Excel Discussion (Misc queries) 1 March 10th 06 06:46 PM
Graph Question nikki Excel Discussion (Misc queries) 1 March 9th 06 01:17 AM
Bar Graph Question kmatch Excel Discussion (Misc queries) 2 September 20th 05 09:06 PM
bar graph question anantathaker Excel Discussion (Misc queries) 1 June 17th 05 03:44 PM


All times are GMT +1. The time now is 11:56 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"