| | |
| | | |
| | | const cfu = { |
| | | //demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可 |
| | | "type":["pie","ring","rose","word","funnel","map","arcbar","line","column","bar","area","radar","gauge","candle","mix","tline","tarea","scatter","bubble","demotype"], |
| | | "range":["饼状图","圆环图","玫瑰图","词云图","漏斗图","地图","圆弧进度条","折线图","柱状图","条状图","区域图","雷达图","仪表盘","K线图","混合图","时间轴折线","时间轴区域","散点图","气泡图","自定义类型"], |
| | | "type":["pie","ring","rose","word","funnel","map","arcbar","line","column","mount","bar","area","radar","gauge","candle","mix","tline","tarea","scatter","bubble","demotype"], |
| | | "range":["饼状图","圆环图","玫瑰图","词云图","漏斗图","地图","圆弧进度条","折线图","柱状图","山峰图","条状图","区域图","雷达图","仪表盘","K线图","混合图","时间轴折线","时间轴区域","散点图","气泡图","自定义类型"], |
| | | //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype" |
| | | //自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories |
| | | "categories":["line","column","bar","area","radar","gauge","candle","mix","demotype"], |
| | | "categories":["line","column","mount","bar","area","radar","gauge","candle","mix","demotype"], |
| | | //instance为实例变量承载属性,不要删除 |
| | | "instance":{}, |
| | | //option为opts及eopts承载属性,不要删除 |
| | | "option":{}, |
| | | //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换 |
| | | "formatter":{ |
| | | "yAxisDemo1":function(val){return val+'元'}, |
| | | "yAxisDemo2":function(val){return val.toFixed(2)}, |
| | | "xAxisDemo1":function(val){return val+'年'}, |
| | | "xAxisDemo2":function(val){return formatDateTime(val,'h:m')}, |
| | | "seriesDemo1":function(val){return val+'元'}, |
| | | "yAxisDemo1":function(val, index, opts){return val+'元'}, |
| | | "yAxisDemo2":function(val, index, opts){return val.toFixed(2)}, |
| | | "xAxisDemo1":function(val, index, opts){return val+'年';}, |
| | | "xAxisDemo2":function(val, index, opts){return formatDateTime(val,'h:m')}, |
| | | "seriesDemo1":function(val, index, series, opts){return val+'元'}, |
| | | "tooltipDemo1":function(item, category, index, opts){ |
| | | if(index==0){ |
| | | return '随便用'+item.data+'年' |
| | |
| | | return '其他我没改'+item.data+'天' |
| | | } |
| | | }, |
| | | "pieDemo":function(val, index, series){ |
| | | "pieDemo":function(val, index, series, opts){ |
| | | if(index !== undefined){ |
| | | return series[index].name+':'+series[index].data+'元' |
| | | } |
| | |
| | | }, |
| | | } |
| | | }, |
| | | "mount":{ |
| | | "type": "mount", |
| | | "color": color, |
| | | "padding": [15,15,0,5], |
| | | "xAxis": { |
| | | "disableGrid": true, |
| | | }, |
| | | "yAxis": { |
| | | "data":[{"min":0}] |
| | | }, |
| | | "legend": { |
| | | }, |
| | | "extra": { |
| | | "mount": { |
| | | "type": "mount", |
| | | "widthRatio": 1.5, |
| | | }, |
| | | } |
| | | }, |
| | | "bar":{ |
| | | "type": "bar", |
| | | "color": color, |