Solved

# MFC Chart Drawing Axis at bottom of the graph with timestamp ( 2D data visualization class )

Posted on 2013-09-19
Medium Priority
863 Views
Hi,
I was using the graph project by Paul Barvinko available at http://www.codeproject.com/Articles/425/A-2D-data-visualisation-class
. I wanted to do two things.
I wanted to draw the x-axis at the bottom of the graph where as it is now at the top.
Also I wanted to use datetime values in the axis which is now not possible since I am not able to relate it with LOG/Pixels.
Kindly help.

Roopesh
0
Question by:Rooh
• 2

LVL 35

Accepted Solution

sarabande earned 1000 total points
ID: 39505617
I wanted to draw the x-axis at the bottom of the graph where as it is now at the top.
try to locate the code where the x-axis was created and where the positions were calculated. then post the code and we can help you.

Also I wanted to use datetime values in the axis which is now not possible since I am not able to relate it with LOG/Pixels.
first sort your date/time values. then write a function which calculates the timespan in hours (or minutes) from start time to each time point. you would have a little structure with two members, one for the date/time and one for the timespan. then you could do the mapping by using an array of the structure.

note, if you have the times as time_t values, the values are the seconds since 1/1/1970. so it is quite easy to calculate the spans. if the times are FILETIME it is nanoseconds and you also could easily compute differences. if they were SYSTEMTIME you could change them to FILETIME. you would use the span values instead of the time values for the graph. for the axis you would use time strings which for example could be formatted by strftime function.

Sara
0

Author Comment

ID: 39507959
Hi,
I could only change the size of the X axis drawing. I have tried span calculation not just for date and time but also for some other dimensions. I am not able to find a ratio with the axis measurements and the quantity I use.
Please see the attached code: https://www.dropbox.com/s/vbvotz8a91loijj/test_grafix_02.zip
0

LVL 35

Expert Comment

ID: 39508829
in my current environment i cannot open an unknown zip file.

also EE experts can only help but not do the work for you.

can you locate the functions where the x-axis was created and drawn? if yes, post the source code in a code block of your comment.

also the functions to provide data for the chart and to make the settings for scaling and labeling the axis would be interesting.

what do you mean by 'axis measurements' ?

Sara
0

## Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.