apexcharts数据可视化之极坐标区域图

apexcharts数据可视化之极坐标区域图

有完整配套的Python后端代码。

本教程主要会介绍如下图形绘制方式:

  • 基础极坐标区域图
  • 单色极坐标区域图

基础极坐标区域图

import ApexChart from 'react-apexcharts';

export function BasicPolar() {
    // 数据序列
    const series = [14, 23, 21, 17, 15, 10, 12, 17, 21]
    // 图表选项
    const options = {
        chart: {
            type: 'polarArea',
        },
        stroke: {
            colors: ['#fff']
        },
        labels: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月"],
        fill: {
            opacity: 0.8
        },
        responsive: [{
            breakpoint: 480,
            options: {
                chart: {
                    width: 200
                },
                legend: {
                    position: 'bottom'
                }
            }
        }]
    }
    return (
        <div id="chart">
            <ApexChart options={options} series={series} type="polarArea" height={550}/>
        </div>
    )
}

在这里插入图片描述

单色极坐标区域图

import ApexChart from 'react-apexcharts';

export function MonochromePolarArea() {
    // 数据序列
    const series = [14, 23, 21, 17, 15, 10, 12, 17, 21]
    // 图表选项
    const options = {
        chart: {
            type: 'polarArea',
        },
        fill: {
            opacity: 1
        },
        stroke: {
            width: 1,
            colors: undefined
        },
        yaxis: {
            show: false
        },
        legend: {
            position: 'bottom'
        },
        labels: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月"],
        // 绘制选项
        plotOptions: {
            polarArea: {
                rings: {
                    strokeWidth: 0
                },
                spokes: {
                    strokeWidth: 0
                },
            }
        },
        // 主题
        theme: {
            monochrome: {
                enabled: true,
                shadeTo: 'light',
                shadeIntensity: 0.6
            }
        },
        responsive: [{
            breakpoint: 480,
            options: {
                chart: {
                    width: 200
                },
                legend: {
                    position: 'bottom'
                }
            }
        }]
    }
    return (
        <div id="chart">
            <ApexChart options={options} series={series} type="polarArea" height={550}/>
        </div>
    )
}

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

源滚滚编程

创业不易,请打赏支持我一点吧

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值