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

Built-in Interval calculator bug in small views #909

Closed
imaNNeo opened this issue Feb 17, 2022 · 1 comment
Closed

Built-in Interval calculator bug in small views #909

imaNNeo opened this issue Feb 17, 2022 · 1 comment
Labels
bug Something isn't working Fundamental

Comments

@imaNNeo
Copy link
Owner

imaNNeo commented Feb 17, 2022

Description
Default interval calculation is not working correctly.
We were supposed to calculate the interval value based on the chart's size under the hood (If interval is not provided)

To Reproduce

Use below code (main.dart):
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Center(
            child: Padding(
              padding: EdgeInsets.all(28),
              child: AspectRatio(
                aspectRatio: 2,
                child: LineChart(
                  LineChartData(
                    lineBarsData: [
                      LineChartBarData(
                        spots: const [
                          FlSpot(0, 0),
                          FlSpot(1, 1),
                          FlSpot(2, 3),
                          FlSpot(3, 6),
                          FlSpot(4, 3),
                          FlSpot(5, 2),
                          FlSpot(6, 6),
                        ],
                      ),
                    ],
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Videoshot

interval.bug.mp4

Versions

fl_chart: 0.45.0
flutter: 2.10.1
@imaNNeo imaNNeo added bug Something isn't working Fundamental labels Feb 17, 2022
imaNNeo added a commit that referenced this issue May 24, 2022
imaNNeo added a commit that referenced this issue May 24, 2022
@imaNNeo
Copy link
Owner Author

imaNNeo commented May 30, 2022

Fixed in 0.51.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fundamental
Projects
None yet
Development

No branches or pull requests

1 participant