update pay function
This commit is contained in:
@@ -113,41 +113,51 @@ const StepCard = ({ result, idx }) => {
|
||||
// 如果有 echarts 图表数据,尝试生成图表
|
||||
if (data.data?.chart_data) {
|
||||
const chartData = data.data.chart_data;
|
||||
const echartsConfig = {
|
||||
title: { text: `${data.data.formatted_date || ''} 涨停概念分布` },
|
||||
tooltip: { trigger: 'axis' },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: chartData.labels || [],
|
||||
axisLabel: { rotate: 30, fontSize: 10 },
|
||||
},
|
||||
yAxis: { type: 'value' },
|
||||
series: [
|
||||
{
|
||||
name: '涨停家数',
|
||||
type: 'bar',
|
||||
data: chartData.counts || [],
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0, y: 0, x2: 0, y2: 1,
|
||||
colorStops: [
|
||||
{ offset: 0, color: '#ff7043' },
|
||||
{ offset: 1, color: '#ff5722' },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const markdownContent = `\`\`\`echarts
|
||||
${JSON.stringify(echartsConfig)}
|
||||
\`\`\``;
|
||||
// 验证图表数据是否有效
|
||||
const hasValidChartData = chartData.labels?.length > 0 && chartData.counts?.length > 0;
|
||||
|
||||
return (
|
||||
<Box mt={3}>
|
||||
<MarkdownWithCharts content={markdownContent} variant="dark" />
|
||||
{hasValidChartData ? (
|
||||
(() => {
|
||||
const echartsConfig = {
|
||||
title: { text: `${data.data.formatted_date || ''} 涨停概念分布` },
|
||||
tooltip: { trigger: 'axis' },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: chartData.labels,
|
||||
axisLabel: { rotate: 30, fontSize: 10 },
|
||||
},
|
||||
yAxis: { type: 'value' },
|
||||
series: [
|
||||
{
|
||||
name: '涨停家数',
|
||||
type: 'bar',
|
||||
data: chartData.counts,
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0, y: 0, x2: 0, y2: 1,
|
||||
colorStops: [
|
||||
{ offset: 0, color: '#ff7043' },
|
||||
{ offset: 1, color: '#ff5722' },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const markdownContent = `\`\`\`echarts
|
||||
${JSON.stringify(echartsConfig)}
|
||||
\`\`\``;
|
||||
|
||||
return <MarkdownWithCharts content={markdownContent} variant="dark" />;
|
||||
})()
|
||||
) : (
|
||||
<Text fontSize="xs" color="gray.500">暂无图表数据</Text>
|
||||
)}
|
||||
|
||||
{/* 板块详情 */}
|
||||
{data.data?.sector_data && (
|
||||
|
||||
Reference in New Issue
Block a user