473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Ms graph axis title

Hi friends,
i am using ms access 2003.

I have used ms graph in a form.
Now i want to set the x-axis and y-axis titles programatically.
usaully we set titles for axis by going to chart options and.............

but how can we set then programatically?


Thank you
Dec 8 '07 #1
6 13486
puppydogbuddy
1,923 Expert 1GB
Hi friends,
i am using ms access 2003.

I have used ms graph in a form.
Now i want to set the x-axis and y-axis titles programatically.
usaully we set titles for axis by going to chart options and.............

but how can we set then programatically?


Thank you
A great reference source for dealing with the chart object programatically is as follows: microsoft.com/default.aspx?scid=kb;EN-US;186855


In answer to your question, the following code is adapted from code written by Bob Bedell. In order for the code to work, you need to add a reference to the Microsoft Graph XX.X Object Library.:

In the illustration below, the chart control is named "TestChart". This is the OLE object embedded in the report or form that serves as a container control for the Chart object (similar to the way Forms are embedded in SubForm container controls). "Chart" is the ActiveX object hosted by the OLE container control.

The use of "Me.TestChart.Object.Application.Chart" in the example returns a reference to the ActiveX control (the reference assigned to the objChart object variable)


Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Opent(Cancel As Integer)
  2.  
  3.     Dim objChart As Chart
  4.     Set objChart = Me.TestChart.Object.Application.Chart
  5.  
  6.     ' Change chart title
  7.     objChart.ChartTitle.Text = "New Title"
  8.  
  9.     ' Format legend text
  10.     objChart.Legend.Font.ColorIndex = 5
  11.     objChart.Legend.Font.Bold = True
  12.  
  13. End Sub
Dec 9 '07 #2
Thank you friend.

But the code did'nt have any option to put title of axis.
we can put the title of the Chart.
But i want to set the titles for x and y axes.

also the link is not working. That link directly took me to home page.


What to do?

Thank you
Dec 10 '07 #3
puppydogbuddy
1,923 Expert 1GB
Thank you friend.

But the code did'nt have any option to put title of axis.
we can put the title of the Chart.
But i want to set the titles for x and y axes.

also the link is not working. That link directly took me to home page.


What to do?

Thank you
Sorry about that, here is the correction to the previous link plus additional link that I found in my files.

http://support.microsoft.com/kb/186855

http://www.download.com/3000-2251_4-....html?tag=dl.1

I will get back to you as soon as I can on the other info.
Dec 10 '07 #4
i will get back to you as soon as I can on the other info.

ok thank you friend for the links and your response. If you find that please get back
Dec 10 '07 #5
Hi friend,
welcome back.

atlast i solved the problem .
'for x axis tile
Me.YourGraphName.Object.Axes(1, 1).AxisTitle.caption = "hello"

'for y-axis title
Me.YourGraphName.Object.Axes(2, 1).AxisTitle.caption = "hello"


but before doing this make sure that you have set the x-axis and y-axis tiltes with some name by manually.
Dec 10 '07 #6
puppydogbuddy
1,923 Expert 1GB
Hi friend,
welcome back.

atlast i solved the problem .
'for x axis tile
Me.YourGraphName.Object.Axes(1, 1).AxisTitle.caption = "hello"

'for y-axis title
Me.YourGraphName.Object.Axes(2, 1).AxisTitle.caption = "hello"


but before doing this make sure that you have set the x-axis and y-axis tiltes with some name by manually.
Hi ravindarjobs,
I am glad you got your problem resolved. And thanks for posting back with the solution. It will help others with the same problem. Did the links I gave you help you? Let us know.
Dec 11 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: TeraNews | last post by:
I have a sample graph using GD::Graph::Lines, it's a simple X-Y line graph (www.bitmosphere.com/cgi-bin/graph.pl) I want to change the color of the graph border, and the tick lines (vertical and...
1
by: JD Kronicz | last post by:
Hi .. I have an issue I have been beating my head against the wall on for some time. I am trying to use late binding for MS graph so that my end users don't have to worry about having the right...
3
by: Jeff | last post by:
Hi I have a report with a graph on it and want to change the minimum and maximum values for the value axis when it is previewed. This can't be done by adding code in the Open event as once the...
3
by: Jeff | last post by:
Does anyone have any suggestions about a good third party graph control. The one in Access seems confusing to use. Is there a control that could be said to be an industry standard? Jeff
0
by: rdemyan via AccessMonster.com | last post by:
Has anyone run into the problem of the Y-axis title in MS Graph being truncated on a wide-screen display?? -- Message posted via http://www.accessmonster.com
2
by: smith.mariya | last post by:
hi, i am mariya. i am working on vb.net. i have created the powerpoint addin. i have inserted the chart on the slide through vb.net code. now, i want to remove the gridlines on the chart and want...
5
by: rekhasc | last post by:
hi all............... in my proj i am using a mschart .... now what i want is i want to display the graph amount v/s months I did the graph which shows date v/s amount its working good... i used...
0
by: Just_a_fan | last post by:
Some folks have searched, from time to time, for a dual axis MSChart with different scales on the two Y axes. The sample, extracted from running code I wrote, produces a graph with MSChart (VB9)...
0
by: eureka2050 | last post by:
Hi all, I am creating a radar chart containing 2 plots using jpgraph. My code is as follows:- include ("./jpgraph/src/jpgraph.php"); include ("./jpgraph/src/jpgraph_radar.php"); //...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.