Solved

X/Y scaling with MSChart type 2dXY

Posted on 2009-07-03
2
614 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DIR issue 7 51
MS Access - Capture pressed key onclick 4 28
MS Access Search and Replace Using VBA 6 57
MS Access 03, TransferText, decimal places 8 46
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

895 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