PLeeeeease help. How to do combo line-column chart
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

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

  1. #1
    New Member
    Join Date
    Feb 2002
    Location
    Texas Instruments
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    What does your data look like?

  3. #3
    New Member
    Join Date
    Feb 2002
    Location
    Texas Instruments
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #5
    Guest

    Default

    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. #6
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    See my edited posting above.

  7. #7
    New Member
    Join Date
    Feb 2002
    Location
    Texas Instruments
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #8
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

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

  9. #9
    New Member
    Join Date
    Feb 2002
    Location
    Texas Instruments
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #10
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    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

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com