1、格式1

1.1例子

[
{name: '北京',value: Math.round(Math.random()*1000)},
{name: '天津',value: Math.round(Math.random()*1000)},
{name: '上海',value: Math.round(Math.random()*1000)}
]

1.2拼接方式

var data = eval("(" + result + ")");
var num1Arr = [];// new Array();
var dataff = {}; for (var i = 0; i < data.length; i++) {
if (parseInt(data[i].count1) > 0) {
dataff["name"] = data[i].ProvinceName; dataff["value"] = parseInt(data[i].count1);
num1Arr.push(dataff);
dataff = {};
} }

  2、格式2

2.1例子

data: [
[1230771600000, -5.8, 0.1],
[1230858000000, -4.1, 1.4],
[1230944400000, -0.5, 4.1],
[1231030800000, -8.9, -0.7],
[1231117200000, -9.7, -3.7],
[1231203600000, -3.4, 3.2]
]

2.2拼接方式

 var Line_First = new Array();
for (var i = 0; i < dataList.length; i++) {
Line_First.push([dataList[i].X_Value, dataList[i].Y_Value,222]);
}

 3、格式3

3.1例子

[1230771600000, -5.8, 0.1]

3.2 拼接方式

 var Line_First = new Array();
for (var i = 0; i < dataList.length; i++) {
Line_First.push(dataList[i].X_Value);
}

  

JS 拼接字符串数组的更多相关文章

  1. js拼接字符串传值,子窗口传值

    避免下次再去查资料,记录一下 1.拼接字符串传值 "UpdateState?ids=" + subStr+"&remark="+reValue) 目标页 ...

  2. JS 常用字符串,数组操作

    JavaScript String/Array对象 JS String对象   String 对象属性 属性 描述 constructor 对创建该对象的函数的引用 length 字符串的长度 pro ...

  3. js jq 字符串数组对象

    数组是有序的,对象是无序,数组是特殊的对象 数组 声明数组 var arr=new Array('red','blue','yellow'); //["red", "bl ...

  4. js拼接字符串后swiper不能动的解决方案

    swiper的配置一定要放在拼接字符串之后,紧随其后,如果放在其他的位置,swiper是不识别HTML的.

  5. 关于前端js拼接字符串的一点小经验

    1.今天在做项目的时候遇到一个问题,就是使用onclick="xxx()"  点击事件的时候,参数如果为全数字就会出现点击无反应的问题.但是当参数为字符串或者动态内容的时候就会出现 ...

  6. js拼接字符串,字符串转数组

    想要把字符串按一定的规则拼起来如 1,2,3 var a = []; a.push(1); a.push(2); a.push(3); a.join(','); =>> 1,2,3 想要把 ...

  7. js 拼接字符串,table等

    var userTableStr=''; userTableStr +='<table width="750" height="33" border=&q ...

  8. js到字符串数组,实现阵列成一个字符串

    数组字符串(阵列元件与字符串连接) var a, b; a = new Array(0,1,2,3,4); b = a.join("-");   字符串转数组(根据一个字符串被分成 ...

  9. JS 清除字符串数组中,重复元素

    <script language="JavaScript"> <!-- var arrData=new Array(); for(var i=0; i<10 ...

随机推荐

  1. Asp.net 加载事件(转载)

    using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Secu ...

  2. Eclipse设置选中高亮显示

    高亮显示选中的变量对于程序员编程很有帮助,正常情况下Eclipse选中变量时都会高亮显示,可能软件冲突导致高亮显示失效,通过如下方法可以进行恢复. 单击IDE顶部Window菜单下的Prefences ...

  3. linux–nohup命令(转)

    在应用Unix/Linux时,我们一般想让某个程序在后台运行,于是我们将常会用 & 在程序结尾来让程序自动运行.比如我们要运行mysql在后台: /usr/local/mysql/bin/my ...

  4. 设置glassfish开启自动domain

    1-在/etc/rc.local中配置开机自启动 su - sumapay25 -c "/opt/glassfish.sh start 1" 2-/opt/glassfish.sh ...

  5. Oracle 索引创建、表分区

    --EAF_WORKFLOWSTEP 表创建 CREATE TABLE EAF_WORKFLOWSTEP ( ) NOT NULL PRIMARY KEY USING INDEX TABLESPACE ...

  6. JS中isPrototypeOf 和hasOwnProperty 的区别 ------- js使用in和hasOwnProperty获取对象属性的区别

    JS中isPrototypeOf 和hasOwnProperty 的区别 1.isPrototypeOf isPrototypeOf是用来判断指定对象object1是否存在于另一个对象object2的 ...

  7. git操作的常用命令

    git remote show origin 查看git远程信息git remote set-url origin git@gitlab.staff.xdf.cn:woxue/woxueadmin.g ...

  8. sourceTreee设置忽略的文件

    1.忽略不想要的目录,比如bin.obj目录(每次运行本机程序都会变化) 这个在右上角的Settings的Advanced下面的Repository-specific ignore list,点击Ed ...

  9. One of the best logo fonts "Klavika"

    Download link: http://fontsgeek.com/search?q=Klavika

  10. 基于Java Mina 通信框架的JT/T809转发服务器设计

    Apache MINA 是 Apache 组织的一个开源项目,为开发高性能和高可用性的网络应用程序提供了非常便利的框架. 也是Java开发者的一个福利(.NET目前还没有类似封装的这么好的基础sock ...