Solved

X/Y scaling with MSChart type 2dXY

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

717 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