如何使用json的数据格式给Highcharts赋值
发布网友
发布时间:2022-04-24 03:31
我来回答
共2个回答
懂视网
时间:2022-04-24 07:53
下面小编就为大家带来一篇highchart数据源纵轴json内的值必须是int(详解)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
var users = ["0","0","0","0","0","2","0"];
这样的纵轴数据是不显示的,json里面的值必须是int类型。
必须是这样:
var users = [1,1,1,1,1,1,1];
难道不能自动转一下吗?还是我姿势不对,没有设置某个参数?
以上这篇highchart数据源纵轴json内的值必须是int(详解)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持PHP中文网。
更多highchart数据源纵轴json内的值必须是int(详解)相关文章请关注PHP中文网!
热心网友
时间:2022-04-24 05:01
package cn.sdeit.beans;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import cn.sdeit.mysql.ConnectMySql;
public class User
{
private String email;
private String password;
private String rePassword;
private String tel;
private String name;
private String sex;
private String birthday;
private String university;
private String major;
private String sID;
private int year;
public User(String email, String password, String rePassword,
String tel, String name, String sex, String birthday,
String university, String major, String sID, int year)
{
super();
this.email = email;
this.password = password;
this.rePassword = rePassword;
this.tel = tel;
this.name = name;
this.sex = sex;
this.birthday = birthday;
this.university = university;
this.major = major;
this.sID = sID;
this.year = year;
}
public User(String email)
{
super();
/*
* 此构造方法目的获取 UserBean 对象
* */
this.email = email;
}
public String getEmail()
{
return email;
}
public void setEmail(String email)
{
this.email = email;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
public String getRePassword()
{
return rePassword;
}
public void setRePassword(String rePassword)
{
this.rePassword = rePassword;
}
public String getTel()
{
return tel;
}
public void setTel(String tel)
{
this.tel = tel;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getSex()
{
return sex;
}
public void setSex(String sex)
{
this.sex = sex;
}
public String getBirthday()
{
return birthday;
}
public void setBirthday(String birthday)
{
this.birthday = birthday;
}
public String getUniversity()
{
return university;
}
public void setUniversity(String university)
{
this.university = university;
}
public String getMajor()
{
return major;
}
public void setMajor(String major)
{
this.major = major;
}
public String getsID()
{
return sID;
}
public void setsID(String sID)
{
this.sID = sID;
}
public int getYear()
{
return year;
}
public void setYear(int year)
{
this.year = year;
}
public String getUserString()
{
return "邮箱:" + email + "</br>"
+ "密码:"+password+ "</br>"
+ "号码:" + tel + "</br>"
+ "姓名:"+ name + "</br>"
+ "性别:" + sex + "</br>"
+ "生日:" + birthday+ "</br>"
+ "学校:" + university + "</br>"
+ "专业:" + major + "</br>"
+ "学号:"+ sID + "</br>"
+ "入学年份:" + year;
}
public User getOnlineUserBean()
{
Connection connection = ConnectMySql.createConnection();
String sql = "select * from user where email = ?";
PreparedStatement prepared = ConnectMySql.createPreparedStatement(connection, sql);
User onlineUserBean = null;
try
{
prepared.setString(1, email);
ResultSet set = prepared.executeQuery();
while(set.next())
{
onlineUserBean = new User(set.getString("email"), set.getString("password"),
set.getString("password"), set.getString("tel"), set.getString("name"),
set.getString("sex"), set.getString("birthday"), set.getString("university"),
set.getString("major"), set.getString("sid"), set.getInt("year"));
}
connection.close();
} catch (SQLException e)
{
e.printStackTrace();
}
return onlineUserBean;
}
}