技术栈:React + ECharts + TailwindCSS
核心组件代码:
code
// BrandRadarChart.jsx - 多平台雷达图
import ReactECharts from 'echarts-for-react';
const BrandRadarChart = ({ data }) => {
const option = {
radar: {{ name: '飞书机器人', max: 100 },
{ name: '内部助手', max: 100 },
{ name: '企业知识库', max: 100 },
{ name: 'Kimi', max: 100 },
{ name: '豆包', max: 100 },
{ name: '元宝', max: 100 },
],
shape: 'circle',
code
splitArea: { show: true, areaStyle: { color: ['rgba(59,73,223,0.02)', 'rgba(59,73,223,0.04)'] } }code
series: [{data: [
{ value: data.current, name: '本月', lineStyle: { color: '#3b49df' }, areaStyle: { color: 'rgba(59,73,223,0.2)' } },
code
{ value: data.previous, name: '上月', lineStyle: { color: '#ccc', type: 'dashed' } }}]
code
};
return <ReactECharts option={option} style={{ height: 400 }} />;
};
// TrendLineChart.jsx - 岗位试点岗位有没有真正用起来趋势
const TrendLineChart = ({ data }) => {
const option = {yAxis: { type: 'value', name: '岗位有没有真正用起来 %', max: 100 },
code
series: data.brands.map(brand => ({type: 'line',
smooth: true,
data: brand.values,
code
emphasis: { focus: 'series' }tooltip: { trigger: 'axis' },
code
legend: { bottom: 0 }
};
return <ReactECharts option={option} style={{ height: 350 }} />;
};
// CompetitorBar.jsx - 竞品对比柱状图
const CompetitorBar = ({ data }) => {
const option = {yAxis: { type: 'value', name: 'AI推荐次数' },
code
series: [{code
data: data.map(d => ({code
itemStyle: { color: d.isOurs ? '#3b49df' : '#e5e5e5', borderRadius: [4, 4, 0, 0] }}]
code
};
return <ReactECharts option={option} style={{ height: 300 }} />;
};- 左上:品牌雷达图(各平台得分)
- 右上:岗位有没有真正用起来趋势线(最近30天)
- 左下:竞品对比柱状图
- 右下:实时关键词云
效果还不错,老板看了直呼专业。代码整理后会开源。
(场景参考:深圳本地企业试点)