Solved

X/Y scaling with MSChart type 2dXY

Posted on 2009-07-03
2
610 Views
Last Modified: 2012-05-07
VB6: My application produces an X/Y plot of data.  I am using MSChart type 2dXY.  The "autoscale" is enabled.

The X and Y axes evidently are scaled identically.  This means that, if the span of data for X, and that for Y, are not equal, the plot is not a square.

The span of data to be plotted varies.
My X data ranges from 0 to perhaps 1000.  My Y data typically goes from 0 to 100 or 200.
This produces a really "squished" picture.

I would like to specify the actual screen dimensions of the plot, no matter how the scale numbers are autoscaled.  Is this possible?

This is a simple plot, and it occurred to me that I could take the trouble to write the code to do my own plot.  But it would be easier to use MSChart, if I could force it to the screen dimensions I want.
0
Comment
Question by:NormaPosy
2 Comments
 
LVL 5

Accepted Solution

by:
BrianVSoft earned 500 total points
ID: 24776325
Hi again,
I have used MSChart many times, but not for a few years.. I don't remember ever having a "squashed" aspect.. It always stretched the Y axis to fill the MyChart.Height dimension..
Check if you are able to achieve a good aspect by simply placing "MyChart.Height = xx" at the end of your fill routine?
I now use my own function to draw simple 2D - multi-line charts in Picture boxes.. It is less than 50 lines of code and can be used for a variety of situations.. I can attach a code example if you continue to have trouble..
0
 

Author Comment

by:NormaPosy
ID: 24776927
Yes.  Me too.  I have an old code I once wrote which I can dig up.  It acceped parameters for scaling, axis labelling, etc, and just drew the plot.

For general use, autoscaling is a bit tricky.  For specific data, the scaling can be "hard wred".

You are right about how 2dXY does it.  The Y axis fills the height, and the "inches per unit" for both axes are identical, which means the X axis length is a function of the data ratio.  Should be independant and under code control.

Thank you.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now