|
|
@ -62,7 +62,7 @@ nv.addGraph(function() {
|
|
|
|
chart.yAxis.tickFormat(d3.format('.02f'))
|
|
|
|
chart.yAxis.tickFormat(d3.format('.02f'))
|
|
|
|
|
|
|
|
|
|
|
|
d3.select('#test1 svg')
|
|
|
|
d3.select('#test1 svg')
|
|
|
|
.datum(randomData())
|
|
|
|
.datum(randomData(4,40))
|
|
|
|
.transition().duration(500)
|
|
|
|
.transition().duration(500)
|
|
|
|
.call(chart);
|
|
|
|
.call(chart);
|
|
|
|
|
|
|
|
|
|
|
@ -72,18 +72,24 @@ nv.addGraph(function() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function randomData() {
|
|
|
|
function randomData(groups, points) { //# groups,# points per group
|
|
|
|
var data = [],
|
|
|
|
var data = [],
|
|
|
|
|
|
|
|
shapes = ['circle', 'cross', 'triangle-up', 'triangle-down'],
|
|
|
|
random = d3.random.normal();
|
|
|
|
random = d3.random.normal();
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (i = 0; i < groups; i++) {
|
|
|
|
data.push({
|
|
|
|
data.push({
|
|
|
|
key: 'Group ' + i,
|
|
|
|
key: 'Group ' + i,
|
|
|
|
values: []
|
|
|
|
values: []
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < 100; j++) {
|
|
|
|
for (j = 0; j < points; j++) {
|
|
|
|
data[i].values.push({x: random(), y: random(), size: Math.random()});
|
|
|
|
data[i].values.push({
|
|
|
|
|
|
|
|
x: random(),
|
|
|
|
|
|
|
|
y: random(),
|
|
|
|
|
|
|
|
size: Math.random(),
|
|
|
|
|
|
|
|
shape: shapes[i]
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|