Skip to content

[syncfusion_chart] Daylight Saving Time not working as intended with daily interval #2188

Closed
@DrNiels

Description

@DrNiels

Bug description

When using a daily DateTime x axis that bridges a change towards Daylight Saving Time, the axis is not displayed correctly. On the one hand, the day with the change towards DST should be a bit shorter. On the other hand, the maximum of the axis is not shown, propably pushed out by an hour.

Similarly, a change away from DST does not show the day as longer and has an offset after the maximum of the axis.

It seems to me like the ticks are not positioned correctly and are just placed every 24 hours, which is not correct for these days.

I use syncfusion_flutter_charts in version 27.2.4

Steps to reproduce

  1. Change your time zone to Germany (CET)
  2. Load the sample
  3. Look at the example
  4. The top chart shows a change towards DST, not showing the last hour according to maximum
  5. The middle chart is meant as a reference and does not have a change of DST
  6. The bottom chart shows a change away from DST, with an offset to the right and the 27th shown twice according to ticks, probably 00:00 and 23:00 with 24 hours between dur to DST change

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_charts/charts.dart';

void main() async {
  runApp(
    MaterialApp(
      home: Chart(),
    ),
  );
}

class Chart extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => ChartState();
}

class ChartState extends State<Chart> {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Expanded(
          child: SfCartesianChart(
            primaryXAxis: DateTimeAxis(
              minimum: DateTime(2024, 3, 31),
              maximum: DateTime(2024, 4, 3),
              intervalType: DateTimeIntervalType.days,
            ),
          ),
        ),
        Expanded(
          child: SfCartesianChart(
            primaryXAxis: DateTimeAxis(
              minimum: DateTime(2024, 4, 1),
              maximum: DateTime(2024, 4, 4),
              intervalType: DateTimeIntervalType.days,
            ),
          ),
        ),
        Expanded(
          child: SfCartesianChart(
            primaryXAxis: DateTimeAxis(
              minimum: DateTime(2024, 10, 26),
              maximum: DateTime(2024, 10, 30),
              intervalType: DateTimeIntervalType.days,
            ),
          ),
        ),
      ],
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

image

Stack Traces

Stack Traces Not applicable

On which target platforms have you observed this bug?

Web

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.24.4, on Microsoft Windows [Version 10.0.22631.4460], locale de-DE)
    • Flutter version 3.24.4 on channel stable at C:\Users\niels\OneDrive\Documents\GitHub\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 603104015d (5 weeks ago), 2024-10-24 08:01:25 -0700
    • Engine revision db49896cf2
    • Dart version 3.5.4
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\niels\AppData\Local\Android\sdk
    • Platform android-34, build-tools 33.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.5)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.8.34511.84
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] VS Code (version 1.95.3)
    • VS Code at C:\Users\niels\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.100.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.4460]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 131.0.6778.86
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 129.0.2792.79

[√] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    chartsCharts componentsolvedSolved the query using existing solutions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions