123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- //图模块公共配置
- // 图默认配置
- export const chartDefaultOpts={
- //图表配置
- chart: {
- spacingTop: 30,
- backgroundColor: "rgba(0,0,0,0)",
- },
- title: {
- enabled: false
- },
- exporting: {
- enabled: false,
- },
- boost: {
- useGPUTranslations: true,
- },
- //默认颜色配置
- colors:['#00f','#f00','#999','#000','#7cb5ec', '#90ed7d', '#f7a35c', '#8085e9',
- '#f15c80', '#e4d354', '#2b908f', '#f45b5b', '#91e8e1'],
- //版权信息
- credits: {enabled:false},
- //数据列通用配置
- plotOptions: {
- series: {
- turboThreshold: 0, //不限制数据点个数
- boostThreshold:0,
- animation: {
- duration: 1000
- }
- },
- areaspline: {
- lineWidth: 1,
- stacking: 'normal',
- marker: {
- enabled: false,
- },
- // fillOpacity: 0.5,
- },
- column:{
- pointPadding: 0.05,
- stacking: 'normal',
- },
- scatter: {
- turboThreshold: 0,
- marker: {
- symbol: 'circle',
- radius: 5,
- states: {
- hover: {
- enabled: true,
- }
- }
- },
- states: {
- hover: {
- marker: {
- enabled: true
- }
- }
- }
- }
- },
- //范围选择器
- rangeSelector: {
- enabled: false,
- selected: 2,
- },
- //悬浮提示框
- tooltip: {
- split: false,
- shared: true,
- dateTimeLabelFormats: {
- // 时间格式化字符
- day: '%Y/%m/%d',
- week: "%Y/%m",
- month: '%Y/%m',
- year: '%Y/%m',
- },
- xDateFormat:'%Y/%m/%d',
- className:'chart-tooltips-box'
- // formatter:function(e){
- // return `<p>${this.x}</p><p>aaa</p>`
- // // return e
- // }
- // outside: true,
- // valueDecimals: 4,
- },
- //图例
- legend: {
- enabled: true,
- verticalAlign: 'top',
- margin:3,
- // layout: 'vertical'
- },
- //滚动条
- scrollbar: {
- enabled: false,
- },
- //导航器
- navigator: {
- enabled: false,
- },
- //范围选择器
- rangeSelector: {
- enabled: false,
- },
- xAxis: {
- tickPosition: 'inside',
- lineColor: '#bfbfbf',
- tickColor: '#bfbfbf',
- tickLength:5,
- type: 'datetime',
- ordinal: false,
- dateTimeLabelFormats: {
- day: '%y/%m',
- week: '%y/%m',
- month: '%y/%m',
- year: '%y/%m',
- }
- // gridLineWidth:0
- }
- }
- /* 季节性图配置 */
- export const seasonOptions = {
- //默认颜色配置
- colors:['#4B0082','#7FFFAA','#FF4500','#808000','#EEE8AA','#849EC1','#8A4294','#578B5A','#FDA8C7','#53B3FF','#999999','#000000','#FFDF0C','#FF0000','#0033FF'],
- yAxis: {
- lineWidth: 1,
- lineColor: '#bfbfbf',
- tickColor: '#bfbfbf',
- offset: 0,
- opposite: false,
- reversed: false,
- visible: true,
- gridLineWidth: 0,
- tickWidth: 1,
- tickLength:5,
- tickPosition: 'inside',
- endOnTick: false,
- startOnTick: false,
- showLastLabel: true, //显示最后刻度值
- tickPixelInterval: 50
- }
- }
- // 散点x轴
- export const scatterXAxis = {
- tickPosition: 'inside',
- lineColor: '#bfbfbf',
- tickColor: '#bfbfbf',
- tickLength:5,
- ordinal: false,
- type: 'linear',
- }
- // 基础y轴配置
- export const basicYAxis = {
- tickWidth: 1,
- tickLength: 5,
- lineWidth: 1,
- lineColor: '#bfbfbf',
- tickColor: '#bfbfbf',
- // offset: 0,
- visible: true,
- gridLineWidth: 0,
- tickPosition: 'inside',
- endOnTick: false,
- startOnTick: false,
- showLastLabel: true,
- tickPixelInterval: 50,
- }
- //基础x轴配置
- export const basicXAxis={
- tickPosition: 'inside',
- lineColor: '#bfbfbf',
- tickColor: '#bfbfbf',
- tickLength:5,
- type: 'datetime',
- ordinal: false,
- dateTimeLabelFormats: {
- day: '%y/%m',
- week: '%y/%m',
- month: '%y/%m',
- year: '%y/%m',
- },
- xDateFormat:'%Y-%m-%d'
- }
- //领先频度对应英文
- export const leadUnitEnMap={
- '年': 'Y',
- '季': 'Q',
- '月': 'M',
- '周': 'W',
- '天': 'D',
- }
- //相关性图表单位英文Map
- export const relevanceUnitEnMap={
- '年': 'Year',
- '季': 'Season',
- '月': 'Month',
- '周': 'Week',
- '天': 'Day',
- }
- //图表年份筛选项
- export const yearSelectOpt = [
- {
- name: '15年至今',
- value: 3,
- },
- // {
- // name: '18年至今',
- // value: 7,
- // },
- // {
- // name: '19年至今',
- // value: 8,
- // },
- {
- name: '20年至今',
- value: 9,
- },
- {
- name: '21年至今',
- value: 4,
- },
- {
- name: '22年至今',
- value: 11
- },
- ]
- // 拥有相同配置的图表类型集合
- export const sameOptionType=[1,3,4,5,6]
|