Skip to content

Commit

Permalink
Merge pull request #4 from dreamind/master
Browse files Browse the repository at this point in the history
Making legend more customizable
  • Loading branch information
simogeo committed Jul 6, 2012
2 parents 073716b + bc33d08 commit 2d5a5be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
14 changes: 14 additions & 0 deletions 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;
}
7 changes: 4 additions & 3 deletions lib/geostats.js
Expand Up @@ -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) {
Expand All @@ -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;
};

Expand Down

0 comments on commit 2d5a5be

Please sign in to comment.