Pre loader

RollOverModifier on real points only

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi !
Is it possible to display the RollOverModifier tooltip on the real points only ? Say I have points (1 1) and (3 3) in my chart and I don’t wan’t the tooltip to display (1.5 1.5), (2 2), (2.5 2.5) etc. when rolling over… Any idea ?

Thank you,

Adrien

Version
24
  • You must to post comments
0
0

Hi Adrien,

Have you tried to disable interpolation for RolloverModifier:

 rolloverModifier.setUseInterpolation(false);

With disabled interpolation vertical line and tooltips should be displayed only for nearest data point presented in your data series, and if it is enabled then tooltips values display interpolated data values.

Best regards,
Yura

  • You must to post comments
0
0

Hi Yura,

I also thought it was going to fix my problem. But it actually doesn’t change anything in my case…

Best regards,

Adrien

  • Yura Khariton
    That’s strange. I thought that it should work. Can you provide more detail about this case? What data points do you append into data series? Does it contain only (1 1) and (3 3) points or it also contains (1.5 1.5 ), (2 2) and (2.5 2.5) points? Maybe you can post here code which inits a chart or entire project which reproduces this problem?
  • You must to post comments
0
0

I display vibration data (float values) acquired at 1024 [Hz]. I then have 1024 points/sec in the chart but cursor displays points between them. See the screenshots attached : we can clearly identify 3 real points but the cursor displays values between them.

I can’t give you the entire project but here is the intialization of the chart :

chartSurface = (SciChartSurface) findViewById(R.id.chartTest);
SciChartBuilder.init(getApplicationContext());
SciChartBuilder sciChartBuilder = SciChartBuilder.instance();
chartSurface.setTheme(R.style.SciChart_Bright_Spark);//Chart axis definitions
xAxis = sciChartBuilder.newNumericAxis()
.withAutoRangeMode(AutoRange.Never)
.withDrawMajorBands(false)
.withAxisTitleStyle(fontStyle_axis)
.withCursorTextFormating("0.####")
.build();
yAxis = sciChartBuilder.newNumericAxis()
.withAutoRangeMode(AutoRange.Never)
.withDrawMajorBands(false)
.withTextFormatting("0.#####E0")
.withCursorTextFormating("0.#####E0")
.withAxisTitleStyle(fontStyle_axis)
.withAxisAlignment(AxisAlignment.Left)
.build();
//FastLineRenderableSeries linked to the corresponding XyDataSeries
Flrs_Ax = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Blue, true, 3f))
.withDataSeries(dataSeriesAx)
//.withPointMarker(pointMarkerXFFT)
.build();
Flrs_Ay = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Green, true, 3f))
.withDataSeries(dataSeriesAy)
//.withPointMarker(pointMarkerYFFT)
.build();
Flrs_Az = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Red, true, 3f))
.withDataSeries(dataSeriesAz)
//.withPointMarker(pointMarkerZFFT)
.build();
Flrs_Fft_Ax = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Blue, true, 3f))
//.withPointMarker(pointMarkerXFFT)
.withDataSeries(dataSeriesFFTAx)
.build();
Flrs_Fft_Ay = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Green, true, 3f))
//.withPointMarker(pointMarkerYFFT)
.withDataSeries(dataSeriesFFTAy)
.build();
Flrs_Fft_Az = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Red, true, 3f))
//.withPointMarker(pointMarkerZFFT)
.withDataSeries(dataSeriesFFTAz)
.build();
Collections.addAll(chartSurface.getRenderableSeries(), Flrs_Fft_Ax, Flrs_Fft_Ay, Flrs_Fft_Az, Flrs_Ax, Flrs_Ay, Flrs_Az);

Images
  • Yura Khariton
    I don’t see anything suspicious in code above but I don’t see a code with modifier initialization. Also can you provide a small subset of your data (e.g. the data from screenshot above) so I could build an example which reproduces this issue and then could debug it? I’m not sure if I can fix it without doing this because for now I can’t reproduce it in our test examples. Thanks in advance.
  • You must to post comments
0
0

Sorry ! I forgot some important lines ;-). I added 3 random points at the end of the initialization code to reproduce the problem… Here it is again :

chartSurface = (SciChartSurface) findViewById(R.id.chartTest);
SciChartBuilder.init(getApplicationContext());
SciChartBuilder sciChartBuilder = SciChartBuilder.instance();
chartSurface.setTheme(R.style.SciChart_Bright_Spark);//Chart axis definitions
//Copy buffers
ticksValues = new FloatValues();
axValues = new FloatValues();
//Chart axis definitions
xAxis = sciChartBuilder.newNumericAxis()
.withAutoRangeMode(AutoRange.Never)
.withDrawMajorBands(false)
.withAxisTitleStyle(fontStyle_axis)
.withCursorTextFormating("0.####")
.build();
yAxis = sciChartBuilder.newNumericAxis()
.withAutoRangeMode(AutoRange.Never)
.withDrawMajorBands(false)
.withTextFormatting("0.#####E0")
.withCursorTextFormating("0.#####E0")
.withAxisTitleStyle(fontStyle_axis)
.withAxisAlignment(AxisAlignment.Left)
.build();
//Dashed lines for grid lines
PenStyle AxisMajorGridStyle = new PenStyle(ColorUtil.Grey,true,1f,new float[]{5,5});
xAxis.setMajorGridLineStyle(AxisMajorGridStyle);
yAxis.setMajorGridLineStyle(AxisMajorGridStyle);
Collections.addAll(chartSurface.getYAxes(), yAxis);
Collections.addAll(chartSurface.getXAxes(), xAxis);
//Default modifiers (pinch zooming + panning)
ModifierGroup chartModifiers = sciChartBuilder.newModifierGroupWithDefaultModifiers()
.build();
//Cursor Modifier
RolloverModifier rolloverModifier = new RolloverModifier();
rolloverModifier.setShowTooltip(true);
rolloverModifier.setShowAxisLabels(true);
rolloverModifier.setDrawVerticalLine(true);
rolloverModifier.setUseInterpolation(false);
rolloverModifier.setSourceMode(SourceMode.AllSeries);
Collections.addAll(chartSurface.getChartModifiers(), chartModifiers);
Collections.addAll(chartSurface.getChartModifiers(), rolloverModifier);
dataSeriesAx = new XyDataSeries(Float.class, Float.class);
dataSeriesAx.setSeriesName("Ax");
dataSeriesAy = new XyDataSeries(Float.class, Float.class);
dataSeriesAy.setSeriesName("Ay");
dataSeriesAz = new XyDataSeries(Float.class, Float.class);
dataSeriesAz.setSeriesName("Az");
dataSeriesFFTAx = new XyDataSeries(Float.class, Float.class);
dataSeriesFFTAx.setSeriesName("FFT Ax");
dataSeriesFFTAy = new XyDataSeries(Float.class, Float.class);
dataSeriesFFTAy.setSeriesName("FFT Ay");
dataSeriesFFTAz = new XyDataSeries(Float.class, Float.class);
dataSeriesFFTAz.setSeriesName("FFT Az");
//FastLineRenderableSeries linked to the corresponding XyDataSeries
Flrs_Ax = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Blue, true, 3f))
.withDataSeries(dataSeriesAx)
//.withPointMarker(pointMarkerXFFT)
.build();
Flrs_Ay = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Green, true, 3f))
.withDataSeries(dataSeriesAy)
//.withPointMarker(pointMarkerYFFT)
.build();
Flrs_Az = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Red, true, 3f))
.withDataSeries(dataSeriesAz)
//.withPointMarker(pointMarkerZFFT)
.build();
Flrs_Fft_Ax = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Blue, true, 3f))
//.withPointMarker(pointMarkerXFFT)
.withDataSeries(dataSeriesFFTAx)
.build();
Flrs_Fft_Ay = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Green, true, 3f))
//.withPointMarker(pointMarkerYFFT)
.withDataSeries(dataSeriesFFTAy)
.build();
Flrs_Fft_Az = sciChartBuilder.newLineSeries()
.withStrokeStyle(new PenStyle(ColorUtil.Red, true, 3f))
//.withPointMarker(pointMarkerZFFT)
.withDataSeries(dataSeriesFFTAz)
.build();
Collections.addAll(chartSurface.getRenderableSeries(), Flrs_Fft_Ax, Flrs_Fft_Ay, Flrs_Fft_Az, Flrs_Ax, Flrs_Ay, Flrs_Az);
ticksValues.add(0);
ticksValues.add(1);
ticksValues.add(2);
axValues.add(0.5f);
axValues.add(1f);
axValues.add(2f);
dataSeriesAx.append(ticksValues,axValues);

  • You must to post comments
0
0

Hi Adrien,

I’ve tried to use your code but everything works correctly and RolloverModifier was displayed only for a nearest data point.

BTW may I ask you which version of SciChart Android do you use? From your code it looks like that you use v1.x and I’ve tried to use your code with v2.x. We’ve fixed many bugs in our code between v1 and v2 and maybe issue with RolloverModifier which you reported was one of them. Please can you try to update to the latest version and tell if this fixes rollover behavior?

Best regards,
Yura

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies