gpt4 book ai didi

flutter - 禁用散点图抖动上的网格和轴标签

转载 作者:行者123 更新时间:2023-12-03 03:31:01 35 4
gpt4 key购买 nike

我正在使用charts_flutter包,但找不到隐藏\禁用网格和轴标签的方法。
相关代码:

class _VennState extends State<VennDiagramWidget> {
List<charts.Series<VennCircle, int>> circlesList;

static List<charts.Series<VennCircle, int>> _createRandomCircles() {
final circles = [
VennCircle('red', 1, 5, 0.8, 'Venn1'),
VennCircle('black', 2, 10, 0.5, 'Venn2'),
VennCircle('green', 3, 20, 1, 'Venn3'),
];

return [
new charts.Series(
id: 'circles',
data: circles,
domainFn: (VennCircle venn, _) => venn.circleSize,
measureFn: (VennCircle venn, _) => venn.opacity,
colorFn: (VennCircle venn, _) {
if (venn.circleColor == 'red') {
return charts.MaterialPalette.red.shadeDefault;
} else if (venn.circleColor == 'black') {
return charts.MaterialPalette.black;
}
return charts.MaterialPalette.green.shadeDefault;
},
radiusPxFn: (VennCircle venn, _) => venn.circleSize,
),
];
}

scatterPlot() {
return new charts.ScatterPlotChart(
circlesList,
animate: true,
);
}
现在就是这样
enter image description here
我希望同时删除轴和grid \ ticks上的值标签,因此我只能看到圆。

最佳答案

尝试以下选项:

charts.ScatterPlotChart(
seriesList,
animate: animate,
primaryMeasureAxis:
new charts.NumericAxisSpec(
showAxisLine: true,
renderSpec: new charts.NoneRenderSpec(),
),
domainAxis:
new charts.NumericAxisSpec(
showAxisLine: true,
renderSpec: new charts.NoneRenderSpec(),
),
);


关于flutter - 禁用散点图抖动上的网格和轴标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63848069/

35 4 0