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>
    )
}
相关推荐
酉鬼女又兒3 分钟前
SQL113+114 更新记录(一)(二)+更新数据知识总结
java·服务器·前端
无风听海3 分钟前
AngularJS中 then catch finally 的语义、执行规则与推荐写法
前端·javascript·angular.js
利刃大大21 分钟前
【Vue】组件化 && 组件的注册 && App.vue
前端·javascript·vue.js
一起养小猫32 分钟前
Flutter for OpenHarmony 实战:按钮类 Widget 完全指南
前端·javascript·flutter
css趣多多33 分钟前
Vux store实例的模块化管理
前端
Love Song残响1 小时前
MySQL数据可视化实战指南
信息可视化
我是伪码农2 小时前
Vue 1.26
前端·javascript·vue.js
晚霞的不甘2 小时前
Flutter for OpenHarmony 创意实战:打造一款炫酷的“太空舱”倒计时应用
开发语言·前端·flutter·正则表达式·前端框架·postman
这儿有一堆花3 小时前
CSS 拟真光影设计:从扁平到深度的技术复盘
前端·css
_OP_CHEN3 小时前
【前端开发之CSS】(三)CSS 常用元素属性宝典(上):从字体到文本,手把手教你打造高颜值网页!
前端·css·html·网页开发·文本属性·字体属性·页面美化