Echarts Add custom buttons in custom toolbox

Source: Internet
Author: User

Today would like to be able to add their own buttons in the Echarts Toolbox, and then read the Toolbox code, and try it yourself, validation is OK.

1.


A red box button in the picture

2. Code

selfbuttons:{//custom button Danielinbiti, here Add, Selfbuttons can take the name                   show:true,//whether to display                   title: ' Custom ',//mouse to move up the text displayed                   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                         }                    }
Of course, there are a lot of 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: _icon Save, Cross: _iconcross, Circle: _iconcircle, Rectangle: _iconrectangle, Trian            GLE: _icontriangle, Diamond: _icondiamond, Arrow: _iconarrow, star: _iconstar, Heart: _iconheart, droplet: _icondroplet, Pin: _iconpin, Image: _iconimage}

The chart suffix is placed in the Magictype type, while the suffix chart is not used, the program will automatically splicing, such as Linechart, write ' line '

Echarts Add custom buttons in custom toolbox

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.