Flutter Tutorial - Line Chart - FLChart

Поделиться
HTML-код
  • Опубликовано: 24 окт 2020
  • Create a Line Chart easily in your Flutter app.
    Click here to Subscribe to Johannes Milke: ruclips.net/user/JohannesMilke...
    - Source Code: github.com/JohannesMilke/fl_l...
    - Buy My Courses: johannesmilke.teachable.com/p...
    - Follow Twitter: intent/follow?ori...
    Resources:
    FLChart Plugin: pub.dev/packages/fl_chart
    Bar Chart Tutorial: • Flutter Tutorial - Bar...
    Pie Chart Tutorial: • Flutter Tutorial - Pie...
    -- JOIN THE CREW --
    bit.ly/JohannesMilke
    SHARE | SUBSCRIBE | LIKE FOR MORE VIDEOS LIKE THIS
    *********
    SOCIAL MEDIA: Follow Me :-)
    - Twitter: intent/follow?ori...
    - Linkedin: / johannesmilke
    - Github: github.com/JohannesMilke
    PLAYLISTS
    - All Flutter Videos: • Flutter Tutorial - Tex...
    - Widgets - Flutter: • Flutter Tutorial - Sel...
    - Plugins - Flutter: • Local Push Notificatio...
    - Animations - Flutter: • #12 - Flutter Advent -...
    - Designs - Flutter: • Flutter - Screen Desig...
    If you find this video useful, LIKE & SHARE this video to help other people who also learn Flutter :)
    bit.ly/JohannesMilke
    CREDITS
    Copyright song "Corporate Technology" by scottholmesmusic.com
    #Flutter #Tutorial #JohannesMilke
    LIKE & SHARE & ACTIVATE THE BELL
    Thanks For Watching :-)
  • НаукаНаука

Комментарии • 101

  • @meetamin7343
    @meetamin7343 2 года назад

    Whatever I search regarding flutter, you are always there to help me.
    You are awesome man❤❤.

  • @iuniquekwt3177
    @iuniquekwt3177 3 года назад +2

    this was very helpful! thank you so much for taking the time to make this!

  • @unitestunitest2695
    @unitestunitest2695 2 года назад

    Thank you bro for video. Helps a lot!

  • @mruduladdipalli5417
    @mruduladdipalli5417 3 года назад +1

    Great Explanation , Thankyou, Subscribed!!!

    • @mruduladdipalli5417
      @mruduladdipalli5417 3 года назад

      Hi Johannes, can you please help me in changing the tooltip text which is displayed when I tap on the graph plot of fl_chats i.e on tapping on FlSpot(). I am getting values as 1,2,3,4,5

  • @web3tel
    @web3tel 3 года назад

    Very nice and practical

  • @brokercl
    @brokercl 3 года назад

    Excellent Johannes, thanks

  • @fabiosegalli
    @fabiosegalli 2 года назад

    Thanks for the video, helps a lot!

  • @misters6451
    @misters6451 2 года назад

    It's amazing! Thank you!

  • @hiteshaloney
    @hiteshaloney 2 года назад

    Thank you for this tutorial :)

  • @mudassarmaqbool8924
    @mudassarmaqbool8924 2 года назад

    Really Helpful Video.

  • @brokercl
    @brokercl 3 года назад

    great, many thanks Johannes

  • @usama_khalid
    @usama_khalid 2 года назад

    Thank you. it is very helpful

  • @nedelcugabriel7687
    @nedelcugabriel7687 3 года назад

    Hello! Great video. I have a question: can you add the values numbers to the point in the chart?

  • @farookjamal1556
    @farookjamal1556 3 года назад

    tnx buddy.great effort

  • @KREeDo5
    @KREeDo5 6 месяцев назад

    Thanks, you save my evening)))

    • @HeyFlutter
      @HeyFlutter  6 месяцев назад +1

      Glad to hear that, You are welcome @KREeDo5! 😊

  • @raymondmichael4987
    @raymondmichael4987 3 года назад +1

    Sure, thisnis really helpful and might become handy one day.
    Can you create a video on how we can use online data, fetched data; and just wondering will it be good to make the graph horizontal scrollable!?.
    Keep it up brother,
    Greetings from Tanzania 🇹🇿

  • @h3w45
    @h3w45 3 года назад

    Great content.

  • @nazagm8392
    @nazagm8392 Год назад

    good tutorial 👏🏼

    • @HeyFlutter
      @HeyFlutter  Год назад

      Glad you liked it, @nazagm8392 😀

  • @MuhittinKaplan
    @MuhittinKaplan 2 года назад

    Thanks Jhonnes

  • @joshuacohen3518
    @joshuacohen3518 3 года назад +1

    Does anyone know how to change the interval amount of the min/max border numbers? So I can go up by .1 instead of us 1?

  • @arikev8040
    @arikev8040 10 месяцев назад

    Nice line shart

    • @HeyFlutter
      @HeyFlutter  10 месяцев назад

      Thanks, @arikev8040! 🙂

  • @mallikarjunreddy5229
    @mallikarjunreddy5229 3 года назад +6

    Please make the same graph with some dynamic data from web api if possible, It will be great if you can do.

    • @joshuacohen3518
      @joshuacohen3518 3 года назад +6

      I'm trying to find a solution for this now so I can have a graph update with a snapshot. Let me know if you figure something out to make it work!
      edit: Temporary solution so far, I extracted the method and wrote it out, adding the 'for' loop and 'array' being my data that changes:
      LineChartBarData lineChartBarData() {
      List spot = [];
      for (var i = 0; i < array.length; i++) {
      var x = i + 1;
      spot.add(FlSpot(x.toDouble(), array[i]));
      }
      print(spot);
      return LineChartBarData(
      spots: spot,
      isCurved: false,
      colors: gradientColors,
      barWidth: 5,
      isStrokeCapRound: true,
      dotData: FlDotData(
      show: true,
      ),
      belowBarData: BarAreaData(
      show: true,
      colors: gradientColors.map((color) => color.withOpacity(0.3)).toList(),
      ),
      );
      }

  • @antonioguilherme1844
    @antonioguilherme1844 3 года назад

    muito obrigado mesmo.Toppp dmmssss. Sou do Brasil

  • @nested9301
    @nested9301 2 года назад

    Impressive ♥️♥️ 🌟

  • @reginaldodejesusoliveirasi4930
    @reginaldodejesusoliveirasi4930 2 года назад

    very good

  • @oxygen02
    @oxygen02 2 года назад +2

    Hey, it's a great tutorial! But I've got a question, how can I make the chart scrollable on the X-axis? Because I need to show data for the date range a year back, the chart would be too big to display without scrolling. Would be great to know the solution to implement something like this. Thank you.

    • @mr.sparky07
      @mr.sparky07 Год назад

      you can wrap it with ListView and set scrollDirection: Axis.Horizontal, you may need to write, shrinkwrap: true also inside listview

  • @NinjaGaming-te6od
    @NinjaGaming-te6od 2 года назад

    Hey Jonnahes love your content.... Can I possible get the from firebase and put in the Line chart? Any source

  • @faqruddinmohammad1411
    @faqruddinmohammad1411 2 года назад

    Great job. Could you please make fl line and pie chart data from json url based apis. It would be great help or share any refrenece. Thank you.

  • @ankansharma4897
    @ankansharma4897 2 года назад

    how to change the color gradient of area under the graph from left to right to top to bottom

  • @jihedbouchnak
    @jihedbouchnak Год назад

    Great video Mike Love your work

    • @HeyFlutter
      @HeyFlutter  Год назад

      Thank you, bouchnak jihed! 🙂

  • @aryanpandey2879
    @aryanpandey2879 2 года назад

    How can we make a linechart with timestamp as the x-axis parameter. Basically I want to plot data every second as it is being added to firestore database.

  • @nupohamebapigg
    @nupohamebapigg 3 года назад

    Sir, how can I fix the Y-Axis to contains only 10 value?

  • @edzelagulto5660
    @edzelagulto5660 3 года назад +1

    Wonderful tutorial! I just want to ask if there's a way to dynamically change the labels of the graph? I think they are built to be constants but since this is a graphic tool, it should be able to be changed dynamically. Thank you!

    • @edzelagulto5660
      @edzelagulto5660 3 года назад

      I already found the solution. Still, thanks for the wonderful tutorial.

    • @imrazbanu7265
      @imrazbanu7265 2 года назад +1

      hey can you please share the solution i am not able to find it

    • @jaspreetsingh1326
      @jaspreetsingh1326 2 года назад

      What is the solution ??

    • @edzelagulto6452
      @edzelagulto6452 2 года назад

      @@jaspreetsingh1326 You can dynamically change the labels by returning a variable in the titlesData parameter of the LineChartData which is under the LineChart widget. The titlesData contains the topTitle, bottomTitle, leftTitle, and rightTitle. Specifically the getTitles parameter.

  • @jonasbiermann
    @jonasbiermann 2 года назад

    Hi this really helped me. Just one question... can I somehow declare the direction in which the linear gradient under belowBarData is shown? Id like to have it from top to bottom but its from left to right... great video tho

    • @jonasbiermann
      @jonasbiermann 2 года назад

      and how can I make the labels on the x axis appear a bit on the gradient so not under it but on the gradient if you know what I mean

  • @TechnophileLad
    @TechnophileLad 2 года назад

    How can I connect this with google sheets API?

  • @ayoseunsolomon2562
    @ayoseunsolomon2562 2 года назад

    if you're having error (TextStyle? cannot be assigned to TextStyle?) when adding ''getTextstyles' , just update dependency to 0.41.0{null safety) and add 'context' with value....... thank you for this video

  • @mallikarjunreddy5229
    @mallikarjunreddy5229 3 года назад

    Great content and clear explanation. how can draw multiple line charts on a single graph is it possible to draw the multiple lines on a same graph in fl_charts? if yes please give me some suggestions on how can i achieve.
    Thanks.

    • @mafzal644
      @mafzal644 3 года назад +1

      check there repo or use sync fusion

    • @nikolaiesau2437
      @nikolaiesau2437 3 года назад +1

      You can just add a second LineChartBarData(...) in lineBarsData like:
      lineBarsData: [
      LineChartBarData(...),
      LineChartBarData(...)
      ]

  • @lesptitsoiseaux
    @lesptitsoiseaux 2 года назад

    Can the gradient colors be along the vertical axis instead? It'd make more sense in many use cases...

    • @HeyFlutter
      @HeyFlutter  2 года назад +1

      Thank You LesPtitsOiseaux! Follow this link: stackoverflow.com/questions/56437850/how-to-apply-linear-gradient-in-flutter-charts
      I hope you will get your answer 🙂

  • @lesptitsoiseaux
    @lesptitsoiseaux 2 года назад

    I got the 500th like!

    • @HeyFlutter
      @HeyFlutter  2 года назад +1

      Thanks, LesPtitsOiseaux! 🙂

  • @daawesomeness7747
    @daawesomeness7747 3 года назад

    great video but I'm facing a bit of a problem with the chart as some extra lines show up on the chart as if their start and end is connected.

    • @daawesomeness7747
      @daawesomeness7747 3 года назад

      @@HeyFlutter it's not grid lines it's the slope line.

  • @nasserbaba9722
    @nasserbaba9722 Год назад

    Hi Johannes Mike i am using this chart package in my flutter project i want to adjust the on tap for dotData to keep showing on the chart if the user did tap on the line only the specific dot data tapped and if the user tapped on another dot it will show and hide the previous showed dot data , can you please help me with this problem and thank you ❤

    • @HeyFlutter
      @HeyFlutter  Год назад

      Thank You Nasser Baba! Follow this link: pub.dev/packages/fl_chart
      I hope you will get your answer 🙂

  • @samatzhussipov1139
    @samatzhussipov1139 3 года назад

    Cool!

  • @muhammadharis-lo9nv
    @muhammadharis-lo9nv 2 года назад

    Hey sir nice tutorial how to make tooltip add certain dot without on tap event in fl chart

    • @muhammadharis-lo9nv
      @muhammadharis-lo9nv 2 года назад

      @@HeyFlutter yes sir, when we tap the chart it show the data in the tooltip , i want to show one tooltip at the highest point in the chart at the beginning chart render

  • @akhanhanif2255
    @akhanhanif2255 2 года назад

    i want to show the line below fldot for some points, is it possible? also that line should be visible without taping on it..?

    • @akhanhanif2255
      @akhanhanif2255 2 года назад

      @@HeyFlutter thank you so much one more thing how to remove border of this graph

  • @kulitjeruk5292
    @kulitjeruk5292 10 месяцев назад

    hello, is possible to change the left title with image or icon?

    • @HeyFlutter
      @HeyFlutter  10 месяцев назад

      Thank you, @kulitjeruk5292! 🙂. Try to provide enough details with your question whenever you face any issue.

  • @ayasssha
    @ayasssha 3 года назад

    great, this was very helpful! But can you show me how, if i would change the data form realtime database in firebase? i hope you’ll help ne:))))))

  • @HamzaAli-nu7hn
    @HamzaAli-nu7hn 3 года назад

    values on x and y axis are overlapping when I increase values on x or y axis.
    Is there any solution for this?

  • @alexanderklehm3872
    @alexanderklehm3872 Год назад +1

    Hey Johannes,
    thank you for the tutorial. I just want to let you know, that there had to be some improvement on fl_chart, which doesn't suit one on one with your tutorial anymore. For example the titles arguments in the FlTitlesData widget know takes a AxisTitles widget, which then takes a SideTitles widget. No big deal for an advanced dev, but a beginner maybe couldn't follow along your tutorial anymore. So maybe you want to take a look at the changes and update your video.

    • @HeyFlutter
      @HeyFlutter  Год назад

      Thanks for your feedback, Alexander Klehm! 🙂

  • @hariprasaths5999
    @hariprasaths5999 Год назад

    Can you explain how to zoom charts??

    • @HeyFlutter
      @HeyFlutter  Год назад

      Thank you, Hari Prasath S! 🙂

  • @GarthFransman
    @GarthFransman Год назад

    How would I use Firestore Data for my chart info ?

    • @HeyFlutter
      @HeyFlutter  Год назад +1

      Thank You Aespa Avatar Insights! Follow this link: medium.com/@codingInformer/how-to-use-flutter-time-series-charts-with-firebase-6f3f364b5902
      I hope you will get your answer 🙂

    • @GarthFransman
      @GarthFransman Год назад

      @@HeyFlutter Thanks soooo so so much Mr Milke . Much much appreciated. Just what I was looking for yes . Thanks you

  • @SetioDewo
    @SetioDewo 10 месяцев назад

    Can it displays legend?

    • @HeyFlutter
      @HeyFlutter  10 месяцев назад +1

      Thank You @SetioDewo! Follow this link: pub.dev/documentation/syncfusion_flutter_charts/latest/charts/Legend-class.html
      I hope you will get your answer 🙂

    • @SetioDewo
      @SetioDewo 10 месяцев назад

      @@HeyFlutter thank you very much

  • @adityasinha3851
    @adityasinha3851 Год назад

    I am getting the error that parameter colors is not defined

    • @HeyFlutter
      @HeyFlutter  Год назад +1

      Thank You Aditya Sinha! Follow this link: stackoverflow.com/questions/63863187/flutter-the-named-parameter-colors-isnt-defined-in-sweepgradient
      I hope you will get your answer 🙂

  • @kentthomas1045
    @kentthomas1045 Год назад

    can this handle real time data?

    • @HeyFlutter
      @HeyFlutter  Год назад

      Thank you, Kent Thomas! 🙂. Yes it can.

    • @kentthomas1045
      @kentthomas1045 Год назад

      @@HeyFlutter please do a video highlighting this, there is only the pay widget syncfusion on RUclips teaching this and I am certain there are many users online willing to learn more about graphing their data.

  • @beautifulanimals209
    @beautifulanimals209 2 года назад

    Sir kindly make banking app using flutter.???

  • @emirsehic4728
    @emirsehic4728 Год назад

    This video is great, but it's outdated. Latest dependencies are not compatible with the code. When I run the code with dependencies used in this video, it gives me problems with null safety. It would be nice to have at least source code updated.

    • @HeyFlutter
      @HeyFlutter  Год назад

      Thanks for the idea, Emir Sehic! 🙂 I have added it to my list of ideas for future videos!

  • @arupnaskarbkp
    @arupnaskarbkp 3 года назад

    FlSpot(1,-0.16752809),
    FlSpot(3, 0.24400593),FlSpot(6, 4.68283943),FlSpot(10, 19.54111649) value add than over follow the scren

    • @arupnaskarbkp
      @arupnaskarbkp 3 года назад

      @@HeyFlutter please make one video

  • @learneverything5946
    @learneverything5946 2 месяца назад

    I subscribed today which is late😢

    • @HeyFlutter
      @HeyFlutter  2 месяца назад

      Great, Thank you @learneverything5946!

  • @maniyadav3256
    @maniyadav3256 2 года назад

    you look different on videos ,than in real

  • @s-jobs
    @s-jobs Год назад

    this example is not yours, it belongs to flchart team ! u should've mentioned it to show your honesty at least !

  • @yourpromises
    @yourpromises 3 года назад

    (G)old

  • @mariusschroeter
    @mariusschroeter 3 года назад

    dieser deutsche Akzent xD

  • @rokhladin5205
    @rokhladin5205 Год назад +3

    If your file line_titles.dart is not working try this code:
    import 'package:fl_chart/fl_chart.dart';
    import 'package:flutter/material.dart';
    class LineTitles {
    static getTitleData() => FlTitlesData(
    show: true,
    bottomTitles: AxisTitles(
    axisNameWidget: const Text(
    'Meseci',
    style: TextStyle(
    color: Color(0xff68737d),
    fontWeight: FontWeight.bold,
    fontSize: 16,
    ),
    ),
    sideTitles: SideTitles(
    showTitles: true,
    reservedSize: 30,
    getTitlesWidget: (value, meta) {
    const style = TextStyle(
    color: Color(0xff68737d),
    fontWeight: FontWeight.bold,
    fontSize: 16,
    );
    Widget text;
    switch (value.toInt()) {
    case 2:
    text = const Text('MAR', style: style);
    break;
    case 5:
    text = const Text('JUN', style: style);
    break;
    case 8:
    text = const Text('SEP', style: style);
    break;
    default:
    text = const Text('', style: style);
    break;
    }
    return SideTitleWidget(
    axisSide: meta.axisSide,
    space: 8.0,
    child: text,
    );
    }),
    ),
    leftTitles: AxisTitles(
    axisNameWidget: const Text(
    'Vrednost',
    style: TextStyle(
    color: Color(0xff68737d),
    fontWeight: FontWeight.bold,
    fontSize: 16,
    ),
    ),
    sideTitles: SideTitles(
    showTitles: true,
    getTitlesWidget: (double value, TitleMeta meta) {
    const style = TextStyle(
    color: Color(0xff67727d),
    fontWeight: FontWeight.bold,
    fontSize: 15,
    );
    String text;
    switch (value.toInt()) {
    case 1:
    text = '10K';
    break;
    case 3:
    text = '30k';
    break;
    case 5:
    text = '50k';
    break;
    default:
    return Container();
    }
    return Text(text, style: style, textAlign: TextAlign.left);
    },
    reservedSize: 40,
    interval: 1,
    ),
    ),
    );
    }

    • @HeyFlutter
      @HeyFlutter  Год назад

      Your efforts are well appreciate👏 Thank you for your contribution, Rok Hladin! 🙂

    • @joeysupply
      @joeysupply Год назад

      Thank you. right now some code have to change a bit.

    • @adityasinha3851
      @adityasinha3851 Год назад

      What could be the possible reasons for error