?
Solved

X/Y scaling with MSChart type 2dXY

Posted on 2009-07-03
2
Medium Priority
?
634 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
BrianVSoft earned 2000 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

762 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