Add custom buttons to the Echarts custom Toolbox __echarts

Source: Internet
Author: User
Tags postgresql


Today I would like to be able to add their own buttons in the Echarts Toolbox, and then read the Toolbox code, I tried, the verification is OK.



1. Effect drawing



2, Code







selfbuttons:{//custom button Danielinbiti, here is added, Selfbuttons can be arbitrarily named
                   show:true,//whether
                   title: ' Custom ',//mouse Move up to display text
                   icon: ' test.png ',//icon
                   option:{},
                   onclick:function (option1) {//click event, here option1 is chart option information
                         Alert (' 1 ')///Here you can add your own processing code, switch different graphics
                         }
                    }


The position in the Toolbox







Toolbox: {
        show:true,
        feature: {
            mark: {show:true},
            DataView: {show:true, readonly:false},
            Mag Ictype: {show:true, type: [' line ', ' Bar ']},
            restore: {show:true},
            selfbuttons:{//custom button Danielinbiti, add here, Selfbuttons can take the name  
                   show:true,//whether or not to display  
                   title: ' Custom ',///mouse Move up to display the text  
                   icon: ' test.png ',//icon  
                   option:{},  
                   onclick:function (option1) {//click event, where Option1 is the chart option message  
                         alert (' 1 ');//Here you can add your own processing code, switch to different graphics  
                         }  
                    },
            saveasimage: {show:true}
        }
    }



Of course, there are many icons built in, and these icons are all drawn.







iconLibrary: {
            mark: _iconMark,
            markUndo: _iconMarkUndo,
            markClear: _iconMarkClear,
            dataZoom: _iconDataZoom,
            dataZoomReset: _iconDataZoomReset,
            restore: _iconRestore,
            lineChart: _iconLineChart,
            barChart: _iconBarChart,
            pieChart: _iconPieChart,
            funnelChart: _iconFunnelChart,
            forceChart: _iconForceChart,
            chordChart: _iconChordChart,
            stackChart: _iconStackChart,
            tiledChart: _iconTiledChart,
            dataView: _iconDataView,
            saveAsImage: _iconSave,
            cross: _iconCross,
            circle: _iconCircle,
            rectangle: _iconRectangle,
            triangle: _iconTriangle,
            diamond: _iconDiamond,
            arrow: _iconArrow,
            star: _iconStar,
            heart: _iconHeart,
            droplet: _iconDroplet,
            pin: _iconPin,
            image: _iconImage
        }
With chart suffix are placed in the Magictype type, while the suffix chart not, the program will automatically splicing, such as Linechart, write ' line '




Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.