Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ EChart simple and practical control on chart     - Use scripts easily install the latest Linux kernel in Ubuntu (Linux)

- Partition contrast manifestations under Windows and Linux (Linux)

- Three methods easy data encryption on Linux (Linux)

- Getting Started with Linux system to learn: How do I know which processes are running on the CPU core (Linux)

- Performance Diagnosis of 60,000 milliseconds for Linux (Linux)

- Learning and Practice (Linux)

- Linux directory permissions to read and execute permissions difference (Linux)

- QBit development of micro-services (Server)

- grub boot error resolution examples (Linux)

- Oracle index visible and hidden (visible / invisible) (Database)

- Linux Getting Started Tutorial: / var / spool / clientmqueue fill the root directory (Linux)

- Command filter MySQL slow query log (Database)

- Use lsof restore accidentally deleted log files or database (Linux)

- Linux file permissions chmod chown (Linux)

- How to install Perl modules from CPAN (Linux)

- CentOS yum source configuration (Linux)

- The top command under Linux (Linux)

- Spring AOP custom annotation way to achieve log management (Programming)

- Android child thread really do not update UI (Programming)

- Some practical tips Linux (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 ps command (Linux)
- RHEL5 stalled due to power service error system can not start (Linux)
- Tmux create the perfect terminal management tool under CentOS (Linux)
- Security of data to create a safe .mdb database (Linux)
- Android shutdown (reboot) process (Programming)
- Change the kernel boot sequence after CentOS 7 kernel upgrade (Linux)
- Install minimize RHEL / CentOS 7 things to do (Linux)
- MySQL 5.6 use GTIDs build the master database (Database)
- Open Ubuntu system updates (Linux)
- Ubuntu install Geary (Linux)
- Create, modify, delete users, user groups under linux (Linux)
- MySQL in order by inaccurate results in problems and solutions (Database)
- ORA-4031 error Solution (Database)
- What have we learn from the front-end application Nodejs (Programming)
- Linux (RHEL5) general optimization system security (Linux)
- The method of Linux into the rescue mode (Linux)
- Python context managers (Programming)
- Java filter (Programming)
- 17 How to install the Ubuntu 14.04 and Linux Mint Kodi14 (XBMC) (Linux)
- Hanoi problem Java Solution (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.