Page 1 of 1

Scrolling past data set

Posted: Mon Aug 27, 2012 7:56 pm
by 17060923
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!

Re: Scrolling past data set

Posted: Tue Aug 28, 2012 4:03 pm
by yeray
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.