+ Reply to Thread
Results 1 to 10 of 10

All the series lines in the chart are drawn on the same line

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    10

    All the series lines in the chart are drawn on the same line

    I don't know what is wrong with my code.
    Does anyone know what I have done wrong?

    I include most of the code:
    Please Login or Register  to view this content.
    If I understand how the chart works the different series lines should be drawn at different places with this code:
    (and I have checked so the different cells does not contain the same values)
    Please Login or Register  to view this content.
    I include a picture of how the chart looks like.
    For the complete code, look at my earlier question at http://www.excelforum.com/excel-char...-with-vba.html
    Attached Images Attached Images
    Last edited by JMicke; 02-10-2012 at 03:53 AM.

  2. #2
    Registered User
    Join Date
    01-26-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: All the series lines in the chart are drawn on the same line

    Or maybe not drawn at the same line, but atleast not on the intended place.
    I swapped places with the xvalues and values:
    Please Login or Register  to view this content.
    when I run the code I get this chart Chart2.jpg

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: All the series lines in the chart are drawn on the same line

    Post an example of how you want the chart to look. What should be on the category axis , series name and values.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    01-26-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: All the series lines in the chart are drawn on the same line

    The thought was that the chart should look like something like the attached chart Chart3.jpg
    The names on the series is correct in my first chart, just not the position of the lines

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: All the series lines in the chart are drawn on the same line

    Try swapping the .Values and .XValues assignments.
    XValues are the horizontal axis data points or Labels
    Values are the vertical axis data positions

  6. #6
    Registered User
    Join Date
    01-26-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: All the series lines in the chart are drawn on the same line

    I did that above. in the chart.jpg picture in my first post and swapped values and showed how the chart looked with swapped values in chart2.jpg in my second post.
    (I also included the changed code in the 2 postings)

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: All the series lines in the chart are drawn on the same line

    Are the values true values or text. I assume the 224,17 was your regional setting for 224.17. So in my tests I converted the text to true numbers and create the chart you describe with horizontal lines for the repeating values.

  8. #8
    Registered User
    Join Date
    01-26-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: All the series lines in the chart are drawn on the same line

    Yes, we use a "," sign as a decimal sign in sweden. The values are true values, and it correctly can count the average in cell I23.

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: All the series lines in the chart are drawn on the same line

    So if I convert the output values to use period rather than comma as decimal place holder and swap xvalues/values I get the following output.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-26-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: All the series lines in the chart are drawn on the same line

    Hmm, very strange, seems your chart is ok, except for the line that is only shown in my chart.jpg, but I guess you didn't convert that line since its done in the sub Addchart.
    I guess I'll have to think about this, thanks for the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1