Java Counterpart for VB "FigureIncrement"

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
cathy
Newbie
Newbie
Posts: 8
Joined: Tue Mar 11, 2008 12:00 am

Java Counterpart for VB "FigureIncrement"

Post by cathy » Mon Jul 14, 2008 10:55 pm

I am coding in Java what has been coded in the same application in VB in order to match the same appearance of numerous graphs.

One of the graphs is a 2d line graph with "years" across the bottom and account values on the left. I am graphing anywhere from 7 to 12 xy coordinates. The VB application keeps up with the smallest and the largest value - then sets the Left axis minimum and maximum value (which I am also doing in Java) - but it also uses the method Figure Increment - and for one example the left axis has 5 increments - 5,000,000; 7,500,000;10,000,000, 12,500,000, and 15,000,000.

The values that were plotted were 5314922,6258615,6258615,6653647,6655367,7303844,7303844,8642993,8726223,10690395,10782157,13230826

VBCode:

dTemp = dMax - dMin
dMax = dMax + (dTemp * 0.25)
dMin = dMin - (dTemp * 0.25)
If (dMin < 0) Then dMin = 0
.Axis.Left.SetMinMax dMin, dMax
.Axis.Left.Increment = FigureIncrement(dTemp)

Java Code:
myChart.getAxes().getLeft().setMinimum(dMin);
myChart.getAxes().getLeft().setMaximum(dMax);

dMin was 2942293.5 and dMax was 1.52885325E7

My Java graph axis starts at 5,500,000 and increments by 500,000 to 13,000,000.

How do I get it to mimic the VB code?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 15, 2008 10:05 am

Hi cathy,

FigureIncrement is a method from yours? As far as I can see it's neither a TeeChart method nor a Visual Basic method.

In Java version you should be able to implement the same doing something like this:

Code: Select all

myChart.getAxes().getLeft().setMinMax(dMin,dMax);
or

Code: Select all

myChart.getAxes().getLeft().setAutomaticMinimum(false);
myChart.getAxes().getLeft().setAutomaticMaximum(false);
myChart.getAxes().getLeft().setMinimum(dMin);
myChart.getAxes().getLeft().setMaximum(dMax);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply