Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ EChart simple and practical control on chart     - Linux, Apache Web site security settings (Linux)

- Json Applications of FastJson (Programming)

- Linux Powerful command Awk Introduction (Linux)

- How to install and use the malware detection tool LMD and ClamAV antivirus engine on Linux (Linux)

- Android graphic introduction NDK installation and simple jni demo implementation (Linux)

- How to configure SNMPv3 on Ubuntu, CentOS and Cisco systems (Linux)

- The basic method RHEL6 (CentOS6) used in the source package compiled RPM: Upgrade OpenSSH articles (Linux)

- A script to make your Ubuntu 14.04 Memory screen brightness (Linux)

- Configuring DNS process under CentOS 6.5 (Server)

- Upgrading to Debian 7.6 glibc 2.15 (Linux)

- Java development environment to build under Ubuntu (Linux)

- How to troubleshoot Windows and Ubuntu dual system time is not synchronized (Linux)

- php security study (Linux)

- Linux variable learning experience (Linux)

- Mistakenly deleted redo log file group being given the lead to start the database ORA-03113 (Database)

- Kali Linux 2.0 U disk installation errors Your installation cd-rom could not be mounted (Linux)

- IntelliJ IDEA common list of shortcuts (Linux)

- RHEL5.8 physical opportunities to Read-only file system (Linux)

- Java-based data source database access (Programming)

- Installation JDK1.7 under Ubuntu14.04 64-bit (Linux)

 
         
  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:      
 
- Linux use glibc2 library and crypt () function to generate the user password (Programming)
- Debian 8 (amd64) installation deployment Memcached management tools MemAdmin (Server)
- GAMIT learning materials finishing (Linux)
- DNF Command Tutorial (Linux)
- Oracle View Object Information (Database)
- C ++ thread creates transmission parameters are changed (Programming)
- How comprehensive resist attacks from the network (Linux)
- MySQL 5.6 Open full query log (Database)
- Management DB2 logs (Database)
- Ubuntu install Vendetta Online 14.04 (Linux)
- About ORA-02391 solution (Database)
- ISO image to use offline upgrade Ubuntu (Linux)
- Ubuntu 14.04 and derivative version of the user on how to install cURL 7.37.1 (Linux)
- Disk Management LVM (Linux)
- Live Wallpaper for Linux release adds dynamic background (Linux)
- MariaDB 10.0.X, the dynamic column support JSON format to obtain data (Database)
- Using IntelliJ IDEA Import Spark Spark latest source code and compile the source code (Linux)
- C ++ input and output summary _ Input (Programming)
- MySQL 5.6 master-slave replication configuration (Database)
- How to add a new hard disk without restarting the CentOS 7 / RHEL 7 virtual machine (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.