admin管理员组

文章数量:1289879

How to make the radar have stripped and the dot like that ive try to make it like that instead of this

here is the radar chart code :


    Column(
                            children: [
                              SizedBox(height: 20),
                              Text("Radar Chart", style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
                              SizedBox(height: 20),
                              Container(
                                height: 300,
                                child: RadarChart(
                                  RadarChartData(
                                    radarBackgroundColor: Colors.transparent,
                                    borderData: FlBorderData(show: false),
                                    tickCount: 4,
                                    ticksTextStyle: TextStyle(color: Colors.grey, fontSize: 10),
                                    tickBorderData: BorderSide(color: Colors.grey, width: 1),
                                    gridBorderData: BorderSide(color: Colors.grey.withOpacity(0.5), width: 1),
                                    radarShape: RadarShape.polygon,
                                    titlePositionPercentageOffset: 0.15,
                                    getTitle: (index, angle) {
                                      const titles = ["Operation", "Reporting", "Compliance", "Strategic"];
                                      return RadarChartTitle(
                                        text: titles[index],
                                        angle: angle,
                                      );
                                    },
                                    dataSets: [
                                      RadarDataSet(
                                        fillColor: Colors.lightBlue.withOpacity(0.4),
                                        borderColor: Colors.lightBlue,
                                        borderWidth: 2,
                                        entryRadius: 5,
                                        dataEntries: [
                                          RadarEntry(value: 5),
                                          RadarEntry(value: 3),
                                          RadarEntry(value: 4),
                                          RadarEntry(value: 1),
                                        ],
                                      ),
                                    ],
                                    radarTouchData: RadarTouchData(enabled: false),
                                  ),
                                ),
                              ),
                            ],
                          ),

for the _buildLabel

Widget _buildLabel(String text, Color color, String value) {
    return Row(
      children: [
        Container(
          padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
          decoration: BoxDecoration(
            color: color,
            borderRadius: BorderRadius.circular(8),
          ),
          child: Row(
            children: [
              CircleAvatar(radius: 10, backgroundColor: Colors.white, child: Text(value, style: TextStyle(fontSize: 10, fontWeight: FontWeight.bold))),
              SizedBox(width: 5),
              Text(text, style: TextStyle(color: Colors.white, fontSize: 12)),
            ],
          ),
        ),
        SizedBox(width: 10),
      ],
    );
  }

I'm using fl_chart: ^0.68.0 and flutter_radar_chart: ^0.2.1

本文标签: How to add stripped radar chart in flutter and add dot at the peak of the datapointStack Overflow