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>
    )
}
相关推荐
中微子44 分钟前
JavaScript Number全指南:精度陷阱、IEEE 754与大整数处理
前端·javascript·面试
前端小菜哇1 小时前
JS核心原理之迭代器
前端·javascript
你的人类朋友1 小时前
JavaScript定时器的问题与优化:现代解决方案推荐
前端·javascript·后端
yzx991 小时前
npm error Cannot find module ‘negotiator‘ 的处理
前端·npm·node.js
henujolly1 小时前
npm、yarn幽灵依赖问题
前端
西洼工作室1 小时前
【手搓一个原生全局loading组件解决页面闪烁问题】
前端·css·js
吹牛不交税1 小时前
vue3+element plus 自定义组件,单列的方块 图形加文字列表
前端·javascript·vue.js
Stella25212 小时前
【HTML/CSS面经】
前端·css·html
Cache技术分享2 小时前
93. Java 数字和字符串 - 字符串与数字互相转换
前端·后端
南丘山2 小时前
Vue中动态组件销毁问题
前端