Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I have to generate a column graph for the following data: Quarterly sales by division (in thousands) Div 1 Div 2 Div 3 Div 4 Jan 549 542 670 640 Feb 845 259 360 961 Mar 852 391 296 425 I used the code mentioned below. Public Sub test() Dim cht As Excel.Chart Dim wsh As Excel.Worksheet Set cht = Charts.Add With cht .ChartType = xlColumnClustered .SetSourceData Source:=Sheets("Save a custom chart type").Range("B3:B5") .SetSourceData Source:=Sheets("Save a custom chart type").Range("C3:C5") .SetSourceData Source:=Sheets("Save a custom chart type").Range("D3:D5") Set wsh = ActiveWorkbook.Worksheets(1) With wsh.Shapes(1) .Top = 0 .Left = 0 .Width = 200 .Height = 200 End With End With End Sub But the output i needed was like this: x- axis has div1,2,3 with each div having three corresponding bars along with the category and labels. Can anyone suggest modificaitons to the code to get the desired format of graph? Would greatly appreciate help in this matter. Thanks in advance... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel stack column: how to remove empty labels? | Charts and Charting in Excel | |||
Unique labels in each stacked bar? | Charts and Charting in Excel | |||
Data labels out of reach | Charts and Charting in Excel | |||
Producing line and bar graphs on same axis | Charts and Charting in Excel | |||
Add data labels without displaying data points? | Charts and Charting in Excel |