gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 06:32:40 25 4
gpt4 key购买 nike

我一直在使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com