Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions visualize.jQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ $.fn.visualize = function(options, container){
});

//write Y labels
var yScale = canvas.height() / totalYRange;
var yScale = canvas.height() / totalYRange ;
var liBottom = canvas.height() / (yLabels.length-1);
var ylabelsUL = $('<ul class="visualize-labels-y"></ul>')
.width(canvas.width())
Expand All @@ -281,7 +281,7 @@ $.fn.visualize = function(options, container){
$.each(yLabels, function(i){
var thisLi = $('<li><span>'+o.labelFilter(this)+'</span></li>')
.prepend('<span class="line" />')
.css('bottom',liBottom*i)
.css('bottom',(yScale*(yLabels[i]-bottomValue)))
.prependTo(ylabelsUL);
var label = thisLi.find('span:not(.line)');
var topOffset = label.height()/-2;
Expand Down Expand Up @@ -401,15 +401,15 @@ $.fn.visualize = function(options, container){
*/
leftLabels = horizontal ? xLabels : yLabels;
var liBottom = canvas.height() / (leftLabels.length - (horizontal ? 0 : 1));

var yScale = canvas.height() / totalYRange;
var ylabelsUL = $('<ul class="visualize-labels-y"></ul>')
.width(canvas.width())
.height(canvas.height())
.insertBefore(canvas);

$.each(leftLabels, function(i){
var thisLi = $('<li><span>'+o.labelFilter(this)+'</span></li>').prependTo(ylabelsUL);

var label = thisLi.find('span:not(.line)').addClass('label');

if (horizontal) {
Expand Down Expand Up @@ -452,7 +452,7 @@ $.fn.visualize = function(options, container){
}
}
else {
thisLi.css('bottom', liBottom * i).prepend('<span class="line" />');
thisLi.css('bottom', yScale*(yLabels[i]-bottomValue)).prepend('<span class="line" />');
label.css('margin-top', -label.height() / 2)
}
});
Expand Down