首页 > 其他分享 >echart使用记录

echart使用记录

时间:2023-06-04 17:04:00浏览次数:44  
标签:echart 记录 true type show value 使用 data name


ECharts详细说明 [url]http://elang0705.iteye.com/blog/2252577[/url]


[color=red][b]格式化提醒[/b][/color]

tooltip: {

 trigger: 'item', // 单个显示,多个提示使用axis

 //formatter: "{a} <br/>{c} ({d}%)"

 formatter: function(params, ticket, callback){

 alert("formatter");

 //自己返回格式化信息

 }

 }



一张图里面包含两个pie图

option1 = {
                title : {
                    text: '性别统计',
                    subtext: '纯属虚构',
                    x:'right'
                },
                tooltip : {
                    trigger: 'item',
                    formatter: "{a} <br/>{b} : {c} ({d}%)"
                },
                legend: {
                    orient: 'vertical',
                    left: 'left',
                    data: ['本科男','本科女','硕士男','硕士女']
                },
                series : [
                    {
                        name: '硕士',
                        type: 'pie',
                        radius : '55%',
                        center: ['35%', '30%'],
                        data:[
                            {value:250, name:'硕士男'},
                            {value:150, name:'硕士女'}
                        ],
                        itemStyle: {
                            emphasis: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    },
                    {
                        name: '本科',
                        type: 'pie',
                        radius: '55%',
                        center: ['70%', '70%'],
                        data: [
                            {value: 500, name:'本科男'},
                            {value: 300, name: '本科女'}
                        ]
                    }
                ]
            };

            myChart1 = echarts.init(document.getElementById('canvas1'), globalEChartTheme);
            myChart1.setOption(option1);




一个柱状图 + 一个pie图


option1 = {
                "title": {"text": "采购统计排行", "subtext": "采购统计排行"},
                "tooltip": {"trigger": "axis"},
                "legend": {
                    "x": "left",
                    "y": "bottom",
                    "data": ["切割机V1", "PVC0.4", "PVC0.9"]
                },
                "toolbox": {
                    "show": true,
                    "orient": "vertical",
                    "x": "right",
                    "y": "center",
                    "feature": {
                        "mark": {"show": true},
                        "dataView": {"show": true, "readOnly": false},
                        "magicType": {"show": true, "type": ["line", "bar", "stack", "tiled"]},
                        "restore": {"show": true},
                        "saveAsImage": {"show": true}
                    }
                },
                "calculable": true,
                "xAxis": [{"type": "category", "data": ["采购数量统计排名"]}],
                "yAxis": [{"type": "value"}],
                "series": [
                    {
                        "type": "bar",
                        "markPoint": {"data": [{"type": "max", "name": "最大值"}, {"type": "min", "name": "最小值"}]},
                        "markLine": {"data": [{"type": "average", "name": "平均值"}]},
                        "name": "切割机V1",
                        "data": [13]
                    }, {
                        "type": "bar",
                        "markPoint": {"data": [{"type": "max", "name": "最大值"}, {"type": "min", "name": "最小值"}]},
                        "markLine": {"data": [{"type": "average", "name": "平均值"}]},
                        "name": "PVC0.4",
                        "data": [1313]
                    }, {
                        "type": "bar",
                        "markPoint": {"data": [{"type": "max", "name": "最大值"}, {"type": "min", "name": "最小值"}]},
                        "markLine": {"data": [{"type": "average", "name": "平均值"}]},
                        "name": "PVC0.9",
                        "data": [1125]
                    },
                    {
                        name: '本科',
                        type: 'pie',
                        radius: '10%',
                        center: ['70%', '20%'],
                        data: [
                            {value: 13, name: '切割机V1'},
                            {value: 1313, name: 'PVC0.4'},
                            {value: 1125, name: 'PVC0.9'}
                        ]
                    }]
            };
            myChart1 = echarts.init(document.getElementById('canvas1'), globalEChartTheme);
            myChart1.setOption(option1);



柱状图每个周期对应单独的一个并图


[url]http://echarts.baidu.com/demo.html#mix-timeline-finance[/url]


标签:echart,记录,true,type,show,value,使用,data,name
From: https://blog.51cto.com/u_3871599/6411122

相关文章

  • freemarker使用记录
    freeMarker语法[url]http://uule.iteye.com/blog/879566[/url]Freemarker页面语法[url]http://jiangsha.iteye.com/blog/372307[/url][b]算术运算符[/b]FreeMarker表达式中完全支持算术运算,FreeMarker支持的算术运算符包括:+,-,*,/,%看如下的代......
  • Druid使用起步—在javaWeb项目中配置监控
    配置druid监控springjdbc代码[url]http://19950603.blog.51cto.com/9921553/1616566[/url]AliDruid连接池与监控配置[url]http://langmnm.iteye.com/blog/2112099[/url]阿里巴巴Druid配置监控官方:[url]https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_StatV......
  • Dropzone JS 使用指南(文件拖拽上传)
    JavaScript文件拖拽上传插件dropzone.js介绍[url]https://www.renfei.org/blog/dropzone-js-introduction.html[/url]DropzoneJS使用指南(文件拖拽上传)[url]http://www.open-open.com/lib/view/open1448610841329.html[/url]后台资料:基于SpringMVC的......
  • J2EE环境变量的其他使用方式
    [color=red]1.[b]System.getProperty()获取tomcat自定义变量[/b][/color][url]http://zwxiaole.iteye.com/blog/1832053[/url]环境tomcat集群有一个定时器为了防止所有集群的服务器都跑定时而出错选择其中一台服务器修改tomcatbin目录下的windows......
  • 使用MD5验证传输文件的完整性和一致性
    在发布更新的时候验证资源完整性是非常重要的,这里我区分为两种,一种是更新资源的完整性,另外一种是远程执行发布任务脚本的一致性,在开发前期如果不注重这个问题的话,很可能在上线前期就会出现一些灾难性问题。第一种,shell中使用md5sum验证传输文件的完整性这个我是用shell中md5sum来做......
  • jQuery使用iframe做tab标签
    jQueryTab插件[url]http://jqueryui.com/tabs/#default[/url][b][color=red]Jquery、tabs、iframe相结合[/color][/b][url]http://blog.sina.com.cn/s/blog_656977f401014oy6.html[/url]使用Jquery中的ui.tabs.js,如果tab中的界面有按钮需要跳转到新的页......
  • Slik-Subversion使用命令行或者Ant获得本地svn的版本号码
    使用命令行Subversion访问项目源文件[url]https://www.open.collab.net/nonav/scdocs/ddUsingSVN_command-line.html.zh-cn[/url]Slik-Subversion安装包地址[url]https://sliksvn.com/pub/[/url]1.安装Slik-Subversion-1.7.19-x64.msi[url]https://sli......
  • jquery mobile的一些使用记录。
    [color=red][b]自定义按钮图标去除按钮阴影/圆角[/b][/color][url]http://bbs.phonegap100.com/thread-218-1-1.html[/url][color=red][b]jQueryMobile自定义按钮图标[/b][/color]JqueryMobile自定义按钮图标[url]http://liningjustsoso.iteye.com/blog/1986769[/url][co......
  • nas使用docker部署导航页Heimdall
    一、下载镜像linuxserver/heimdall:latest二、创建容器文件/文件夹:此处填写在nas上事先创建好的目录位置装载路径:/config类型选读写本地端口其实用自动的就行,不与已有端口冲突即可。启动容器,检查日志是否有报错项。如没有报错,容器应该为运行中的状态。三、打开Heimdall导航页点击快......
  • Debian 11安装搜狗输入法不能正常使用解决记录
    linux版本:DistributorID:DebianDescription: DebianGNU/Linux11(bullseye)Release: 11Codename: bullseyeLinuxming5.10.0-22-amd64#1SMPDebian5.10.178-3(2023-04-22)x86_64GNU/Linux在使用最新的搜狗输入法()时,发现fcitx正常识别,但是通过Ctrl+Space无法正......