Clever solution! Might I make a small suggestion for improvement? Move the jQuery into a 'ready' event handler for the chart - this will ensure that the chart is done drawing before you try to change the axes. Also, this code won't work in IE < 9. Older versions of IE use VML instead of SVG, and they put the chart code in an iframe, so you have to modify your code to account for that. I don't have access to older versions of IE to test with right now, but this is the basis of what you should try:
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
google.visualization.events.addListener(chart, 'ready', function() {
// Use JQuery to find all the svg elements which have our marker... then replace the numeric value with our String
if ($.browser.msie && $.browser.version < 9) {
// handle older verserions of IE
$('#chart_div').find('iframe').contents().(/* selector for VML text element */).each(function(label, index) {
val = $(this).text().replace(MARKER, '')
$(this).text(toDir[val]);
});
}
else {
// handle all other browsers
$("text:contains('" + MARKER + "')").each(function(label, index) {
val = $(this).text().replace(MARKER, '')
$(this).text(toDir[val]);
});
}
});
chart.draw(dataTable, options);