syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.58k stars 771 forks source link

Trackball and crosshair is not visible in Sfcartision from latest version 27.x.52 #2125

Open upendra-bajpai opened 1 week ago

upendra-bajpai commented 1 week ago

Bug description

I had implemented trackball with version 24.x.x but recently I updated to latest version. Now I can't see trackball or crosshair although I can see label on x axis hilighted while traversing. Restoring to previous version I can see them again. Is there anything which I need to update or it's a bug?

Ps.Thank you for this library

Steps to reproduce

Just update to 27.x.x for charts and impliment trackball in Sfcartision charts. Both Android and iOS can't show the trackball.

    _trackballBehavior = TrackballBehavior(
      enable: true,
      activationMode: ActivationMode.singleTap,
      lineType: TrackballLineType.vertical,
      lineColor: Colors.blue,
      markerSettings: TrackballMarkerSettings(
          color: Colors.white,
          borderColor: Colors.blue,
          borderWidth: 9,
          width: 5,
          height: 5,
          shape: DataMarkerType.circle,
          markerVisibility: TrackballVisibilityMode.visible),
      lineDashArray: [5, 5],
      builder: (BuildContext context, TrackballDetails trackballDetails) {
        final ChartData point = widget.data[trackballDetails.pointIndex!];
        // widget.onDataPointSelected.call(point);
        return Container(
          decoration: BoxDecoration(
            color: Colors.black.withOpacity(0.4),
            borderRadius: BorderRadius.circular(4),
          ),
          child: SectionSum(
              sum: (point.y! * 100).toInt(),
              textStyle: TextStyle(
                color: Colors.white,
                backgroundColor: Colors.black.withOpacity(0.4),
                fontFamily: GoogleFonts.poppins().fontFamily,
                fontSize: 12,
                fontWeight: FontWeight.w700,
              )),
        );
      },
    );

Screenshots or Video

Screenshots / Video demonstration I can update if needed

Stack Traces

Stack Traces ```dart No crashes available ```

On which target platforms have you observed this bug?

iOS

Flutter Doctor output

Doctor output ```console ```
baconbyte commented 1 week ago

I am seeing similar after just updating, I have a customised trackball, when I assign a custom builder the line no longer appears in 27.x.x but it did for 24.x.x

baconbyte commented 1 week ago

I had a quick look at the code in the debugger and it looks when I assign a custom builder the chartPointInfo collection is cleared before the line is drawn, it is not cleared when there isn't a custom builder assigned. I'm not sure where/when this is collection is cleared

void _drawTrackballLine(PaintingContext context, Offset offset, SfChartThemeData chartThemeData, ThemeData themeData) { if (chartPointInfo.isNotEmpty && lineType != TrackballLineType.none) { final Paint paint = Paint()

upendra-bajpai commented 1 week ago

Without custom builder is it working? I am trying but no luck. I am expecting someone from syncfustion team to take a look at it.

baconbyte commented 1 week ago

Yes, it works when there isn't a custom builder for me, but I need the builder.

stephengibson83 commented 5 days ago

Commenting to bump this issue a bit. I am also encountering the same issue and hoping for a fix ASAP.