蜘蛛网-指标差异分析

echartOption: {
           backgroundColor: '#FFFFFF',
           tooltip: {
             confine: true,
             backgroundColor: 'rgba(255, 255, 255, 0.94)',
             borderWidth: 1,
             borderColor: '#F4F4F4',
             borderRadius: 6,
             boxShadow: '0px 2px 4px rgba(207, 149, 104, 1)',
             padding: 10,
             textStyle: {
               color: '#333',
             },
             formatter: (params) => {
               let str = ``
               str += `<p>${params.marker}${params.name}</p>`
               for (let i = 0; i < params.value.length; i++) {
                 str += `<p>${this.echartOption.radar.indicator[i].name}:${params.value[i]}</p>`
               }
               return str
             },
           },
           legend: {
             left: 65,
             top: '30%',
             orient: 'vertical',
             itemWidth: 14,
             itemHeight: 8,
             itemGap: 19,
           },
           radar: {
             indicator: [],
             name: {
               fontSize: 14,
               fontFamily: 'Microsoft YaHei',
               fontWeight: 400,
               color: '#333333',
             },
             nameGap: 8,
             splitLine: {
               // 分割线样式
               lineStyle: {
                 color: ['#C6C6C6'],
               },
             },
             splitArea: {
               areaStyle: {
                 color: ['#FFFFFF'],
               },
             },
             // 中心(圆心)坐标,数组的第一项是横坐标,第二项是纵坐标。支持绝对像素值和百分比
             center: ['65%', '52%'],
             radius: '68%',
           },
           series: [
             {
               type: 'radar',
               symbolSize: 0,
               data: [
                 {
                   value: [],
                   name: '',
                   itemStyle: {
                     color: this.$eachrtColor.orange,
                   },
                   areaStyle: {
                     opacity: 0.3,
                   },
                 },
                 {
                   value: [],
                   name: '',
                   itemStyle: {
                     color: this.$eachrtColor.cyan,
                   },
                   areaStyle: {
                     opacity: 0.3,
                   },
                 },
                 {
                   value: [],
                   name: '',
                   itemStyle: {
                     color: this.$eachrtColor.blue,
                   },
                   areaStyle: {
                     opacity: 0.3,
                   },
                 },
               ],
             },
           ],
         },

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
QCustomPlot 是一个 C++ 图形绘图库,它提供了丰富的绘图功能,包括曲线图、散点图、柱状图、等值线图等。QCustomPlot 也支持绘制雷达图(蜘蛛网图)。 在 QCustomPlot 中,绘制雷达图需要使用 QCPGraph 类。该类提供了 setLineStyle、setScatterStyle、setData 等方法用于设置线型、散点和数据等属性。具体绘制步骤如下: 1. 创建一个 QCustomPlot 实例并设置其大小和背景色。 2. 创建一个 QCPGraph 实例并设置其线型、散点和数据等属性。 3. 创建一个 QCPAxisRect 实例并将其与 QCustomPlot 关联。 4. 创建一个 QCPAxis 实例并将其与 QCPAxisRect 关联,用于设置雷达图的轴线。 5. 使用 QCustomPlot 的 addPlottable 方法将 QCPGraph 添加到 QCustomPlot 中。 6. 最后,调用 QCustomPlot 的 replot 方法刷新绘图。 下面是一个简单的 QCustomPlot 绘制雷达图的示例代码: ```cpp // 创建 QCustomPlot 实例并设置其大小和背景色 QCustomPlot *customPlot = new QCustomPlot(this); customPlot->setGeometry(10, 10, 400, 400); customPlot->setBackground(QBrush(Qt::white)); // 创建 QCPGraph 实例并设置其线型、散点和数据等属性 QVector<double> data = {1, 3, 2, 4, 5}; QCPGraph *graph = new QCPGraph(customPlot->xAxis, customPlot->yAxis); graph->setLineStyle(QCPGraph::lsLine); graph->setScatterStyle(QCPScatterStyle::ssCircle); graph->setData(QVector<double>({0, 1, 2, 3, 4}), data); // 创建 QCPAxisRect 实例并将其与 QCustomPlot 关联 QCPAxisRect *axisRect = new QCPAxisRect(customPlot); customPlot->plotLayout()->addElement(0, 0, axisRect); // 创建 QCPAxis 实例并将其与 QCPAxisRect 关联 QCPAxis *axis = new QCPAxis(axisRect, QCPAxis::AxisType::atPolar); axis->setRange(0, 5); axis->setTickStep(1); axis->setSubTickCount(4); axis->grid()->setVisible(true); axisRect->addAxis(QCPAxis::atLeft, axis); // 将 QCPGraph 添加到 QCustomPlot 中 customPlot->addPlottable(graph); // 刷新绘图 customPlot->replot(); ``` 上述代码将绘制一个简单的雷达图,其中包含一个 QCPGraph 对象,使用折线和圆圈表示数据点,使用 QCPAxisRect 和 QCPAxis 对象设置雷达图的轴线。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值