473,396 Members | 1,775 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,396 software developers and data experts.

charting - time axis

Hi,
I want to create a chart
value (y-axis) vs. time (x-axis). In fact very similar to the
xy(scatter) example in the graph10.chm help-file.

I ran into problems, so I started a very basic *.mdb file.

It contains one table with ID, Date, and Price (Value) Column
ID is automatically assigned
Date is in the short date format
and Price is a long integer
I entered 10 datasets.

Then I created a query (the simplest one I could imagine)
SELECT tbl_Basis.Date, tbl_Basis.Price
FROM tbl_Basis
ORDER BY tbl_Basis.Date;

Then I created a form and inserted a "MS Graph Chart" Object, and set
the row source to the query. I changed the chart type to scatter, and
the number format of the x-axis to Date ("14/03/2001").

Now the problem: When I execute the form, all my data points are on
01/01/1900 and have different colours. When I change the x-axis number
format to general, they are all at "1".

Why would that be? I tried setting lond date instead of number format in
the table and in the properties of the query I set different number
formats - nothing has changed.

I appreciate any help,
thanks,
Claus
Nov 13 '05 #1
3 3674
On Sun, 10 Jul 2005 14:42:24 -0400, Claus Haslauer
<ch******@scimail.uwaterloo.ca> wrote:
Hi,
I want to create a chart
value (y-axis) vs. time (x-axis). In fact very similar to the
xy(scatter) example in the graph10.chm help-file.

I ran into problems, so I started a very basic *.mdb file.

It contains one table with ID, Date, and Price (Value) Column
ID is automatically assigned
Date is in the short date format
and Price is a long integer
I entered 10 datasets.

Then I created a query (the simplest one I could imagine)
SELECT tbl_Basis.Date, tbl_Basis.Price
FROM tbl_Basis
ORDER BY tbl_Basis.Date;

Then I created a form and inserted a "MS Graph Chart" Object, and set
the row source to the query. I changed the chart type to scatter, and
the number format of the x-axis to Date ("14/03/2001").

Now the problem: When I execute the form, all my data points are on
01/01/1900 and have different colours. When I change the x-axis number
format to general, they are all at "1".

Why would that be? I tried setting lond date instead of number format in
the table and in the properties of the query I set different number
formats - nothing has changed.

I appreciate any help,
thanks,
Claus

Hi
Few questions about charts get answered in this group, maybe it is a
black art only understood by Excel users. I hope this reply doesn't
put off anyone more expert answering you.

The problem is that charts are based on totals queries and regard
plotting an ordinary X-Y graph as some kind of PhD project.

I usually introduce an exta variable in the data which always has the
value 1, and then make the chart regard this as one of a series of
values to be plotted.

You can use a query like that below as source for a scatter plot:

TRANSFORM Max(tbl_Basis.price) AS MaxOfPrice SELECT
(Format([mydate],"mmm"" '""yy")) AS Expr1 FROM tbl_Basis GROUP BY
(Year([mydate])*12+Month([mydate])-1), tbl_Basis.mydate,
(Format([mydate],"mmm"" '""yy")) PIVOT 1;

If you look at the output of the query you can see what input the
chart expects.

I have used mydate as a table field as I don't like to use reserved
words. Not the extra date in the group by in case there are two items
in one month. If there are two with the same date it will just show
the biggest. Of course if you prefer you can use SumOf rather than
MaxOf and just group by month or whatever.

HTH
David

Nov 13 '05 #2
On 11 Jul 2005 05:00:02 -0500, not@here (David Schofield) wrote:

NO NO NO to my previous post ! Think twice, post once.
See the corrected SQL below
David
On Sun, 10 Jul 2005 14:42:24 -0400, Claus Haslauer
<ch******@scimail.uwaterloo.ca> wrote:
Hi,
I want to create a chart
value (y-axis) vs. time (x-axis). In fact very similar to the
xy(scatter) example in the graph10.chm help-file.

I ran into problems, so I started a very basic *.mdb file.

It contains one table with ID, Date, and Price (Value) Column
ID is automatically assigned
Date is in the short date format
and Price is a long integer
I entered 10 datasets.

Then I created a query (the simplest one I could imagine)
SELECT tbl_Basis.Date, tbl_Basis.Price
FROM tbl_Basis
ORDER BY tbl_Basis.Date;

Then I created a form and inserted a "MS Graph Chart" Object, and set
the row source to the query. I changed the chart type to scatter, and
the number format of the x-axis to Date ("14/03/2001").

Now the problem: When I execute the form, all my data points are on
01/01/1900 and have different colours. When I change the x-axis number
format to general, they are all at "1".

Why would that be? I tried setting lond date instead of number format in
the table and in the properties of the query I set different number
formats - nothing has changed.

I appreciate any help,
thanks,
ClausHi
Few questions about charts get answered in this group, maybe it is a
black art only understood by Excel users. I hope this reply doesn't
put off anyone more expert answering you.

The problem is that charts are based on totals queries and regard
plotting an ordinary X-Y graph as some kind of PhD project.

I usually introduce an exta variable in the data which always has the
value 1, and then make the chart regard this as one of a series of
values to be plotted.

You can use a query like that below as source for a scatter plot:

TRANSFORM Max(tbl_Basis.price) AS MaxOfPrice SELECT tbl_Basis.mydate
FROM tbl_Basis GROUP BY tbl_Basis.mydate PIVOT 1;
If you look at the output of the query you can see what input the
chart expects.

I have used mydate as a table field as I don't like to use reserved
words.
iIf there are two items with the same date it will just show
the biggest. Of course if you prefer you can use SumOf rather than
MaxOf and just group by month or whatever.

HTH
David

Hi
NO NO NO to my previous post ! Think twice, post once.
See the corrected SQL above

David

Nov 13 '05 #3
Hey David,
thanks a lot!
The tip with the crosstabs works nicely.

@all:
one thing I found out about continous timeline on the x-axis
If it is linear from a beginning to end or if it only shows the values
in the rowsource, seems to depend on the way the date is format.

Format([MyDate],"yyyy mm") results in a axis where each value is shown
at the same distance, even if they are differently long apart
Format([MyDate],"mmm yy") results in a linear time axis from the first
date to the last date in the rowsource.

Is there a reson behind that?
David Schofield wrote:
On 11 Jul 2005 05:00:02 -0500, not@here (David Schofield) wrote:

NO NO NO to my previous post ! Think twice, post once.
See the corrected SQL below
David

On Sun, 10 Jul 2005 14:42:24 -0400, Claus Haslauer
<ch******@scimail.uwaterloo.ca> wrote:

Hi,
I want to create a chart
value (y-axis) vs. time (x-axis). In fact very similar to the
xy(scatter) example in the graph10.chm help-file.

I ran into problems, so I started a very basic *.mdb file.

It contains one table with ID, Date, and Price (Value) Column
ID is automatically assigned
Date is in the short date format
and Price is a long integer
I entered 10 datasets.

Then I created a query (the simplest one I could imagine)
SELECT tbl_Basis.Date, tbl_Basis.Price

FROM tbl_Basis

ORDER BY tbl_Basis.Date;

Then I created a form and inserted a "MS Graph Chart" Object, and set
the row source to the query. I changed the chart type to scatter, and
the number format of the x-axis to Date ("14/03/2001").

Now the problem: When I execute the form, all my data points are on
01/01/1900 and have different colours. When I change the x-axis number
format to general, they are all at "1".

Why would that be? I tried setting lond date instead of number format in
the table and in the properties of the query I set different number
formats - nothing has changed.

I appreciate any help,
thanks,
Claus


Hi
Few questions about charts get answered in this group, maybe it is a
black art only understood by Excel users. I hope this reply doesn't
put off anyone more expert answering you.

The problem is that charts are based on totals queries and regard
plotting an ordinary X-Y graph as some kind of PhD project.

I usually introduce an exta variable in the data which always has the
value 1, and then make the chart regard this as one of a series of
values to be plotted.

You can use a query like that below as source for a scatter plot:


TRANSFORM Max(tbl_Basis.price) AS MaxOfPrice SELECT tbl_Basis.mydate
FROM tbl_Basis GROUP BY tbl_Basis.mydate PIVOT 1;
If you look at the output of the query you can see what input the
chart expects.

I have used mydate as a table field as I don't like to use reserved
words.
iIf there are two items with the same date it will just show
the biggest. Of course if you prefer you can use SumOf rather than
MaxOf and just group by month or whatever.

HTH
David


Hi
NO NO NO to my previous post ! Think twice, post once.
See the corrected SQL above

David

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Gerrit Holl | last post by:
Hi, I have a dictionairy containing DateTime objects as keys and integers as values. What would be the easiest way to create a simple plot of these, with a number axis versus a time axis? What...
4
by: Brian | last post by:
I want to develop an application that has an oscilliscope . I was wondering if anyone has experience (good or bad) of any commercial charting packages that will provide this sort of functionality....
8
by: Baloff | last post by:
Hello Before I embark on a google journey, I thought it would be good to get a starting hints here first. What am up against? I need to be able to chart a given sequence and be able to zoom...
6
by: DG | last post by:
is there a charting control that comes with visual studio or i'll have to buy one? what do you reccomend? thanx
1
by: Marty | last post by:
Hi, Just want to know if you have any idea how to add a time axis on the VB6 MSChart ? I use it in my VB.NET project. Thanks, Marty
2
by: sandeepa | last post by:
I am trying to make some kind of a data logger with say 16 channels.So far I have managed to get the data from the serial port and plot it on a chart.(using MSChart)I just store the data of each...
4
by: tbonejo | last post by:
Hi all. Question: I have a project nearly complete written in VB.Net using charts from 3rd party vendors...expensive, yes, fast, not really. The data I am plotting is about 30 columns by...
3
by: Igor | last post by:
Hi all, I'm looking for a tool that can design charts and save chart definitions in a file. I would put those chart definitions in a database and then later load them and render charts (as...
20
by: Joe | last post by:
Is any one charting packing considered to be the "best"? We've used ChartFX but wasn't too happy about the way data had to be populated along with some other issues which slip my mind right now and...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.