PLeeeeease help. How to do combo line-column chart

rdionne

New Member
Joined
Feb 21, 2002
Messages
47
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?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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
 
Upvote 0
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
 
Upvote 0
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)
 
Upvote 0
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
 
Upvote 0
Yes, click on any one of your charted histogram values and change it's chart type to Column.
 
Upvote 0
Would it be easier to just draw line shapes ontop of my column chart, or would that be asking for trouble with resourses, etc.?
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,223,327
Messages
6,171,481
Members
452,407
Latest member
Broken Calculator

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top