Click to accumulate [JS] --- JQuery to implement bar chart, which is applicable to multiple choice questions and other statistics. jquery bar chart

Source: Internet
Author: User

Click to accumulate [JS] --- JQuery to implement bar chart, which is applicable to multiple choice questions and other statistics. jquery bar chart

Effect:

 

Idea: front-end JS achieves Dynamic Data effects, and the backend can splice strings or load data with JSON

Code:

<% @ Page Language = "C #" AutoEventWireup = "true" CodeBehind = "tiao. aspx. cs" Inherits = "qiantaoflash. tiao" %> <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "> <Head runat =" server "> <title> green apple bar Statistics </title> <link href =" css/jQuery.spider.poll.css "rel =" stylesheet "type =" text/css "/> <script type =" text/javascript "src =" js/jquery-1.4.3.min.js "> </script> <script type =" text/javascript "src =" js/jQuery. spider. poll-min.js "> </script> <script type =" text/javascript "> var data =" {root: [{id: '000000', name: 'Get married first ', value: '50'}, {id: '000000', name: 'start', value: '50'}]} "; var data1 = "{ Root: [{id: '000000', name: 'Alliance ', value: '60'}, {id: '000000', name: 'orch', value: '25'}, {id: '000000', name: 'undead dead ', value: '15'}, {id: '000000', name: 'Night genie ', value: '10'}]} "; var data2 =" {root: [{id: '000000', name: '', value: '0 '}, {id: '000000', name: 'authorization', value: '000000'}]} "; $ (document ). ready (function () {$ ("# poll_a "). poll ("poll1", {title: 'Get married first or make a career first ', width: '600px', data: data}); $ ("# poll_ B "). poll ("poll2", {title: 'Young Apple cannot compete for each race? ', TitleColor: 'red', width: '600px', data: data1, showPoll: true, multiple: true}); $ ("# poll_c "). poll ("poll3", {title: 'important educational qualifications or important competencies ', titleColor: 'Blue', width: '600px ', data: data2, multiple: false }); $ ("# getPollData1 "). click (function () {$ ("# poll_ B "). getChecked (). each (function (I, n) {alert ($ (n ). val () ;}) ;}; $ ("# getPollData2 "). click (function () {$ ("# poll_c "). getChecked (). each (function (I, n) {alert ($ (n ). val ());});});}); </script> 

Download Demo:

Http://files.cnblogs.com/files/xinchun/tongjitu.zip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.