Browse files

Merge pull request #4 from dreamind/master

Making legend more customizable
  • Loading branch information...
2 parents 073716b + bc33d08 commit 2d5a5be416d382afb7ac33a34b1320cde62570ec @simogeo committed Jul 6, 2012
Showing with 18 additions and 3 deletions.
  1. +14 −0 lib/geostats.css
  2. +4 −3 lib/geostats.js
View
14 lib/geostats.css
@@ -0,0 +1,14 @@
+.geostats-legend-title {
+ font-weight: bold;
+ margin-bottom: 4px;
+}
+
+.geostats-legend-block {
+ border: 1px solid #555555;
+ display: block;
+ float: left;
+ height: 12px;
+ margin: 0px;
+ margin-right: 3px;
+ width: 20px;
+}
View
7 lib/geostats.js
@@ -508,10 +508,10 @@ var geostats = function(a) {
return;
}
- var content = '<span>' + _t(lg) + '&nbsp;: </span><div style="height:15px"></div>';
+ var content = '<div class="geostats-legend"><div class="geostats-legend-title">' + _t(lg) + '</div>';
for (i = 0; i < (this.ranges.length); i++) {
if(getcounter===true) {
- cnt = ' <span class="cnt">(' + this.counter[i] + ')</span>';
+ cnt = ' <span class="geostats-legend-counter">(' + this.counter[i] + ')</span>';
}
// check if it has separator or not
if(this.ranges[i].indexOf(this.separator) != -1) {
@@ -520,8 +520,9 @@ var geostats = function(a) {
} else {
var el = fn(this.ranges[i]);
}
- content += '<p><div class="legend-block" style="background-color:' + ccolors[i] + '"></div> : ' + el + cnt + '</p>';
+ content += '<div><div class="geostats-legend-block" style="background-color:' + ccolors[i] + '"></div> ' + el + cnt + '</div>';
}
+ content += '</div>';
return content;
};

0 comments on commit 2d5a5be

Please sign in to comment.