Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    118

    Chart Reference Line


    I am new to charts. I have a simple bar chart and I want to have a reference line so I can see how far over/under the values in the chart are. The chart is on a form. Should it be on a report? I also can't find anything online about how to add a reference line that makes sense to me. Any suggestions would be appreciated. Sample DB attached
    Attached Files Attached Files
    Last edited by JonathanT; 07-24-2023 at 12:50 PM.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Are you using Modern Chart? I can't help with those. I can only use classic MSGraph which has a line-column custom chart. When I open your db I don't even see any chart. Should there be? If there were, I probably couldn't even open db because I use Access 2010.

    Perhaps what I did can be applied to Modern Chart.

    1. bind form or report to table BoodData and a textbox named tbxID bound to TestID

    2. build a UNION query named DataUNION (I tested with only 5 data fields, add whatever you want):
    SELECT CholesterolTotal, [HDL Cholesterol], [Non-HDL Cholesterol], [LDL Cholesteral], [CHOL-HDLC-Ratio], 1 AS SortOrder FROM BoodData WHERE TestID = Forms!Cholesteral!tbxID
    UNION SELECT 150, 50, 100, 100, 3.5, 2 FROM BoodData;

    3. build a chart of any type then modify to custom line-column and set RowSource to:
    SELECT CholesterolTotal, [HDL Cholesterol], [Non-HDL Cholesterol], [LDL Cholesteral], [CHOL-HDLC-Ratio] FROM DataUNION ORDER BY SortOrder;

    Chart can be on form or report.

    Seem to have left the "l" out of word blood in table and query names.

    Advise not to use spaces nor punctuation/special characters in naming convention.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by JonathanT View Post
    I am new to charts. I have a simple bar chart and I want to have a reference line so I can see how far over/under the values in the chart are. The chart is on a form. Should it be on a report? I also can't find anything online about how to add a reference line that makes sense to me. Any suggestions would be appreciated. Sample DB attached
    Where is the data or the "reference line" that you mention
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    118
    The data is in the CholesterolQry and the chart is on the Cholesterol form

  5. #5
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    118
    I want to put a reference line on the chart at 200 on the Y-axis

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Did you read post #2?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    June
    Databases containing modern charts can be opened in earlier versions such as 2010. However, there will be an empty space where the chart should be.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    118
    June7, Thanks for the suggestion regarding naming conventions and misspellings. I have corrected those and inserted the updated DB. Is item 3 in your original post how to add a reference line in my current chart? Unless I'm really confused I don't think I need a new query to add a reference line

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What I showed were steps for what I accomplished. Step 2 is a UNION query to add reference line data. If you don't think this is needed, what do you suggest?

    Why do you have a GROUP BY clause when there is no aggregation of data?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    If you are using the older classic charts, just set the x-axis to cross at 200.

    Unfortunately that isn't possible in a modern chart
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    With Colin's suggestion also have set Maximum Y axis scale above 200. Then the bars start against the 200 line and stretch left toward zero. Odd looking and doesn't make sense to me.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi Jonathan

    Is the Reference Line shown in the attached what you need?
    Attached Files Attached Files
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  14. #14
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    118
    mike60smart, that is not what I am looking for. I would like a straight horizontal line from left to right at level 200 of the Y axis

  15. #15
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    118
    June7, I should have told you this earlier, I am using a Modern Chart.

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. MSGraph Chart.8 Line - Column
    By bmk450 in forum Reports
    Replies: 0
    Last Post: 03-11-2020, 09:19 AM
  2. line chart on report
    By BobW2961 in forum Reports
    Replies: 2
    Last Post: 08-15-2018, 11:38 AM
  3. line chart not showing lines
    By ajetrumpet in forum Reports
    Replies: 0
    Last Post: 09-11-2010, 05:55 PM
  4. Replies: 2
    Last Post: 07-12-2010, 05:39 AM
  5. Line-Bar Chart Issue
    By santoshpk in forum Reports
    Replies: 0
    Last Post: 03-17-2009, 02:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums