Code Monkey home page Code Monkey logo

Comments (2)

kindkmj avatar kindkmj commented on July 21, 2024
  List<FlSpot> freList = [];
  List<FlSpot> reFreList = [];

  @override
  void initState() {
    freList = List.generate(100,
        (index) => FlSpot(index.toDouble(), generateRandomPositiveNumber()));
    reFreList = List.generate(100,
        (index) => FlSpot(index.toDouble(), generateRandomNegativeNumber()));
    super.initState();
  }

  double generateRandomPositiveNumber() {
    Random random = Random();
    return (random.nextInt(10) + 1).toDouble();
  }

  double generateRandomNegativeNumber() {
    Random random = Random();
    return (-(random.nextInt(10) + 1)).toDouble();
  }
 SizedBox(
                    width: 320.w,
                    height: 242.h,
                    child: LineChart(
                      LineChartData(
                          clipData: FlClipData.all(),
                          titlesData: FlTitlesData(
                            rightTitles: AxisTitles(
                              sideTitles: SideTitles(showTitles: false),
                            ),
                            topTitles: AxisTitles(
                              sideTitles: SideTitles(showTitles: false),
                            ),
                          ),
                          lineBarsData: [
                            LineChartBarData(
                              color: black80,
                              
                              spots: freList,
                              isStrokeJoinRound: true,
                              dotData: const FlDotData(
                                show: false,
                              ),
                            ),
                            LineChartBarData(
                              color: blue100,
                              spots: reFreList,
                              isStrokeJoinRound: true,
                              dotData: const FlDotData(
                                show: false,
                              ),
                            ),
                          ]),
                    ),
                  )

it is mycode
can i scroll LineChart?

from fl_chart.

kindkmj avatar kindkmj commented on July 21, 2024

i found #71

from fl_chart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.