Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart2D for Java
 Fixing Y-Axis to a certain range of values...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

javaman

22 Posts

Posted - 05 May 2009 :  14:51:54  Show Profile  Reply with Quote
Hi,

I have a plot that receives a ton of data - and the data is normally centered around a certain value (say 15000). This plot is a time-series plot. Now, sometimes we get invalid data (usually a 0 value) which is okay - but this throws off the displayed Y-Axis - it now goes from 0 - 15000 - and all the data is scrunched at the top with that one point at the bottom.

The question is whether I can fix the Y-Axis to a certain range - and those that fall outside that range are just not shown in the plot? Thus, for instance, my Y-Axis would range from say 14800 to 15200.

Any ideas on this or do you need more info?

thanx.

Thanx - Joe!

quinncurtis

1164 Posts

Posted - 05 May 2009 :  15:52:27  Show Profile  Reply with Quote
You can define a coordinate system to any range you want; you do not have to use the auto-scaling. This is all discussed in Chapter 4 - Scaling and Coordinate Systems.

double xMin = -5;
double xMax = 15;
double yMin = 0;
double yMax = 105;
CartesianCoordinates simpleScale;
simpleScale = new CartesianCoordinates(xMin, yMin, xMax, yMax);



It may be that you want to first auto-scale, and then change one or more of the minimum or maximum values. Again, Chapter 4 discusses this.

double [] xData = {2,3,4,5,6,7,8,9};
double [] yData = { 22, 33, 44, 55, 46, 33, 25, 14};
SimpleDataset dataset = new SimpleDataset("“Sales", xData, yData);
CartesianCoordinates simpleScale = new CartesianCoordinates();
simpleScale.autoScale(dataset);
simpleScale.setScaleStartY(20);



Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07