如何更改charts_flutter中的标记点大小?

问题描述 投票:0回答:1

我正在尝试找到一种方法来更改时间序列图中的标记点数据

charts_flutter
依赖关系。

如上图所示,我正在尝试更改标记点大小。我正在努力让它变小。

这是我的图形代码:

return Container(
            height: 250,
            child: Card(
              child: Column(
                children: [
                  Expanded(
                    child: charts.TimeSeriesChart(
                      series,
                      animate: true,
                      defaultRenderer: charts.LineRendererConfig(
                        includeArea: true,
                        includeLine: true,
                        includePoints: true,
                        strokeWidthPx: 1
                      ),
                      dateTimeFactory: const charts.LocalDateTimeFactory(),
                      behaviors: [
                        charts.SlidingViewport(),
                        charts.PanAndZoomBehavior(),
                        charts.SeriesLegend(
                          position: charts.BehaviorPosition.top,
                          horizontalFirst: false,
                          cellPadding: EdgeInsets.only(
                            left: 80, 
                            top: 10, 
                            bottom: 4
                          ),
                        ),
                        charts.SelectNearest(
                          eventTrigger: charts.SelectionTrigger.hover
                        ),
                        charts.LinePointHighlighter(
                          symbolRenderer: CustomCircleSymbolRenderer(size: size),
                        ),
                      ],
                      selectionModels: [
                        charts.SelectionModelConfig(
                        type: charts.SelectionModelType.info,
                        changedListener: (charts.SelectionModel model) {
                          if(model.hasDatumSelection) {
                            final tankVolumeValue = model.selectedSeries[0].measureFn(model.selectedDatum[0].index).round();
                            final dateValue = model.selectedSeries[0].domainFn(model.selectedDatum[0].index);
                            CustomCircleSymbolRenderer.value = '$dateValue \n $tankVolumeValue L';
                        }
                      })
                    ]),
                  ),
                ],
              ),
            ),
          );

如有任何帮助,我们将不胜感激。

flutter graph flutter-layout flutter-dependencies
1个回答
0
投票

我在 LineChart 中使用 true 中的 includePoints 和 defaultRender 选项的 radiusPx 参数。

charts.LineChart(
.
.
.
defaultRenderer: charts.LineRendererConfig(
        includeArea: false,
        areaOpacity: 0,
        strokeWidthPx: 1,
        roundEndCaps: true,
        includePoints: true,
        radiusPx: 0.1,
      ),
.
.
.
)
© www.soinside.com 2019 - 2024. All rights reserved.