Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ EChart simple and practical control on chart     - String JavaScript type system (Programming)

- React Getting Started Tutorial (Linux)

- Installing software on Ubuntu: apt-get and dpkg difference (Linux)

- Android components save state series - Activity (Programming)

- Modify Linux SSH default port 22 in several ways (Linux)

- Ubuntu install Wireshark (Linux)

- Rails project prepared some tips small experience (Linux)

- PostgreSQL-XL installation and deployment (Database)

- Btrfs file system repair techniques (Linux)

- KUbuntu / Ubuntu 14.04 (downgrade) installed SVN 1.7 (Linux)

- Java NIO1: I / O model overview (Programming)

- Quickly locate the mistakes by gdb location (Programming)

- Analysis of Java in the deep copy and shallow copy (Programming)

- Ubuntu simple method to track multiple time zones (Linux)

- Create the best introductory tutorial REST API (Linux)

- Example of use WebSocket (Programming)

- XenServer Virtual Machine Installation --- first ISO image file storage expansion (Linux)

- Oracle delete table space prompted ORA-00604 and ORA-38301 (Database)

- Easy to install CentOS 6.6 desktop environment (Linux)

- Upgrade Goldengate 11.1.1.1.2 to 11.2.1.0.1 (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:      
 
- Getting jQuery - progress bar (Programming)
- nginx.conf Optimization (Server)
- [Android] Eclipse does not update the Android SDK Manager solution [using GoAgent] (Programming)
- Use SecureCRT to transfer files between local and remote hosts (Linux)
- Java eight new features 8 (Programming)
- Linux, Chrome browser font settings beautification (Linux)
- OpenGL Programming Guide (8th edition of the original book) - compute shader (Programming)
- Under CentOS using yum command to install the Task Scheduler crontab (Linux)
- How to install the Ruby runtime environment on Mac OS X (Linux)
- Bash How to read a file line by line (Programming)
- Ora-14450: attempt to access ah transactional temptable already in use (Database)
- Linux System Getting Started Learning: On Linux how to convert text files to PDF (Linux)
- Oracle Automatic Diagnostic Repository (Automatic Diagnostic Repository, ADR) (Database)
- FreeBSD install Gnome 3 Desktop (Linux)
- VirtualBox - Linux system virtual machine shared folders (Linux)
- Linux System Getting Started Learning: Using yum to download the RPM package without installing (Linux)
- Introduction and MongoDB CRUD (Database)
- ORA-08102 errors (Database)
- RHEL5.8 physical opportunities to Read-only file system (Linux)
- Acquaintance C ++: the most simple C ++ program (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.