Scrolling past data set

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
jmifkovich
Newbie
Newbie
Posts: 1
Joined: Mon Dec 05, 2011 12:00 am

Scrolling past data set

Post by jmifkovich » Mon Aug 27, 2012 7:56 pm

Hi,
I'm trying to create a chart that prevents scrolling past the end of a data set using v1 for Android. I've already read tutorial 8
http://www.steema.com/files/public/teec ... orial8.htm

The following example seems to be exactly what I want to do. Can anyone direct me to where this snippet of code was taken from, or a similar example?

private void Load() {
int range = com.steema.teechart.Utils.Round((bar1.getXValues().getMaximum() - bar1.getXValues().getMinimum() / 2));
bar1.fillSampleValues(20);
tChart1.getPanning().setAllow(ScrollModes.NONE);
jScrollBar1.setValue(range);
jScrollBar1.setMinimum(range - 50);
jScrollBar1.setMaximum(range + 50);
}


public void jScrollBar1_propertyChange(PropertyChangeEvent evt) {
tChart1.getAxes().getBottom().setAutomatic(false);
tChart1.getAxes().getBottom().setMinimum(jScrollBar1.getValue());
tChart1.getAxes().getBottom().setMaximum(jScrollBar1.getValue() + bar1.getCount());
}

Thanks!

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Scrolling past data set

Post by Yeray » Tue Aug 28, 2012 4:03 pm

Hi,

The example you noticed is from an SWT/Swing project, not an Android one. And, the ScrollBars are substituted by ScrollViews in Android.
In Android you could use the PanData tool as in the features demo project included with TeeChart Java for Android.
To limit the scroll it allows, you should modify that tool manually.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply