Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ EChart simple and practical control on chart     - Effect MongoDB plan cache (Database)

- Git remote repository Explanation (Linux)

- 14.04.3 Ubuntu configuration and successfully compiled source code Android 6.0 r1 (Programming)

- Linux (RHEL6 CENTOS6 OLE6) VNC-SERVER Installation and Configuration (Server)

- DDOS Attacks and Prevention (Linux)

- Linux Platform Oracle 11g Single Instance Installation Deployment Configuration Quick Reference (Database)

- Log4cplus logging facility configuration, installation, testing (Linux)

- Using Linux strace command trace / debug a program commonly used options (Linux)

- To disable the function by pressing Ctrl-Alt-Del to restart the system in RHEL / CentOS 5/6 (Linux)

- S5PV210 development board for embedded development environment to build under Ubuntu (Linux)

- Ubuntu install perfectly handsome terminal Guake 0.8.1 (Linux)

- About the replication of JavaScript (Programming)

- Java to create a table in the database SYBase (Database)

- Understanding the type in C ++ bitset (Programming)

- GRUB how to load Linux kernel (Linux)

- SSH Filesystem use a secure connection for network file system (Linux)

- How to upgrade the kernel to 3.13.7 on Ubuntu / Linux Mint (Linux)

- Linux character device - a simple character device model (Linux)

- C # asynchronous delegates (Programming)

- Python 3.5 await / async (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:      
 
- Using open source software to build XWiki Wiki system installed within the company (Linux)
- How to Install Focuswriter 1.4.5 (Linux)
- Zabbix monitoring platform to extract a single server graphical Python implementation of concurrent (Server)
- Oracle to create an external table (Database)
- Ubuntu 14.04 can be used to create a WIFI hotspot for Android (Linux)
- MySQL common functions summary (Database)
- How to Install Xombrero 1.6.4 (minimalist Web browser) on Ubuntu and Archlinux (Linux)
- MySQL 5.6 Open full query log (Database)
- Oracle multi-table query optimization (Database)
- Timing task Crontab under Linux system (Linux)
- cursor_sharing induced error ORA-00600 (Database)
- Linux CentOS configuration SVN + SVN hook (Server)
- The Concept and Semantics of Java Memory Model (Programming)
- Cobbler Add custom YUM source (Linux)
- Linux SVN installation and configuration graphic tutorials (Server)
- Difference in MySQL VARCHAR and CHAR data format (Database)
- The security configuration of Linux (Linux)
- Distributed File System using MogileFS (Linux)
- Detailed steps - GAMIT solver (Linux)
- Use Nginx as a load balancer (Server)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.