Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ EChart simple and practical control on chart     - Sniffer Linux Environment (Linux)

- Linux Shell Scripting multithreading (Programming)

- Ceph cluster disk is no workaround for the remaining space (Server)

- Let Mac OS X dedicated high-speed mobile hard disk can also be read in Linux (Linux)

- Installation Sublime Text 3 (Build 3065) text editor in Ubuntu (Linux)

- 10 Nginx safety tips (Linux)

- MongoDB common optimization settings in Linux (Database)

- Ten SCP transfer command example (Linux)

- Autojump: an advanced cd command in the Linux file system fast navigation (Linux)

- Compile and install GCC 4.8.1 + GDB 7.6.1 + Eclipse in CentOS 6.4 in (Linux)

- OpenSSH server configuration file for each Common Definition (Server)

- Android Unzip the ZIP / GZIP data (based on the InflaterInputStream implementation) (Programming)

- LVS + Keepalived the DR mode (Server)

- Configuring LIDS build Linux kernel security intrusion detection system (Linux)

- Redis application of Sina Weibo (Database)

- Install minimize RHEL / CentOS 7 things to do (Linux)

- Linux vi command list (Linux)

- Java 8 stream parsed into SQL (Programming)

- Linux systems use logwatch log file monitoring (Linux)

- Effective Java - lazy initialization (Programming)

 
         
  EChart simple and practical control on chart
     
  Add Date : 2018-11-21      
         
         
         
 

1. Download the preceding frame and placed in the project.

2. Call

in the js


< html lang = "en" >

< head >

< meta charset = "utf-8" >

< title > ECharts < / title >

< / head >

 

< body >

    < - Step:! 1 Prepare a dom for ECharts which (must) has size (width & hight) - >

    < - Step:! 1 to prepare a ECharts with size (width and height) of Dom - >

    < div id = "main"

        style = "height: 500px; border: 1px solid #ccc; padding: 10px;" > < / div >

    < div id = "mainMap"

        style = "height: 500px; border: 1px solid #ccc; padding: 10px;" > < / div >

 

    < - Step:! 2 Import echarts.js - >

    < - Step:! 2 introduced echarts.js - >

    < script src = "$ {base.contextPath} /js/echarts.js" > < / script >

    < script type = "text / javascript"

        src = "$ {base.contextPath} /js/jquery-1.6.2.min.js" > < / script >

    < script type = "text / javascript" >

        // Step: 3 conifg ECharts's path, link to echarts.js from current page

.

        // Step: 3 for the module loader configuration path echarts from the current page links to echarts.js, define the required chart a path

        require.config ({

            paths: {

                echarts: '$ {base.contextPath} / js'

           }

       });

 

        // Step:. 4 require echarts and use it in the callback

        // Step: 4 dynamic loading echarts then started in the callback function to keep the demand loading structure is defined chart a path

        $ (document) .ready (

                function () {

                    $ .ajax ({

                        url: "? $ {Base.contextPath} / total / data type = 1",

                        type: 'get',

                        contentType: "application / json",

                        cache: false,

                        success: function (text) {

                            var data = text;

 

                            bar (data);

                       },

                        error: function (jqXHR, textStatus, errorThrown) {

                            btnSave.setEnabled (true);

                            if (400 == jqXHR.status || 403 == jqXHR.status

                                    || 500 == jqXHR.status)

                                return;

                            var text = "The operation failed," + jqXHR.responseText;

                            mini.alert (text);

                       }

                   });

               });

        // bar (null);

        function bar (data) {

            var sData = new Array ();

            var sX = new Array ();

            for (i = 0; i < data.length; i ++) {

                sData [i] = data [i] .total;

                sX [i] = data [i] .brand;

           }

            require ([ 'echarts', 'echarts / chart / bar', 'echarts / chart / line',

            // 'echarts / chart / map'

           ], function (ec) {

 

                // --- off column ---

                var myChart = ec.init (document.getElementById ( 'main'));

                myChart.setOption ({

                    tooltip: {

                        trigger: 'axis'

                   },

                    legend: {

                        data: [ 'Total']

                   },

                    toolbox: {

                        show: true,

                        feature: {

                            mark: {

                                show: true

                           },

                            dataView: {

                                show: true,

                                readOnly: false

                           },

                            magicType: {

                                show: true,

                                type: [ 'line', 'bar']

                           },

                            restore: {

                                show: true

                           },

                            saveAsImage: {

                                show: true

                           }

                       }

                   },

                    calculable: true,

                    xAxis: [{

                        type: 'category',

                        data: sX

                   }],

                    yAxis: [{

                        type: 'value',

                        splitArea: {

                            show: true

                       }

                   }],

                    series: [{

                        name: 'Total',

                        type: 'bar',

                        data: sData

                   },

                    / *   {

                        name: 'precipitation',

                        type: 'bar',

                        data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]

                   } * /

                   ]

               });

           });

       }

    < / script >

< / body >

< / html >

     
         
         
         
  More:      
 
- Manually generate AWR reports (Database)
- Search Linux commands and files - which, whereis, locate, find (Linux)
- Oracle 11g user rights management study notes (Database)
- Intrusion analysis and prevention tools Knark under Linux platform (Linux)
- Linux under HAProxy + Keepalived dual-availability program (Server)
- How to network to share files between Windows, MAC and Linux (Linux)
- MySQL configuration file my.cnf increase the log file parameter error (Database)
- Use Markdown editor for document work under Linux (Linux)
- Difference in MySQL VARCHAR and CHAR data format (Database)
- Hadoop2.4.0 Eclipse plug-in making (Server)
- JavaScript object - Flexible and dangerous (Programming)
- Linux Mint 17 set up the Ruby environment (Linux)
- RPM package management tools under Linux (Linux)
- According to the national position on how to block traffic in Linux (Server)
- Spark local development environment to build (Server)
- XenServer virtual machines installed in dual-card configuration (Server)
- Linux POST fstab configuration file read-only variable can not be modified problem (Linux)
- Based shell: using read, the command-line script to achieve mass participation and input two integer calculation (Programming)
- GoldenGate for Oracle data consistency initializing (Database)
- TNS-03505 name could not be resolved (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.