mzimmerm / flutter_charts

Charts Library for Flutter, written in Dart with Flutter.
Other
251 stars 42 forks source link

Y Axis label #42

Open jay8anks opened 1 year ago

jay8anks commented 1 year ago

What determines the Y axis labels? I'm a little new to flutter. Between the backend and getting flutter_charts to work, I've spent a couple of days or more on this. Now that I'm nearing the end, I have about decided it isn't going to work. Just thought I would see if I'm missing something obvious.

Pulled from live data from the backend:

Simulator Screenshot - iPhone 14 - 2023-08-17 at 08 59 54

This only needs to show the sensor reading was above 15000 for x minutes. Everything is fine, but the only y axis label is 10000. If I could just add a 15000 label, I could call it a day.

I've tried about everything I could think of to force extra labels, and nothing is working. I even tried to add a dummy line chart at 15000, thinking I could possibly make it white and hide it, but force it to add a y-axis label. Couldn't get it to work.

For future versions, a y-axis List‹double>, that forced a y-axis label at user determined points of the data range would be pretty nice, and doesn't seem like it would be that difficult.

Thanks,

jay8anks commented 1 year ago

For future reference, what I ended up doing for now was to make a .Net service on the backend that generated a .png image using Microsoft's charting (System.Web.UI.DataVisualization.Charting;). I then just pull in the chart filenames and used the Flutter package easy_image_viewer to provide the user with a nice experience on their end. Not as nice as an actual Flutter chart...but it is way easier to get the x/y labels to work with Microsoft charting.

Still, flutter_charts look nice and it was actually fairly easy to get close to what I was trying to do.

Thanks,