Tsev HTML ntxhuav nrog “Google Visualization API”

Li cas li displaying koj cov ntaub ntawv tabulated muaj ib tug zoo kawm kos duab thiab tseem yuav tau txheeb thiab paginate, txhua yam los ua dynamically thiab tsis sau ib yam “Cov lus HTML”?

Kev nthuav qhia

Tus Google Visualization API pib ua caag rau visualization ntawm koj cov ntaub ntawv txheej sai thiab yooj yim. Nyob rau hauv tsev xa no peb yuav pom tus Kab kos cov lus.

Lag luam

Piv txwv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?PHP
<HTML lang="pt-BR">
  <lub taub hau>    
    <meta charset="ISO-8859-1" />
    <tsab ntawv hom='ntawv nyeem/javascript' src=' https://www.google.com/jsapi '></tsab ntawv>
    <tsab ntawv hom='ntawv nyeem/javascript'>
      Google.thauj khoom('visualization', '1', {tej pob khoom:['lus]});
      Google.setOnLoadCallback(drawTable);
      muaj nuj nqi drawTable() {
        Var hnub = tshiab Google.visualization.DataTable();
        hnub.addColumn('hlua', 'Npe');
        hnub.addColumn('tooj', 'Nyiaj hli');
        hnub.addColumn('boolean', 'Tas hnub');
        hnub.AddRows([
          ['John',  {v: 2000, (f): 'R$ 2,000.00'}, tseeb],
          ['Maria', {v: 5000, (f): 'R$ ' 5,000.00}, tsis tseeb],
          ['Alice', {v: 1000, (f): 'R$ 1,000.00'}, tseeb],
          ['Bob',   {v: 1500, (f): 'R$ 1,500.00'}, tseeb]
        ]);
        Var cov lus = tshiab Google.visualization.Cov lus(daim ntawv.getElementById('table_div'));
        cov lus.txhuav(hnub, {showRowNumber: tseeb});
      }
    </tsab ntawv>
  </lub taub hau>
  <lub cev>
    <div daim id='table_div'></div>
  </lub cev>
</HTML>
?>

(1) Nyob rau hauv cov cai hais los saum toj, Nco ntsoov tias peb pib los ntawm kev hu rau JavaScript API hauv Google (JSAPI).

(2) Ces, Peb lub neej Visualization, hauv version 1.0, thiab koj lub tsev qiv ntawv ' cov lus’.

(3) Peb siv cov kev ua ntawm JSAPI setOnLoadCallback muab cov handler drawTable (los yog lwm lub npe koj xav), leej twg leej twg tus tiag yuav tsum tsim thiab teem lub rooj.

(4) Tus DataTable yuav txia mus ua ib rooj uas txhua sab yuav tsum yog tib cov hom txaus siab HTML (hlua, Boolean, naj npawb, thiab lwm yam).

(5) Siv lub addColumn() los ua ib tug ncej tag, dua li parameter hom thiab cov given npe.

(6) Siv AddRows() los ua tus natwm ntawm lub rooj, IE, Ntxig koj tej ntaub ntawv nws tus kheej. Kab no delimited yog nkauj square [] thiab cov ntaub ntawv ntawm txhua ntawm tes yog cais los ntawm ib tug comma. Twb paub lawm muaj ib cim “v” thiab “(f)”, uas kuv kaj lias tias tus nqi thiab kev teb, feem, IE, cov nqi no ntawm tus xovtooj ntawm daim ntawv lo nrog yuav tsum tso tawm kom pom hauv lub teb. Qhov no yog ib, vim hais tias, ua no sab “zauv”, li ntawd, qhov tseeb ordering yuav tau undermined yog tias nws lawv coj li cov hlua.

(7) Thaum kawg, Peb qhia rau koj uas DIV cov lus tsim yuav kav (table_div) thiab npaj txhij!

Rau qhov xyaum

Cov cai hais los saum toj generates HTML rooj nram qab no:

Nws yuav tsis nthuav txawm? Tag nrho cov lus HTML yog tsim tsis tau tias peb yuav tsum tau sau ib zaug xwb cov lus, TR lossis TD. tau mas, Qhov no yog ib tug ua qauv qhia. Koj yuav tob zuj zus koj paub thiab pom lwm possibilities mus ua hauj lwm nrog cov ntxhuav hauv lub Kab kos cov lus.

Gallery

Yog tseem muaj ntau lwm laj ntseg uas tus Google kab kos Gallery muab. Muaj ntau ntau yam graphics optimized kev tu ncua ntawm cov ntaub ntawv visualization. Tus graphics yog nyob rau lub HTML5/SVG ntshiab tshuab (adopting VML rau qub versions ntawm IE), li ntawd, yuav tsis muaj kev plugins. Cov kab kos yuav muab ntxiv rau koj sab rau ib txhia yoojyim.

Fonts

Tag nrho hits: 5928

sau ntawv cia

Qhov koj email chaw nyob yuav tsis muab luam tawm. Search yog cim muaj *