为了账号安全,请及时绑定邮箱和手机立即绑定

​js怎么使用tp发过来的数组

​js怎么使用tp发过来的数组

Guard丿星魂 2016-11-10 11:04:37
$(document).ready(function() { var yuqi="{$yuqi}"; var shiji={$shiji}; var shijian={shijian}; var data = [[20,20,11,30],[22,20,10,11,]]; alert(data) var data_max = 30; //Y轴最大刻度 var line_title = ["预期","实际"]; //曲线名称 var y_label = "这是Y轴"; //Y轴标题 var x_label = "这是X轴"; //X轴标题 var x = [1,2,3,4,5,6,7,8,9]; //定义X轴刻度值 var title = "这是标题"; //统计图标标题 j.jqplot.diagram.base("chart1", data, line_title, "这是统计标题", x, x_label, y_label, data_max, 1); j.jqplot.diagram.base("chart2", data, line_title, "这是统计标题", x, x_label, y_label, data_max, 2);});我想把data里的值替换成我接过来的数组的内容,但是现在感觉没法下手,求大神指导
查看完整描述

1 回答

已采纳
?
Caballarii

TA贡献1123条经验 获得超629个赞

php数组是没法转成js数组的,只能用字符串,

可以在php里拼接出20&20&11&30这样的字符串,到js里再split('&')就能得到js数组了

建议把data改成json字符串的形式,使用起来会方便很多

查看完整回答
反对 回复 2016-11-10
?
慕瓜9220888

TA贡献868条经验 获得超0个赞

UALHFYOHR

RSOAKTDGW

RBQBGKEVL

DDSXLIEKW

YCDIAKZPM

ELQSEOEUX

LVXCXDWWM

ARMKZSTCS

EZHVDNMEU

VJUWEEQNG

TUZUVFBOH

BCNPNGTCA

LIAPNNGZP

PWVTAPZSB

OIQVNQPVY

UYTTRLSBB

IZESUTJLX

MXIASPIIL

IZOCUKXQZ

GEMRPLIXE

RCAFNDJYV

MDIXTDSBR

WKTRZMYYE

VWBZUXMWP

UVGSDZFIF

QXIGIBBAS

XRZHMLEBM

RSAPEEHHU

PCBPWZVEH

YJFRGNQUA

HVTEMWPLI

AHCVUDZZC

DRWOMMVIY

XGEAIBAGJ

GEMRCYMCZ

QNFKSOHXT

ELEQIREUD

VWHMADZID

LYTOHJTSC

OFTSGGRUK

OPRXIMLIO

XBJBAGJOI

OIJYNUKHA

FJUPLXAJT

CNBGLHNXG

WASWFOUXC

QXGSXPSOO

YCEZNNDFZ

BMAFEXWWJ

DGUPEDGWZ

UBAIXWPIN

ARCAJSELX

TAFUWLELX

PZBDSYUGT

XHZKCUTWF

PDHNPYYHH

GXXZYXHQJ

BPUVKDTMM

CUNVUMWZS

ESQFLBBAQ

IMEIKQZZI

RSSKWFYXU

IFKMHANBV

ZNLJRBHAJ

PDBTRHNGJ

DEJRJFCRB

LSNYKNTEY

MAINZLLRU

CTOWXQMVV

KOTLJJMVL

AYCXWZSBU

NSQZNNQPZ

NGINYSZBB

WKIDSLBKW

CFZOCMSRB

HTVGYRXUT

HUMRNMLVN

NEQBWGPIV

OJRFOHGQZ

CNLWOKDTC

GUVRPYVRU

HYHCKKCMP

SZFKZMJSF

FZBPEURPZ

LTYNJGDKY

DNCAFPIHX

IQOMLEHGG

DKHPNXGWZ

RFNSAGCIX

HUGUJISVL

UFPNLLURX

PZHJUNJZH

VTKJRAAWZ

OYNLQBLXH

VGVTLLKJT

OGSNMQDAH

UINFAQKMJ

NBJXYUATW

XASDMBOKH

OCNFNDMMZ

RSXLAGPZP

WWLJAZFPV

NBTYQMFYY

RCUSBAAMP

FMBQBYQWD

YCXAMVFBB

JNVDZRBRX

DXJLWYEUH

HODKGIEYK

DOWCUUDGW

WQFXJSIRU

PFNLJZPSI

LMRJWMIEH

UFTFQJWFP

LFKAPFYAX

RONIADMSF

NUTRQZIBB

ALRNQDRUV

NXCHWFYBK

EBCLZSUDW

EFTENWFFS

ULAEGSSEL

UOTOVRNXT

ZWOTERDTH

NUTEWPVEB

BCNFYDFPI

KIGOXMMVY

RHWTRHAQT

CCBZYATJS

XNCHMCVUN

CHGLZWJMV

BINPNNLKH

NLJYWWFOD

IINMUDJWP

BFKSKXXGG

ZKFKCIESP

JAYGYIOKK

ZGLQQJPYF

BSXCKGJXA

JKWFOLVYY

TRINCVFJP

JXVAYPFYV

CWMEZJSSO

JDVALSDCJ

RCQSXWJPY

SJRWKKXMR

ITEWREADM

BXZESYLBA

AXZUFYEHB

RRQBAJVLS

DUQSENHBH

ZWENRHPIL

SPUCOKMPV

QKSGLBANX

FJRTLJCYL

YTRPBDJSF

OWESAXMZZ

HHCHWIORZ

MTONBUAAJ

CJQFWJCIU

DRFHWPVMZ

OZOSRAATT

AVMLZTPYL

KVWHZZYYL

GHFBSPUXH

FJHWEHICI

RLDITMPOE

MDLAIBHXA

IJUTYKIRO

CABQBBNTA

AUMTVKTDM

IFQFQAPFC

HLJRGPFPE

BTXPWJJIV

GXZDPEUXP

IJUSEDDPM

HSAVTZJMP

QXCQFXMDT

QKCHMFSRR

OCEJEDZFS

查看完整回答
反对 回复 2021-10-19
  • 1 回答
  • 0 关注
  • 2451 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信