SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
SciChart Android ships with ~90Â Android Chart Examples which you can browse, play with, view the source-code and even export each SciChart Android Chart Example to a stand-alone Android Studio project. All of this is possible with the new and improved SciChart Android Examples Suite, which ships as part of our Android Charts SDK.
Generates an Impulse-response style chart with optional point-marker in code. The FastImpulseRenderableSeries can be used to render an XyDataSeries (which contains one X-point and one Y-point), XyyDataSeries (renders Y values), XyzDataSeries, HlDataSeries and OhlcDataSeries(renders Close values).
Impulse Chart can be used to visualize Digital Filter responses, or scientific charts, for instance, mass spectra.
Tip!
You can add optional data-point markers to a impulse series using the PointMarker API. This is very performant and uses the same bitmap rendering as our Scatter-Charts.
The full source code for the Android Impulse (Stem) Chart example is included below (Scroll down!).
Did you know you can also view the source code from one of the following sources as well?
//******************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2021. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// ImpulseChartFragment.kt is part of SCICHART®, High Performance Scientific Charts
// For full terms and conditions of the license, see http://www.scichart.com/scichart-eula/
//
// This source code is protected by international copyright law. Unauthorized
// reproduction, reverse-engineering, or distribution of all or any portion of
// this source code is strictly prohibited.
//
// This source code contains confidential and proprietary trade secrets of
// SciChart Ltd., and should at no time be copied, transferred, sold,
// distributed or made available without express written permission.
//******************************************************************************
package com.scichart.examples.fragments.examples2d.basicChartTypes.kt
import android.view.animation.DecelerateInterpolator
import com.scichart.charting.visuals.SciChartSurface
import com.scichart.data.model.DoubleRange
import com.scichart.examples.data.DataManager
import com.scichart.examples.fragments.base.ExampleSingleChartBaseFragment
import com.scichart.examples.utils.scichartExtensions.*
class ImpulseChartFragment : ExampleSingleChartBaseFragment() {
override fun initExample(surface: SciChartSurface) {
val ds1Points = DataManager.getInstance().getDampedSinewave(1.0, 0.05, 50, 5)
surface.suspendUpdates {
xAxes { numericAxis { growBy = DoubleRange(0.1, 0.1) }}
yAxes { numericAxis { growBy = DoubleRange(0.1, 0.1) }}
renderableSeries {
fastImpulseRenderableSeries {
xyDataSeries<Double, Double> {
append(ds1Points.xValues, ds1Points.yValues)
}
strokeStyle = SolidPenStyle(0xFF0066FF)
ellipsePointMarker {
setSize(10)
strokeStyle = SolidPenStyle(0xFF0066FF)
fillStyle = SolidBrushStyle(0xFF0066FF)
}
waveAnimation { interpolator = DecelerateInterpolator() }
}
}
chartModifiers { defaultModifiers() }
}
}
}
//******************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2021. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// ImpulseChartFragment.java is part of SCICHART®, High Performance Scientific Charts
// For full terms and conditions of the license, see http://www.scichart.com/scichart-eula/
//
// This source code is protected by international copyright law. Unauthorized
// reproduction, reverse-engineering, or distribution of all or any portion of
// this source code is strictly prohibited.
//
// This source code contains confidential and proprietary trade secrets of
// SciChart Ltd., and should at no time be copied, transferred, sold,
// distributed or made available without express written permission.
//******************************************************************************
package com.scichart.examples.fragments.examples2d.basicChartTypes;
import android.view.animation.DecelerateInterpolator;
import androidx.annotation.NonNull;
import com.scichart.charting.model.dataSeries.IXyDataSeries;
import com.scichart.charting.visuals.SciChartSurface;
import com.scichart.charting.visuals.axes.IAxis;
import com.scichart.charting.visuals.pointmarkers.EllipsePointMarker;
import com.scichart.charting.visuals.renderableSeries.FastImpulseRenderableSeries;
import com.scichart.core.framework.UpdateSuspender;
import com.scichart.drawing.utility.ColorUtil;
import com.scichart.examples.data.DataManager;
import com.scichart.examples.data.DoubleSeries;
import com.scichart.examples.fragments.base.ExampleSingleChartBaseFragment;
import java.util.Collections;
public class ImpulseChartFragment extends ExampleSingleChartBaseFragment {
@Override
protected void initExample(@NonNull SciChartSurface surface) {
final IAxis xBottomAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1d, 0.1d).build();
final IAxis yRightAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1d, 0.1d).build();
final DoubleSeries ds1Points = DataManager.getInstance().getDampedSinewave(1.0, 0.05, 50, 5);
final IXyDataSeries<Double, Double> dataSeries = sciChartBuilder.newXyDataSeries(Double.class, Double.class).build();
dataSeries.append(ds1Points.xValues, ds1Points.yValues);
final EllipsePointMarker pointMarker = sciChartBuilder.newPointMarker(new EllipsePointMarker())
.withSize(10, 10)
.withStroke(ColorUtil.argb(0xFF, 0x00, 0x66, 0xFF), 1)
.withFill(ColorUtil.argb(0xFF, 0x00, 0x66, 0xFF))
.build();
final FastImpulseRenderableSeries rSeries = sciChartBuilder.newImpulseSeries()
.withDataSeries(dataSeries)
.withStrokeStyle(0xFF0066FF)
.withPointMarker(pointMarker)
.build();
UpdateSuspender.using(surface, () -> {
Collections.addAll(surface.getXAxes(), xBottomAxis);
Collections.addAll(surface.getYAxes(), yRightAxis);
Collections.addAll(surface.getRenderableSeries(), rSeries);
Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newModifierGroupWithDefaultModifiers().build());
sciChartBuilder.newAnimator(rSeries).withWaveTransformation().withInterpolator(new DecelerateInterpolator()).withDuration(3000).withStartDelay(350).start();
});
}
}