Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jquery图形(提供输入的方式)_Javascript_Jquery_Json_Input - Fatal编程技术网

Javascript jquery图形(提供输入的方式)

Javascript jquery图形(提供输入的方式),javascript,jquery,json,input,Javascript,Jquery,Json,Input,我正在尝试将JSON对象绑定到jquery图表。在提供的示例中,他们静态地获取数据,即如下所示 var sampleData = [ { Country: 'China', Population: 1347350000, Percent: 19.18}, { Country: 'India', Population: 1210193422, Percent: 17.22}, { Country: 'U

我正在尝试将JSON对象绑定到jquery图表。在提供的示例中,他们静态地获取数据,即如下所示

var sampleData = [
                { Country: 'China', Population: 1347350000, Percent: 19.18},
                { Country: 'India', Population: 1210193422, Percent: 17.22},
                { Country: 'USA', Population: 313912000, Percent: 4.47},
                { Country: 'Indonesia', Population: 237641326, Percent: 3.38},
                { Country: 'Brazil', Population: 192376496, Percent: 2.74}];
例如,必须在此模式下准备数据,因为库中需要国家/人口/百分比。 取而代之的是一个JSON对象$.getJSON


我该怎么办?有什么想法吗?我是第一个使用jquery的人,所以我需要一些帮助

从JSON字符串创建对象就可以了。你有什么特别的问题吗?嗨,如果我没有错的话,你需要动态json吗?正如这个例子给你的静态。我说的对吗?你需要澄清你拥有什么和你需要什么。谁必须准备数据,以何种形式提供这些数据。这个问题不够清楚