data changed

This commit is contained in:
xie cong 2012-11-30 18:01:11 +08:00
parent 14dd359e87
commit 280d7e1df4
2 changed files with 27 additions and 28 deletions

View File

@ -115,28 +115,28 @@
//底框
underBn.push(paper.rect(legendArea[0] + 10, legendArea[1] + 10 + (20 + 3) * i, 180, 20).attr({
"fill": "#ebebeb",
"stroke": "none"
"stroke": "none"
//"r": 3
}).hide());
//色框
paper.rect(legendArea[0] + 10 + 3, legendArea[1] + 10 + (20 + 3) * i + 6, 16, 8).attr({
"fill": this.getColor(i),
"stroke": "none"
"stroke": "none"
});
//文字
paper.text(legendArea[0] + 10 + 3 + 16 + 8, legendArea[1] + 10 + (20 + 3) * i + 10, this.groupNames[i]).attr({
"fill": "black",
"fill-opacity": 1,
"font-family": "Verdana",
"font-size": 12
"fill-opacity": 1,
"font-family": "Verdana",
"font-size": 12
}).attr({
"text-anchor": "start"
});
//选框
rectBn.push(paper.rect(legendArea[0] + 10, legendArea[1] + 10 + (20 + 3) * i, 180, 20).attr({
"fill": "white",
"fill-opacity": 0,
"stroke": "none"
"fill-opacity": 0,
"stroke": "none"
//"r": 3
})).data("clicked", 0);
}
@ -396,10 +396,10 @@
chordEle = that.canvas.path(belt).
translate((that.defaults.width - this.xOffset) / 2 + this.xOffset, that.defaults.height / 2).attr({
"path": belt,
"fill": that.getColor(colorCalc(t)),
"fill-opacity": 0.6,
"stroke": "#d6d6d6",
"stroke-opacity": 0.1
"fill": that.getColor(colorCalc(t)),
"fill-opacity": 0.6,
"stroke": "#d6d6d6",
"stroke-opacity": 0.1
}).hover(mouseoverChord, mouseoutChord).data("source", chords[t].source.index).data("target", chords[t].target.index);
//.attr("fill", fillColor(chords[t].target.index))
chordEle.data('text', tips);
@ -427,8 +427,8 @@
donutEle = that.canvas.path(spline).translate((that.defaults.width - this.xOffset) / 2 + this.xOffset, that.defaults.height / 2).data("donutIndex", i).attr({
"path": spline,
"fill": that.getColor(i),
"stroke": that.getColor(i)
"fill": that.getColor(i),
"stroke": that.getColor(i)
}).mouseover(mouseOverDonut).mouseout(mouseOutDonut);
donutEle.data('text', tips);
that.donutGroups.push(donutEle);
@ -468,7 +468,7 @@
tickLine = "M" + aX + "," + aY + "L" + bX + "," + bY;
that.canvas.path(tickLine).attr({
'stroke': "#929292",
"stroke-width": '1px'
"stroke-width": '1px'
}); //绘制刻度
//每隔五个刻度,绘制一次文字

View File

@ -339,34 +339,33 @@
var source = this.source;
table.forEach(function(row,i){
if(that.allDimensions.indexOf(row[map.dimName])===-1){
table.forEach(function (row, i) {
if (that.allDimensions.indexOf(row[map.dimName]) === -1) {
that.allDimensions.push(row[map.dimName]);
that.dimensionType[row[map.dimName]] = "quantitative";
}
var j=0;
for(;j<source.length;j++){
if(source[j].name === row[map.label]){
var j = 0;
for (; j < source.length; j++) {
if (source[j].name === row[map.label]) {
break;
}
}
if(j>=source.length){
var obj={};
if (j >= source.length) {
var obj = {};
obj.name = row[map.label];
source.push(obj);
}
var d = row[map.dimValue];
if(DataV.isNumeric(row[map.dimValue])){
if (DataV.isNumeric(row[map.dimValue])) {
source[j][row[map.dimName]] = parseFloat(row[map.dimValue]);
}
else {
} else {
source[j][row[map.dimName]] = row[map.dimValue];
that.dimensionType[that.allDimensions[i]] = "ordinal";
}
});
/*
/*
this.source = DataV.collectionify(table);
@ -455,7 +454,7 @@
//色框
paper.rect(legendArea[0] + 10 + 3, legendArea[1] - 6 - (20 + 3) * i - 6, 16, 8).attr({
"fill": this.getColor(i),
"stroke": "none"
"stroke": "none"
});
//文字
paper.text(legendArea[0] + 10 + 3 + 16 + 8, legendArea[1] - 10 - (20 + 3) * i, this.groups[i].data('name')).attr({
@ -521,8 +520,8 @@
}
groups[i].data('clicked', false).attr({
'stroke-width': 2,
'fill': "",
'fill-opacity': 0
'fill': "",
'fill-opacity': 0
});
underBn[i].hide();
} else {