charts - 如何在 flutter、x 轴和 y 轴上向图表添加名称?

标签 charts dart bar-chart flutter dart-2

我一直在使用 Flutter 图表的在线画廊 (https://google.github.io/charts/flutter/gallery.html),但我正在努力为 x 和 y 轴值添加标题。

有人可以帮助我或告诉我如何将标签添加到图表中吗?

最佳答案

可以使用behaviors属性,检查代码

 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));

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

关于charts - 如何在 flutter、x 轴和 y 轴上向图表添加名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50955214/

相关文章:

javascript - 用音符名称标记 y 轴刻度

javascript - Google Charts 将 URI 发送到 ajax

android - 任务 ':flutter_twitter:verifyReleaseResources' 执行失败

r - 如何在 R 中创建条形图,其中 y 轴为频率而不是密度?

r - 堆积条形图的位置图例

javascript - 是否可以禁用道场蜘蛛图动画?

reporting-services - 折线图中的条件背景颜色

dart - Polymer.dart 如何查询子自定义元素的影子根内的节点

Dart 强模式 : error on anonymous function return

r - 使用 ggplot2 将带有文本的图像作为刻度标签