Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ EChart simple and practical control on chart     - Linux Getting Started tutorial: Borrow Windows fonts in Ubuntu 14.10 (Linux)

- PLSQL Developer synchronization table tools (Database)

- MySQL 5.6.26 source install (Database)

- Use DB2 federated access Oracle (Database)

- Oracle Data File Management (Database)

- Oracle 11g manually create a database (Database)

- Oracle Database import and export combat (Database)

- Android memory optimization of the memory cache (Linux)

- Linux file content inspection - cat, tac, no, more, less, head, tail, od (Linux)

- Hibernate in profile (Database)

- Using the Linux folder wc statistics number of lines of code for all files (including subdirectories) (Linux)

- Precautions against hackers Linux environment (Linux)

- Error code: 2013 Lost connection to MySQL server during query (Database)

- MySQL master recovery from failure using binlog (Database)

- Json Applications of FastJson (Programming)

- Linux command -nohup & (Linux)

- C ++ copy constructor (Programming)

- Linux file compression and file system packaged with instructions (Linux)

- Ubuntu development Nodejs (Linux)

- MySQL server after an unexpected power outage can not start (Database)

 
         
  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:      
 
- DRBD daily management (Server)
- Quickly build and install Linux KVM system (Linux)
- Mounting Windows shared directory system under the Linux (Linux)
- How Mutt mail client to use cipher text password (Linux)
- Linux System Getting Started Learning: Join cron job in Linux (Linux)
- Installation Atom text editor on Mint Ubuntu / Linux (Linux)
- How to avoid two Chrome icon appears in ELementary OS Freya (Linux)
- Linux modify the network interface name (Linux)
- Linux system Perl Lite netstat (Linux)
- How to Install Node.js in CentOS 7 (Linux)
- Using Linux strace command trace / debug a program commonly used options (Linux)
- Ubuntu rights management common commands (Linux)
- Save the database data files into Oracle Learning (Database)
- Use scripts easily install the latest Linux kernel in Ubuntu (Linux)
- Zabbix Agent for Linux Installation and Configuration (Server)
- Flask deploy applications using Nginx on Ubuntu (Server)
- Qt signals and slots mechanism (Programming)
- MySQL log from the library than the main library (Database)
- The execution order of Oracle WHERE condition is not from right to left (Database)
- Linux virtual machine how to access the Internet in a virtual machine when using NAT mode (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.