Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only one data, the chart line is too small #2239

Open
BonyYeah opened this issue Jan 2, 2025 · 2 comments
Open

Only one data, the chart line is too small #2239

BonyYeah opened this issue Jan 2, 2025 · 2 comments
Labels
charts Charts component waiting for customer response Cannot make further progress until the customer responds.

Comments

@BonyYeah
Copy link

BonyYeah commented Jan 2, 2025

I use the SfCartesianChart, When it have only one data and the first data, the line be too small, how can I fix it?
First data (error line width)
image

Other data(right line width)
image

@LavanyaGowtham2021 LavanyaGowtham2021 added charts Charts component open Open labels Jan 6, 2025
@AswiniDileep
Copy link

Hi @BonyYeah,

We have checked the reported issue and attempted to replicate it using the SfCartesianChart with ColumnSeries. However, we were unable to reproduce the issue in the syncfusion_flutter_charts package to latest version https://pub.dev/packages/syncfusion_flutter_charts/versions/28.1.38.

However, we have ensured the scenarios mentioned with the latest version but are unable to replicate the issue.

  1. Ensured with windows, web and android.
  2. Tested with all axis type for primaryXAxis
  3. Tested with one data point and tried with empty points.
  4. Tested by setting minimum and maximum range.

We recommend you upgrade to the latest version, and if you are still experiencing the issue, we request you to replicate it in the attached sample and provide us with more details regarding the specific scenario in which you encounter this issue. This will help us to assist you more effectively.

Regards,
Aswini S.

Sample:
GH_2239.zip

@LavanyaGowtham2021 LavanyaGowtham2021 added waiting for customer response Cannot make further progress until the customer responds. and removed open Open labels Jan 8, 2025
@BonyYeah
Copy link
Author

BonyYeah commented Jan 10, 2025

Hi @AswiniDileep
Thank you for you reply! I used your sample to test, it doesn't appear, but I changed the CategoryAxis to DateTimeAxis, and set the minimum and maximum, also the data list only one data, it appear what I met first. Here is my code:

final List<ChartData> chartData = [
      ChartData("2024-01-01 00:00", 35),
    ];
    var minAxisDate = DateTime(2024, 1, 1);
    var maxAxisDate = DateTime(2024 + 1, 1, 1).subtract(Duration(days: 1));

    return Center(
      child: SfCartesianChart(
        primaryXAxis: DateTimeAxis(
          labelRotation: -20,
          minimum: minAxisDate,
          maximum: maxAxisDate,
          plotOffset: 12,
        ),
        primaryYAxis: NumericAxis(
          maximumLabels: 5,
        ),
        series: <CartesianSeries<ChartData, DateTime>>[
          ColumnSeries<ChartData, DateTime>(
            dataSource: chartData,
            xValueMapper: (ChartData data, i) {
              return DateFormat('yyyy-MM-dd HH:mm').parse(data.x ?? "");
            },
            yValueMapper: (ChartData data, _) {
              if (data.y != null) {
                return data.y;
              }
            },
          )
        ],
      ),
    );

And the screenshot:
image
I'm looking forward to your reply. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
charts Charts component waiting for customer response Cannot make further progress until the customer responds.
Projects
None yet
Development

No branches or pull requests

3 participants