如何计算 nvd3.js 堆积面积图中的输入数据
how to figure out the input data in nvd3.js Stacked Area Chart
伙计们,我正在尝试使用 nvd3.js 和 angular.js 实现堆积面积图,输入数据如下,
{
"key" : "North America" ,
"values" : [ [ 1025409600000 , 23.041422681023] , [ 1028088000000 , 19.854291255832],
[ 1030766400000 , 21.02286281168],
[ 1033358400000 , 22.093608385173],
[ 1036040400000 , 25.108079299458],
[ 1038632400000 , 26.982389242348]]
}
我看不懂这个数据代表什么。特别是 X 轴数据,它从下面的数据中获取日期值,但我无法弄清楚。任何帮助都会很棒。原始代码的link如下
http://nvd3.org/examples/stackedArea.html
以上数据中,
{
"key" : "North America" ,
"values" : [ [ 1025409600000 , 23.041422681023] , [ 1028088000000 , 19.854291255832],
[ 1030766400000 , 21.02286281168],
[ 1033358400000 , 22.093608385173],
[ 1036040400000 , 25.108079299458],
[ 1038632400000 , 26.982389242348]]
}
It shows one series of a stack bar chart. Where Key Indicates the
Series Name and The Values indicates the Stack, if you take the first
value 1025409600000
is the Date (Here its timestamp) and
19.854291255832
is the y axis value. Similarly it goes on, You can have more series with different stacks.
您可以在此处查看 FullStack
数据。
伙计们,我正在尝试使用 nvd3.js 和 angular.js 实现堆积面积图,输入数据如下,
{
"key" : "North America" ,
"values" : [ [ 1025409600000 , 23.041422681023] , [ 1028088000000 , 19.854291255832],
[ 1030766400000 , 21.02286281168],
[ 1033358400000 , 22.093608385173],
[ 1036040400000 , 25.108079299458],
[ 1038632400000 , 26.982389242348]]
}
我看不懂这个数据代表什么。特别是 X 轴数据,它从下面的数据中获取日期值,但我无法弄清楚。任何帮助都会很棒。原始代码的link如下 http://nvd3.org/examples/stackedArea.html
以上数据中,
{
"key" : "North America" ,
"values" : [ [ 1025409600000 , 23.041422681023] , [ 1028088000000 , 19.854291255832],
[ 1030766400000 , 21.02286281168],
[ 1033358400000 , 22.093608385173],
[ 1036040400000 , 25.108079299458],
[ 1038632400000 , 26.982389242348]]
}
It shows one series of a stack bar chart. Where Key Indicates the Series Name and The Values indicates the Stack, if you take the first value
1025409600000
is the Date (Here its timestamp) and19.854291255832
is the y axis value. Similarly it goes on, You can have more series with different stacks.
您可以在此处查看 FullStack
数据。