How to add a name to a chart on flutter, x- and y-axis?

5,111

Its possible using behaviors property, check the code

 var chart = charts.LineChart(seriesList,
        behaviors: [
          new charts.ChartTitle('Dimension',
              behaviorPosition: charts.BehaviorPosition.bottom,
              titleStyleSpec: chartsCommon.TextStyleSpec(fontSize: 11),
              titleOutsideJustification:
              charts.OutsideJustification.middleDrawArea),
          new charts.ChartTitle('Dose, mg',
              behaviorPosition: charts.BehaviorPosition.start,
              titleStyleSpec: chartsCommon.TextStyleSpec(fontSize: 11),
              titleOutsideJustification:
              charts.OutsideJustification.middleDrawArea)
        ],
        defaultRenderer: new charts.LineRendererConfig(includePoints: true));

Source https://google.github.io/charts/flutter/example/behaviors/chart_title

Share:
5,111
Eti
Author by

Eti

Mechanical Engineering student interested in Programming.

Updated on December 05, 2022

Comments