Javascript chrome 31中的Google piecharts文本对齐问题

Javascript chrome 31中的Google piecharts文本对齐问题,javascript,jquery,google-chrome,google-visualization,Javascript,Jquery,Google Chrome,Google Visualization,在chrome版本31中,当您查看页面时,数字和文本的位置很差,通常在较大的页面上脱离页面。“德语”变为“德语”,而“45%”变为“45” 2.我将下面的代码用于解决此问题 if(window.navigator.appVersion.match(/Chrome\/(31.*?) /)) { // fix for chrome v31 var pie_text = jQuery('#all-receivers-pie-chart g text'); var chrome_fix

在chrome版本31中,当您查看页面时,数字和文本的位置很差,通常在较大的页面上脱离页面。“德语”变为“德语”,而“45%”变为“45”

2.我将下面的代码用于解决此问题

if(window.navigator.appVersion.match(/Chrome\/(31.*?) /)) { // fix for chrome v31
    var pie_text = jQuery('#all-receivers-pie-chart g text');
    var chrome_fix = jQuery(pie_text[1]).attr('x') - 30; //it's the second one causing the problem, move it to the left 30px
    jQuery(pie_text[1]).attr('x',chrome_fix); 
}
3.使用上述代码,当页面加载时,文本定位正确。但当我将鼠标移到图表上时,工具提示就会出现,饼图切片文本会恢复到原来的糟糕位置


4.此外,当任何字段的值小于2.46%左右时,该字段将没有文本字段,并且上述代码将无法工作

当用户将鼠标移出图表元素时,需要使用
onmouseout
事件处理程序调用该代码:

// assuming you have a function called "fixLabelAlignmentInChrome"
google.visualization.events.addListener(myPieChart, 'onmouseout', fixLabelAlignmentInChrome);