Pre loader

rollover modifier on heatmap

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

Answered
0
0

I have two questions on rollover modifier.

One is the tooltip of the rollover is right under the finger on a heatmap chart. Can I move it to the top left section of the touch point?

Second question is how can I implement a callback function whenever Y axis of the rollover modifier changes?

Thanks for your attention in advance.

Version
3.0
  • You must to post comments
Great Answer
0
0

Hi Gang Xu,

Regarding callback for Y value of tooltip – please take a look on Custom RolloverModifier example. Every time tooltip is updated there will be internalUpdate() call where you can put your code.

Regarding second part of question I don’t fully understand what you mean. Can you provide an example of desired output?

Best regards,
Yura

  • You must to post comments
0
0

Hello Yura,

Thanks for your reply. I have two charts in my app, one is waveform chart, and the other one is heatmap chart. I want to execute a callback function when the thumb is moving on the heatmap. The callback function will update the waveform chart based on the x position of the tooltip on the heatmap chart.

I tried to override the handleMasterTouchDownEvent, but the point.x is not the tick on the x axis. Please advise.

  • You must to post comments
0
0

Hi Yura,

I managed to use internalupdate() to achieve my goal. But I have another issue now.

In my code, the first chart is ECG line chart, and the second is a spectrogram heatmap chart. I added a vertical line annotation to the spectrogram chart. Whenever I move my finger on the spectrogram chart, the vertical annotation line will move along with the finger, and the ECG visible range will be updated according to the position of my finger on the spectrogram heatmap.

But the problem is the x value from heatmapInfo.getFormattedXValue() is not correct if I zoomed in the spectrogram heatmap before the maneuver.

Is there a way to fix that? Thanks.

public class CustomHeatmapDataProvider extends DefaultUniformHeatmapSeriesInfoProvider {
    @Override
    protected ISeriesTooltip getSeriesTooltipInternal(Context context, UniformHeatmapSeriesInfo heatmapInfo, Class<?> modifierType) {
        if (modifierType == CursorModifier.class) {
            return new CustomHeatmapTooltip(context, heatmapInfo);
        } else {
            return super.getSeriesTooltipInternal(context, heatmapInfo, modifierType);
        }
    }
    private class CustomHeatmapTooltip extends UniformHeatmapSeriesTooltip {

        public CustomHeatmapTooltip(Context context, UniformHeatmapSeriesInfo heatmapInfo) {
            super(context, heatmapInfo);
        }
        @Override
        protected void internalUpdate(UniformHeatmapSeriesInfo heatmapInfo) {
            // TODO: incorrect value in zoomed view
            double centerSecond = Double.valueOf(heatmapInfo.getFormattedXValue().toString()).doubleValue();
            double startSecond = centerSecond - ecgStripWidth/2;
            double stopSecond = centerSecond + ecgStripWidth/2;
            if (startSecond >= 0 && stopSecond <= ecgDuration) {
                ecgSurface.getXAxes().getDefault().setVisibleRange(new DoubleRange(startSecond, stopSecond));
                ecmSurface.getAnnotations().get(0).setX1(centerSecond);
            }
        }
    }
}
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.