google / charts

https://pub.dev/packages/charts_flutter
Apache License 2.0
2.81k stars 1.24k forks source link

Flutter Charts How do I change position the Y axis? #609

Open nofure opened 3 years ago

nofure commented 3 years ago

I can''t change position Y axis to right side please help me example image

  Container(
                    color: Colors.white,
                    width: MediaQuery.of(context).size.width * 0.95,
                    height: MediaQuery.of(context).size.height * 0.33,
                    child: TabBarView(
                      controller: controller.controller,
                      children: controller.myTabs.map((Tab tab) {
                        final String label = tab.text;
                        return Container(
                          child: charts.TimeSeriesChart(
                            _createSampleData(),
                            animate: false,
                            behaviors: [
                              charts.SlidingViewport(),
                              charts.PanAndZoomBehavior(),
                            ],
                            defaultRenderer: charts.LineRendererConfig(
                              includeLine: true,
                            ),
                          ),
                        );
                      }).toList(),
                    ),
                  ),

static List<charts.Series<MyRow, DateTime>> createSampleData(String type) { final data = [ new MyRow(new DateTime(2017, 9, 25), 106), new MyRow(new DateTime(2017, 9, 26), 108), new MyRow(new DateTime(2017, 9, 27), 106), new MyRow(new DateTime(2017, 9, 28), 109), new MyRow(new DateTime(2017, 9, 29), 111), new MyRow(new DateTime(2017, 9, 30), 115), new MyRow(new DateTime(2017, 10, 01), 125), new MyRow(new DateTime(2017, 10, 02), 133), new MyRow(new DateTime(2017, 10, 03), 127), new MyRow(new DateTime(2017, 10, 04), 131), new MyRow(new DateTime(2017, 10, 05), 123), new MyRow(new DateTime(2017, 10, 06), 127), new MyRow(new DateTime(2017, 10, 07), 135), new MyRow(new DateTime(2017, 10, 08), 140), new MyRow(new DateTime(2017, 10, 09), 150), new MyRow(new DateTime(2017, 10, 10), 170), new MyRow(new DateTime(2017, 10, 11), 170), new MyRow(new DateTime(2017, 10, 12), 180), ]; return [ new charts.Series<MyRow, DateTime>( id: 'Headcount', domainFn: (MyRow row, ) => row.timeStamp, measureFn: (MyRow row, _) => row.headcount, data: data, ) ]; };

fldvlpr commented 3 years ago

@notufure @srawlins @hellyhansen @cdibona @dberlin @google-admin @jamesderlin @jiajiabingcheng can anyone look in to this and let me know if this feature supported in this library or not?

Cause there is nothing in document regarding this.

I've added my whole demo here if anyone wants to help

Thanks