Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart2D for Java
 autoscale on DataLoggerView variation

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
gstola Posted - 19 Jun 2015 : 15:20:18
Hi,

I am working on a data logger application. I took DataLoggerView.java from dynamicscharts example as a base.

My issue occurs when my traces evolves in a way that they occupies a smaller part of the chart, without rescaling it. In other words, y-axis should zoom in but it doesnt.

So, I went back to the dynamicscharts example to check where was my mistake by comparing both codes. There, I just made a small change, to force the traces tendence. In practice, Ive modulated the four traces with an exponential, to guarantee that traces converged to some positive value. Under that context, I found that the y-axis didnt zoom in. That is, the four traces were around 800, but the x-axis still was there.

In short how should DataLoggerView example be changed so it autoscales in a way that always occupies most of the chart?

Thank you!
Gerardo
1   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 20 Jun 2015 : 09:20:42
The auto-scaling in the Datalogger example takes place in the addNewPoints method, in the following lines. The call to pTransform1.autoScale is what rescales the y-scale to current data. The calcAutoAxis calls make sure the existing axes adapt to the new scale.


    xValues = Dataset1.getTimeXData();
    nNumPnts = Dataset1.getNumberDatapoints();
    pTransform1.autoScale(Dataset1,ChartConstants.AUTOAXES_NEAR,  ChartConstants.AUTOAXES_NEAR);
    if (fixedStartTimeFlag)
      pTransform1.setTimeScaleStart(xValues[0]); // peg start of graph at start of data
    else // Set a 100 point view into data
      pTransform1.setTimeScaleStart(Dataset1.getTimeXDataValue(Dataset1.getNumberDatapoints()-100));

     xAxis1.calcAutoAxis();
     yAxis1.calcAutoAxis();
     xAxisLab1.calcAutoAxisLabels();
     yAxisLab1.calcAutoAxisLabels();


So you must do something similar in your own code. If you can't get it to work, show exactly what code you are using to achieve the auto-scaling of the y-scale and axis.

Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07