Skip to content

DateTimeAxis shows invalid dates when dataSource has no elements (empty list) #2140

Closed
@Abhijit-Revamp

Description

Bug description

I have a ColumnSeries with primaryXAxis as DateTimeAxis
The intervalType is set to DateTimeIntervalType.days (however this has no impact)

Screen shots atached
If the "dataSource" has one or more value, the Axis labels are perfect.
As soon as the dataSource has empty list, the label jumps to "Feb 10 to May 31"

Steps to reproduce

  1. Empty the list that is supplied to DataSource

Code sample

Code sample
SfCartesianChart(
  primaryXAxis: const DateTimeAxis(
      title: AxisTitle(text: 'Date'),
      intervalType: DateTimeIntervalType.days,
   ),

Screenshots or Video

Screenshots

Correct one:
image

With just 1 element in data - still good
image

Invalid dates with empty data set:
image

Stack Traces

Stack Traces
[Add the Stack Traces here]

On which target platforms have you observed this bug?

Web

Flutter Doctor output

Doctor output
[✓] Flutter (Channel beta, 3.26.0-0.1.pre, on macOS 14.7 23H124 darwin-x64, locale en-IN)
    • Flutter version 3.26.0-0.1.pre on channel beta at /Volumes/Abhi-Data/FlutterDev/SDK/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee624bc4fd (5 weeks ago), 2024-09-10 17:41:06 -0500
    • Engine revision 059e4e6d8f
    • Dart version 3.6.0 (build 3.6.0-216.1.beta)
    • DevTools version 2.39.0

Metadata

Assignees

No one assigned

    Labels

    chartsCharts componentwaiting for customer responseCannot make further progress until the customer responds.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions