Skip to content

EmptyPointMode.gap with tooltip #1793

@FabioNieVec

Description

@FabioNieVec

Hello,

I'm trying to implement a graph that uses a tool tip and "deleting" all the null values. If I try this ->

SfCartesianChart(
                  palette: [Theme.of(context).primaryColor],
                  series: [
                    LineSeries<ChartData, int>(
                      dataSource: [
                        ChartData(1, 100),
                        ChartData(2, null),
                        ChartData(3, 150),
                        ChartData(4, 200),
                        ChartData(5, 300),
                        ChartData(6, 400),
                      ],
                      markerSettings: const MarkerSettings(isVisible: true),
                      animationDuration: 0,
                      xValueMapper: (ChartData data, _) => data.x,
                      yValueMapper: (ChartData data, _) => data.y,
                      emptyPointSettings: const EmptyPointSettings(
                        mode: EmptyPointMode.gap,
                      ),
                    ),
                  ],
                    primaryXAxis: const NumericAxis(),
                    primaryYAxis: const NumericAxis(
                      edgeLabelPlacement: EdgeLabelPlacement.shift,
                      minimum: 0,
                    ),
                  tooltipBehavior: TooltipBehavior(
                    enable: true,
                  ),
                )

It will create the gap but when I hover over the second point it shows me the data from: ChartData(2, null) if I hover over the next one I get ChartData(4, 200). I somehow always skip the third entry, but not the second.

I'm using the newest version at the moment.

image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingchartsCharts componentfixedFixed and delivered update

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions