mzimmerm / flutter_charts

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

target specific line styles #29

Closed andydean565 closed 2 years ago

andydean565 commented 4 years ago

Hi, I want to remove all lines except for the main X and Y lines (all the middle lines with a line chart)

I'm able to remove all lines using the 'charts.MaterialPalette.transparent' but that obviously removes the lines I want to keep.

Container(
                decoration: BoxDecoration(
                  border: Border(
                    bottom: BorderSide(
                      color: Theme.of(context).primaryColorDark
                    ),
                    left: BorderSide(
                      color: Theme.of(context).primaryColorDark
                    )
                  )
                ),
                height: height,
                child: new charts.LineChart(
                  DealershipGraphHeading._createSampleData(),
                  animate: true,
                  domainAxis: charts.NumericAxisSpec(
                    renderSpec: charts.GridlineRendererSpec(
                      lineStyle: charts.LineStyleSpec(
                        color: charts.MaterialPalette.transparent
                      ),
                      labelStyle: charts.TextStyleSpec(
                        color: charts.MaterialPalette.transparent,
                      ),
                    )
                  ),
                  primaryMeasureAxis: charts.NumericAxisSpec(
                    renderSpec: charts.GridlineRendererSpec(
                      lineStyle: charts.LineStyleSpec(
                        color: charts.MaterialPalette.transparent
                      ),
                      labelStyle: charts.TextStyleSpec(
                        color: charts.MaterialPalette.transparent,
                      ),
                    )
                  ),
                )
              )

my current solution is to remove all lines and add a borders to the left and bottom of the chart in a surrounding container but this has too much padding due to the labels which I've also made transparent, alternatively if there was a way to remove all the labels and the space they take up that would also work.

going for an ultra simplistic graph where you can only see the lines and the main X & Y with no labels as the data is more of a comparison rather than specific data.

mzimmerm commented 2 years ago

@andydean565 : It looks like you are reporting to a similarly named but different chart app (charts_flutter), so I am closing this.