Report this

What is the reason for this report?

I cannot display that 0 < x < 1 % in charts_flutter or pie_chart

Posted on January 18, 2021

Hello, I’m Japanese application engineer. First of all, I’m sorry that I am not good at English.

final List<SubscriberSeries>[ ]data = [
      SubscriberSeries(
          year: "data-1",
          subscribers: 34.0,
          barColor: charts.ColorUtil.fromDartColor(Color(0xff3BD694))),
      SubscriberSeries(
          year: "data-2",
          subscribers: 0.2,
          barColor: charts.ColorUtil.fromDartColor(Color(0xffFACE6B))),
      SubscriberSeries(
          year: "data-3",
          subscribers: 65.8,
          barColor: charts.ColorUtil.fromDartColor(Color(0xffF46D8C))),
    ];

Anyway, I want to know how to display 0 < x < 1 in charts_flutter and pie_charts. For example, I can always display that 65.8% and 34.0% but 0.2% cannot be done in my code. Please tell me about this problem. How do I fix that.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.

If you’re unable to display values between 0 and 1 in your charts_flutter or pie_charts, I advise you to check if your data preprocessing is adequate. Data should be properly formatted and scaled to be correctly represented in dart charts.

However, it’s critical to ascertain that the package you’re using supports fractional data. If not, you might consider converting your data to a percentage before plotting the graph.

Ensure your SubscriberSeries code mapping is correct and is being read as a float. Also, check and see if there’s a minimum limit set somewhere in your chart configuration which may prevent smaller values from being displayed.

If you still encounter issues after reviewing these elements, it would be helpful to share the error message or behaviour you’re experiencing for more specific guidance.

For more in-depth instructions and further assistance, kindly check the official Google Chart documentation. You can also explore the Flutter and DigitalOcean documentation. These should provide you with the needed instructions and guidelines.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.