Pre loader

Change color of the touched column



I’m using scichart for android and trying to change the color of the column that was hit by touch. I have successfully identified which index of the data series that was hit. I’ve looked all over the android documentation but does not find an answer or example for this. This is my onTouch function:

    public boolean onTouch(View view, MotionEvent motionEvent) {
        SciChartSurface surface = (SciChartSurface) view;
        touchPoint.set(motionEvent.getX(), motionEvent.getY());
        surface.translatePoint(touchPoint, surface.getRenderableSeriesArea());

        for (IRenderableSeries renderableSeries : surface.getRenderableSeries()) {
            renderableSeries.hitTest(hitTestInfo, touchPoint.x, touchPoint.y, 30);
            if (hitTestInfo.isHit) {
                Double yValue = consumptionDataSeries.getYValues().get(hitTestInfo.dataSeriesIndex);
                // Todo: Show a text annotation and color the column differently
                Toast.makeText(this.getContext(), yValue.toString(), Toast.LENGTH_SHORT).show();
        return true;

What should I do next?

  • You must to post comments

Hi Linnea

That’s great you solve the issue. Can you share your code so that it can help other users too?


  • You must to post comments
Showing 1 result
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