Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-21-2020, 11:47 AM
massimodfd massimodfd is offline How to show X values on the X axis Windows XP How to show X values on the X axis Office 2010 32bit
Novice
How to show X values on the X axis
 
Join Date: Jan 2015
Posts: 15
massimodfd is on a distinguished road
Default How to show X values on the X axis


Hi all!!
Please, can you tell me how to show X values on the X axis ?
example:
X Y
1,2 20
2,4 23
4,5 15
9,1 22
When I create the graph, on X axis automatically the scale is set from 0 to 10 but the values 1,2 2,4 4,5 9,1 do not appears.
I need to have numeric values on X axis, so the values need to be at the right scaled position from 0 and not at a constant space between each ones.
How is it possible?

Thanks
Reply With Quote
  #2  
Old 11-21-2020, 01:55 PM
Purfleet Purfleet is offline How to show X values on the X axis Windows 10 How to show X values on the X axis Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

can you upload an example?
Reply With Quote
  #3  
Old 11-21-2020, 02:40 PM
massimodfd massimodfd is offline How to show X values on the X axis Windows XP How to show X values on the X axis Office 2010 32bit
Novice
How to show X values on the X axis
 
Join Date: Jan 2015
Posts: 15
massimodfd is on a distinguished road
Default

here is is
thanks!
example.jpg
Reply With Quote
  #4  
Old 11-21-2020, 03:48 PM
Purfleet Purfleet is offline How to show X values on the X axis Windows 10 How to show X values on the X axis Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

thats a picture, i need the workbook
Reply With Quote
  #5  
Old 11-22-2020, 01:41 AM
massimodfd massimodfd is offline How to show X values on the X axis Windows XP How to show X values on the X axis Office 2010 32bit
Novice
How to show X values on the X axis
 
Join Date: Jan 2015
Posts: 15
massimodfd is on a distinguished road
Default

here it is!
thanks
Attached Files
File Type: xlsx example.xlsx (13.2 KB, 8 views)
Reply With Quote
  #6  
Old 11-22-2020, 02:52 AM
Purfleet Purfleet is offline How to show X values on the X axis Windows 10 How to show X values on the X axis Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

you can change the Major units to 0.2 (or even 0.1) but due to the range of numbers it soon begins to look messy

Do you really need it as a line chart?
Attached Files
File Type: xlsx Copy of example_Purfleet.xlsx (17.2 KB, 5 views)
Reply With Quote
  #7  
Old 11-22-2020, 06:18 AM
massimodfd massimodfd is offline How to show X values on the X axis Windows XP How to show X values on the X axis Office 2010 32bit
Novice
How to show X values on the X axis
 
Join Date: Jan 2015
Posts: 15
massimodfd is on a distinguished road
Default

thanks !
but I need just X values 1,2 2,4 4,5 9,1 showed on the X axis .... not all the values!
I wonder if there's a way to do that
regards
Reply With Quote
  #8  
Old 11-22-2020, 09:02 AM
Purfleet Purfleet is offline How to show X values on the X axis Windows 10 How to show X values on the X axis Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

Right, how about this?
Attached Files
File Type: xlsx Copy of example-1_Purfleet.xlsx (13.5 KB, 6 views)
Reply With Quote
  #9  
Old 11-22-2020, 09:28 AM
p45cal's Avatar
p45cal p45cal is offline How to show X values on the X axis Windows 10 How to show X values on the X axis Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

You can cheat. See attached, button and notes in the code.
Code:
Sub blah()
Sheets("Foglio1").Copy After:=Sheets(Sheets.Count)    'makes a copy of the sheet; remove when development finished.
With ActiveSheet.ChartObjects("Grafico 1").Chart
  PlotTop = .PlotArea.Top
  OrigTop = .Axes(xlCategory).Top
  .Axes(xlCategory).MajorGridlines.Delete
  .Axes(xlCategory).Delete
  .PlotArea.Top = PlotTop - 10
  .FullSeriesCollection(1).ApplyDataLabels
  With .FullSeriesCollection(1).DataLabels
    .ShowCategoryName = True
    .ShowValue = False
    .Position = xlLabelPositionBelow
  End With
  For Each pt In .FullSeriesCollection(1).DataLabels
    pt.Top = OrigTop
  Next pt
End With
End Sub
Attached Files
File Type: xlsm msofficeforums46013example.xlsm (23.6 KB, 5 views)
Reply With Quote
  #10  
Old 11-22-2020, 10:01 AM
massimodfd massimodfd is offline How to show X values on the X axis Windows XP How to show X values on the X axis Office 2010 32bit
Novice
How to show X values on the X axis
 
Join Date: Jan 2015
Posts: 15
massimodfd is on a distinguished road
Default

Yes! that's what I am looking for. Thanks a lot. Topic solved.
Reply With Quote
  #11  
Old 11-23-2020, 02:48 AM
massimodfd massimodfd is offline How to show X values on the X axis Windows XP How to show X values on the X axis Office 2010 32bit
Novice
How to show X values on the X axis
 
Join Date: Jan 2015
Posts: 15
massimodfd is on a distinguished road
Default

I am just interested now how to apply the macro to another sheet, with much more data..... how to adapt the macro ?
Some questions:
1. how to adapt the macro to a specific data sheet ?
2. where is the instructions creating the "button" ?
3. where can I change the colour of the vertical line of the graph (currently grey)?

I have some experience of programming but in this case I cannot see any instructions easy to understand!

Thanks for your feedback
Reply With Quote
  #12  
Old 11-23-2020, 03:46 AM
p45cal's Avatar
p45cal p45cal is offline How to show X values on the X axis Windows 10 How to show X values on the X axis Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Quote:
Originally Posted by massimodfd View Post
1. how to adapt the macro to a specific data sheet ?
The macro works on a chart, not a sheet. Record a macro selecting the sheet and then the chart. Copy the code here and I'll show you how to tweak it.

Quote:
Originally Posted by massimodfd View Post
2. where is the instructions creating the "button" ?
Developer tab, Controls section, Insert dropdown: choose top left button (Form Controls, (Button, Form Control). Then click on the sheet, an Assign Macro dialogue box pops up: choose the macro from the list, Click OK.
Quote:
Originally Posted by massimodfd View Post
3. where can I change the colour of the vertical line of the graph (currently grey)?
Manually, select one of them (all will be selected), right-click and choose Format Leader lines… you can select the colour in the pane which appears on the right. Automated, you need to use the likes of one of these:
Code:
    ActiveChart.FullSeriesCollection(1).LeaderLines.Format.Line.ForeColor.RGB = vbRed
    ActiveChart.FullSeriesCollection(1).LeaderLines.Format.Line.ForeColor.RGB = RGB(23, 185, 65)
    ActiveChart.FullSeriesCollection(1).LeaderLines.Format.Line.ForeColor.RGB = 11817066
To get the values after the equals sign for a specific colour of your liking, record a macro of you changing the colour of any line, fill of a cell, font colour, preferably using the More Colours… option, then the Custom tab (where you can see the individual Red/Green/Blue values) and you should see amongst the lines of recorded code the likes of:
Code:
.Color = 10605937
.ForeColor.RGB = RGB(46, 218, 46)
Use those values.
Reply With Quote
  #13  
Old 11-23-2020, 09:49 AM
massimodfd massimodfd is offline How to show X values on the X axis Windows XP How to show X values on the X axis Office 2010 32bit
Novice
How to show X values on the X axis
 
Join Date: Jan 2015
Posts: 15
massimodfd is on a distinguished road
Default

Thanks ! Very kind of you to explain all. I will review and try and in case of need I will get back to you.
Again, thank you!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set specific axis values in graphs Esaylikepie Excel 0 10-16-2016 04:31 AM
How to show X values on the X axis Format Chart X axis - inconsistent values TimTDP Excel 2 12-01-2015 02:56 AM
How to show X values on the X axis X axis does not show Years from data MARENG Excel 8 01-20-2015 10:45 AM
Secondry Axis overlapping in bar chart dual axis in Powerpoint 2010 sharath_ms PowerPoint 0 07-08-2013 10:06 PM
how do I add data values in Col A into X axis on bar graph? hazz Excel 1 04-27-2010 01:42 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft