X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Fchart-labels.js;h=504ed3a24274fd937e5e78bcf8300da7533edbca;hb=c01c6b5cadedea62fbc6dab2457dc67c1201caa4;hp=d6c10951d7cf6226f07a4a482def4583c8b257ca;hpb=13f8b0472ff8e7336bdf56f69ff838a1f3e76162;p=dygraphs.git diff --git a/plugins/chart-labels.js b/plugins/chart-labels.js index d6c1095..504ed3a 100644 --- a/plugins/chart-labels.js +++ b/plugins/chart-labels.js @@ -3,6 +3,8 @@ * Copyright 2012 Dan Vanderkam (danvdk@gmail.com) * MIT-licensed (http://opensource.org/licenses/MIT) */ +/*global Dygraph:false */ + Dygraph.Plugins.ChartLabels = (function() { "use strict"; @@ -90,18 +92,6 @@ var createRotatedDiv = function(g, box, axis, classes, html) { inner_div.style.OTransform = val; // Opera inner_div.style.msTransform = val; // IE9 - if (typeof(document.documentMode) !== 'undefined' && - document.documentMode < 9) { - // We're dealing w/ an old version of IE, so we have to rotate the text - // using a BasicImage transform. This uses a different origin of rotation - // than HTML5 rotation (top left of div vs. its center). - inner_div.style.filter = - 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + - (axis == 1 ? '3' : '1') + ')'; - inner_div.style.left = '0px'; - inner_div.style.top = '0px'; - } - var class_div = document.createElement("div"); class_div.className = classes; class_div.innerHTML = html; @@ -109,7 +99,7 @@ var createRotatedDiv = function(g, box, axis, classes, html) { inner_div.appendChild(class_div); div.appendChild(inner_div); return div; -} +}; chart_labels.prototype.layout = function(e) { this.detachLabels_(); @@ -123,6 +113,7 @@ chart_labels.prototype.layout = function(e) { this.title_div_.style.textAlign = 'center'; this.title_div_.style.fontSize = (g.getOption('titleHeight') - 8) + 'px'; this.title_div_.style.fontWeight = 'bold'; + this.title_div_.style.zIndex = 10; var class_div = document.createElement("div"); class_div.className = 'dygraph-label dygraph-title'; @@ -191,7 +182,7 @@ chart_labels.prototype.clearChart = function() { }; chart_labels.prototype.destroy = function() { - detachLabels(); + this.detachLabels_(); };