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

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

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

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

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

基础极坐标区域图

jsx 复制代码
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>
    )
}

单色极坐标区域图

jsx 复制代码
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>
    )
}
相关推荐
invicinble14 分钟前
对于前端数据的生命周期的认识
前端
PieroPc17 分钟前
用FastAPI 后端 和 HTML/CSS/JavaScript 前端写一个博客系统 例
前端·html·fastapi
hunter145023 分钟前
2026.1.4 html简单制作
java·前端·笔记·html
鹏程十八少24 分钟前
Android 深入剖析Android内存泄漏:ViewPager2与Fragment的生命周期陷阱
android·前端·app
李少兄25 分钟前
深入理解 CSS opacity 属性
前端·css
幺零九零零26 分钟前
前端测试·1
前端
1024小神28 分钟前
uniapp项目中使用vue3和小程序组件父子通信
前端·小程序·uni-app
Knight_AL29 分钟前
Vue + Spring Boot 项目添加 /wvp 前缀的完整链路解析(从浏览器到静态资源)
前端·vue.js·spring boot
粟悟饭&龟波功29 分钟前
【软考系统架构设计师】九、架构演化与维护
前端·后端·架构·系统架构·软件工程
广州华水科技33 分钟前
单北斗GNSS的变形监测应用是什么?主要用于大坝的安全监测吗?
前端