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

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.

Thanks in advance,
Roopesh
RoohAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sarabandeCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RoohAuthor Commented:
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
sarabandeCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.