/*
 * 华孚情报站 - ECharts 图表主题
 * 企业级蓝色风格
 */

const chartTheme = {
    // 颜色配置
    color: [
        '#1890ff', // 主蓝色
        '#52c41a', // 绿色
        '#faad14', // 黄色
        '#f5222d', // 红色
        '#722ed1', // 紫色
        '#13c2c2', // 青色
        '#eb2f96', // 粉色
        '#fa8c16', // 橙色
        '#2f54eb', // 蓝紫
        '#a0d911'  // 草绿
    ],
    
    // 背景色
    backgroundColor: 'transparent',
    
    // 文字颜色
    textStyle: {
        color: '#595959'
    },
    
    // 标题
    title: {
        textStyle: {
            color: '#262626',
            fontWeight: 600
        },
        subtextStyle: {
            color: '#8c8c8c'
        }
    },
    
    // 图例
    legend: {
        textStyle: {
            color: '#595959'
        },
        pageTextStyle: '#595959'
    },
    
    // 提示框
    tooltip: {
        backgroundColor: 'rgba(255, 255, 255, 0.95)',
        borderColor: '#e8e8e8',
        borderWidth: 1,
        textStyle: {
            color: '#262626'
        },
        extraCssText: 'box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); border-radius: 8px;'
    },
    
    // 工具箱
    toolbox: {
        iconStyle: {
            borderColor: '#8c8c8c'
        },
        emphasis: {
            iconStyle: {
                borderColor: '#1890ff'
            }
        }
    },
    
    // 网格
    grid: {
        containLabel: true,
        left: '3%',
        right: '4%',
        bottom: '3%',
        top: '10%',
        borderColor: '#f0f0f0'
    },
    
    // 类目轴
    categoryAxis: {
        axisLine: {
            show: true,
            lineStyle: {
                color: '#d9d9d9'
            }
        },
        axisTick: {
            show: false
        },
        axisLabel: {
            color: '#8c8c8c'
        },
        splitLine: {
            show: true,
            lineStyle: {
                color: '#f0f0f0',
                type: 'dashed'
            }
        }
    },
    
    // 数值轴
    valueAxis: {
        axisLine: {
            show: false
        },
        axisTick: {
            show: false
        },
        axisLabel: {
            color: '#8c8c8c'
        },
        splitLine: {
            show: true,
            lineStyle: {
                color: '#f0f0f0',
                type: 'dashed'
            }
        }
    },
    
    // 折线图
    line: {
        smooth: true,
        symbol: 'circle',
        symbolSize: 6
    },
    
    // 柱状图
    bar: {
        barMaxWidth: 40,
        itemStyle: {
            borderRadius: [4, 4, 0, 0]
        }
    },
    
    // 饼图
    pie: {
        itemStyle: {
            borderColor: '#fff',
            borderWidth: 2
        },
        label: {
            color: '#595959'
        },
        emphasis: {
            itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.3)'
            }
        }
    },
    
    // 地图
    map: {
        itemStyle: {
            areaColor: '#e6f7ff',
            borderColor: '#91d5ff'
        },
        emphasis: {
            itemStyle: {
                areaColor: '#bae7ff'
            },
            label: {
                color: '#096dd9'
            }
        }
    },
    
    // 散点图
    scatter: {
        symbol: 'circle',
        symbolSize: 8
    },
    
    // K线图
    candlestick: {
        itemStyle: {
            color: '#f5222d',
            color0: '#52c41a',
            borderColor: '#f5222d',
            borderColor0: '#52c41a'
        }
    },
    
    // 雷达图
    radar: {
        axisLine: {
            lineStyle: {
                color: '#d9d9d9'
            }
        },
        splitLine: {
            lineStyle: {
                color: '#f0f0f0'
            }
        },
        splitArea: {
            areaStyle: {
                color: ['rgba(24, 144, 255, 0.05)', 'transparent']
            }
        }
    },
    
    // 仪表盘
    gauge: {
        axisLine: {
            lineStyle: {
                width: 10,
                color: [
                    [0.3, '#52c41a'],
                    [0.7, '#1890ff'],
                    [1, '#f5222d']
                ]
            }
        },
        axisTick: {
            show: false
        },
        axisLabel: {
            color: '#8c8c8c'
        },
        splitLine: {
            length: 10,
            lineStyle: {
                color: 'auto'
            }
        }
    },
    
    // 桑基图
    sankey: {
        nodeStyle: {
            borderWidth: 1,
            borderColor: '#aaa'
        },
        linkStyle: {
            color: 'source'
        }
    }
};

// 注册主题
if (typeof echarts !== 'undefined') {
    echarts.registerTheme('huafu', chartTheme);
}

// 导出配置
if (typeof module !== 'undefined' && module.exports) {
    module.exports = chartTheme;
}
