Thanks:  0
Likes:  0

# Thread: PLeeeeease help. How to do combo line-column chart

1. I need to display vertical lines in my column chart to mark various limits. I know how to do the column chart programmatically, but how do I add the line chart and make vertical lines with it? Is it possible?

2. What does your data look like?

3. I am plotting histogram data with a column chart type. I want to draw vertical lines from the bottom of the plotarea to the top of the plotarea. I want to do this programmatically as I am creating about 40 charts of various test parameters. So the horizontal scale changes from chart to chart. Thanks for the reply

4. I believe I understand what you want... can you provide some sample data? You'll need to use an XY Chart, and then add your vertical lines as separate series. For example, to add a line at X=2.5 enter 2.5 into cell D1, 0 into cell E1, =D1 into D2, and 60 into E2. Set your Y-axis maximum value to 60. Copy D1:E2. Paste | Special... onto the Chart area. Add cells as New Series and check "Category (X Labels) in First Column". Or simply use the formula...

=SERIES(,Sheet1!\$D\$1:\$D\$2,Sheet1!\$E\$1:\$E\$2,2)

[ This Message was edited by: Mark W. on 2002-02-25 10:48 ]

5. Column "A" of my data has the frequency in each data bin and is plotted on the "Y" axis, column "B" has the data bins and is plotted on the "X" axis. Column "C" has the next parameter's frequency data and Column "D" has the next parameter's data bins. Here's the code I use:

ReDim binsArray(0 To Resolution)
stepValue = (MaxScale - MinScale) / Resolution

For j = 0 To Resolution
binsArray(j) = MinScale + stepValue * j
FinalChartBook.Worksheets("HistChartData") .Cells(j + 1, 2 * i) = binsArray(j)
Next j

Set dataRange =
.Range(.Cells(5, i), .Cells(NumRows, i))
Set resultsRange = FinalChartBook.Worksheets("HistChartData").
Range(FinalChartBook.Worksheets("HistChartData").Cells(1, (2 * i) - 1), FinalChartBook.Worksheets("HistChartData")
.Cells(Resolution + 1, (2 * i) - 1))
resultsRange = finalWB.Application.WorksheetFunction.Frequency(dataRange, binsArray)

6. See my edited posting above.

7. Can I simulate a column chart with the XY type chart? I want narrow lines for the range markers, but thick bars to display the histogram data.

Thanks for the help

8. Yes, click on any one of your charted histogram values and change it's chart type to Column.

9. Would it be easier to just draw line shapes ontop of my column chart, or would that be asking for trouble with resourses, etc.?

10. On 2002-02-25 12:33, rdionne wrote:
Would it be easier to just draw line shapes ontop of my column chart, or would that be asking for trouble with resourses, etc.?
I'd recommend against it... How good are you at positioning a drawn line? How are you gonna prevent the object from moving when your chart resizes? Why not let Excel calculate the proper position of the vertical line?

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•