Coder Social home page Coder Social logo

Fix steps of Y axis about bezier-chart HOT 5 CLOSED

aeyrium avatar aeyrium commented on June 17, 2024
Fix steps of Y axis

from bezier-chart.

Comments (5)

Dhuliang avatar Dhuliang commented on June 17, 2024

If can add something like footerValueBuilder will be nice

from bezier-chart.

diegoveloper avatar diegoveloper commented on June 17, 2024

from bezier-chart.

Dhuliang avatar Dhuliang commented on June 17, 2024

@diegoveloper
Yep , code like this

SizedBox(
                        height: 300,
                        width: double.infinity,
                        child: Center(
                          child: BezierChart(
                              bezierChartScale: BezierChartScale.CUSTOM,
                              selectedValue: 150,
                              xAxisCustomValues: List.generate(24, (item) => (item * 5).toDouble());,
                              footerValueBuilder: (double value) {
                                 return value.toString();
                              },
                              series: [
                                BezierLine(
                                  data: [
                                    DataPoint(value: 0.0, xAxis: 0.0),
                                    DataPoint(value: 0.0, xAxis: 5.0),
                                    DataPoint(value: 0.0, xAxis: 10.0),
                                    DataPoint(value: 0.0, xAxis: 15.0),
                                    DataPoint(value: 0.0, xAxis: 20.0),
                                    DataPoint(value: 0.0, xAxis: 25.0),
                                    DataPoint(value: 0.0, xAxis: 30.0),
                                    DataPoint(value: 0.0, xAxis: 35.0),
                                    DataPoint(value: 0.0, xAxis: 40.0),
                                    DataPoint(value: 0.0, xAxis: 45.0),
                                    DataPoint(value: 2133.594, xAxis: 50.0),
                                    DataPoint(value: 5931.278, xAxis: 55.0),
                                    DataPoint(value: 5919.515, xAxis: 60.0),
                                    DataPoint(value: 5943.382, xAxis: 65.0),
                                    DataPoint(value: 5829.564, xAxis: 70.0),
                                    DataPoint(value: 5946.018, xAxis: 75.0),
                                    DataPoint(value: 5951.822, xAxis: 80.0),
                                    DataPoint(value: 5922.453, xAxis: 85.0),
                                    DataPoint(value: 5870.541, xAxis: 90.0),
                                    DataPoint(value: 5868.718, xAxis: 95.0),
                                    DataPoint(value: 6016.504, xAxis: 100.0),
                                    DataPoint(value: 5944.217, xAxis: 105.0),
                                    DataPoint(value: 6018.12, xAxis: 110.0),
                                    DataPoint(value: 6036.438, xAxis: 115.0),
                                    DataPoint(value: 6019.77, xAxis: 120.0),
                                    DataPoint(value: 5939.617, xAxis: 125.0),
                                    DataPoint(value: 5922.675, xAxis: 130.0),
                                    DataPoint(value: 5976.648, xAxis: 135.0),
                                    DataPoint(value: 6037.526, xAxis: 140.0),
                                    DataPoint(value: 5181.983, xAxis: 145.0),
                                    DataPoint(value: 0.0, xAxis: 150.0),
                                  ],
                                ),
                              ],
                              config: BezierChartConfig(
                                // startYAxisFromNonZeroValue: false,
                                footerHeight: 40,
                                bubbleIndicatorColor:
                                    Colors.white.withOpacity(0.9),
                                verticalIndicatorStrokeWidth: 3.0,
                                verticalIndicatorColor: Colors.black26,
                                showVerticalIndicator: true,
                                verticalIndicatorFixedPosition: false,
                                showDataPoints: false,
                                // stepsYAxis: this.ySteps * 2,
                                stepsYAxis: 3000, // hide this props will work , but y axis num will overlapping. show this props , the chart will go left too much 
                                displayYAxis: true,
                                yAxisTextStyle: TextStyle(
                                    fontSize: 12, color: Colors.white),
                              )
                              //
                              ),
                        )
                        //
                        )

from bezier-chart.

diegoveloper avatar diegoveloper commented on June 17, 2024

I fixed that issue, could you try using the dependency in this way:

bezier_chart:
    git: 
      url: git://github.com/aeyrium/bezier-chart.git
      ref: master

And run : flutter packages upgrade

Let me knows if it works.

Don't forget to add contentWidth to the config.
BezierChartConfig(
contentWidth: MediaQuery.of(context).size.width * 4,

from bezier-chart.

Dhuliang avatar Dhuliang commented on June 17, 2024

@diegoveloper Thanks for great job ! But tooltip will be cut off .
image

from bezier-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.