Giter VIP home page Giter VIP logo

Comments (9)

imaNNeo avatar imaNNeo commented on August 16, 2024

It should be very simple, you just need to keep a list of showingLines and update the list when a new data comes.
You can find the source code here

CleanShot.2024-06-21.at.00.14.22.mp4

from fl_chart.

kdesroch1 avatar kdesroch1 commented on August 16, 2024

Amazing! Thank you!

One other question: is there a way to specify a the axis step? I found the grid size control, but cannot figure out how to adjust the numbers on the axis to match.

from fl_chart.

kdesroch1 avatar kdesroch1 commented on August 16, 2024

Also, it there a way to keep the grid lines showing when there is no data?

from fl_chart.

imaNNeo avatar imaNNeo commented on August 16, 2024

s step? I found the grid size control, but cannot figure out how to adjust the numbers on the axis to match.

You can use interval property in the SideTitles or FlGridData

from fl_chart.

imaNNeo avatar imaNNeo commented on August 16, 2024

Also, it there a way to keep the grid lines showing when there is no data?

It is a bug and should be fixed in the next version. Stay tuned! 😊

from fl_chart.

kdesroch1 avatar kdesroch1 commented on August 16, 2024

s step? I found the grid size control, but cannot figure out how to adjust the numbers on the axis to match.

You can use interval property in the SideTitles or FlGridData

The FLGridData intervals only seems to control the grid and not the text on the axis.

I got the FLTitlesData to adjust the text on the axis, but it seems quite complicated for such a simple thing. I had to add a widget or I was getting errors. It's such a basic thing, seems like there should be something that works like the minX/maxX/etc... of at the very most like the FLGridData intervals. Am I missing something?

from fl_chart.

imaNNeo avatar imaNNeo commented on August 16, 2024

It's very simple, you just need to change the interval property in the SideTitles class. (no need to update other things)
Take a look at the below sample:
(source code is here)

CleanShot.2024-06-21.at.17.48.54.mp4

from fl_chart.

kdesroch1 avatar kdesroch1 commented on August 16, 2024

Your support for this package is incredible! Thank you!

I'm not clear though, why this works:

double verticalInterval = 1.0;
.
.
.
sideTitles: SideTitles(
reservedSize: 26,
showTitles: true,
interval: verticalInterval,
),

But, this does not:

sideTitles: SideTitles(
reservedSize: 26,
showTitles: true,
interval: 1.0, // as int (1) doesn't work either
),

from fl_chart.

kdesroch1 avatar kdesroch1 commented on August 16, 2024

Ok, I figured it out, a 'const' goes in front of AxisTitles. This doesn't follow the same patten as the other parameters like minX, reservedSize, etc..., so it was a bit confusing.

bottomTitles: const AxisTitles(
sideTitles: SideTitles(
reservedSize: 26,
showTitles: true,
interval: 1.0,
),
),

FYI, in your example, the verticalInterval and horizontalInterval variables are assigned to the wrong axis.

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.