これが私がしたことです:
parseXML('<foreignObject xmlns="http://www.w3.org/2000/svg"><body xmlns="http://www.w3.org/1999/xhtml"><p id="seriesTitle"></p><p id="seriesValue"></p><p style="margin:0;text-align:center;" id="seriesDate"></p></body></foreignObject>')
parseXml()はクロスブラウザでサポートされているわけではないので、このコードを一番上に表示します。
if (typeof parseXML=='undefined') {
window.parseXML = function (s,doc) {
doc = doc || document;
var doc2=(new DOMParser()).parseFromString(s, "text/xml");
return doc.adoptNode(doc2.documentElement);
}
}
次に、jQueryを使用してフラグメントの代わりにクエリを実行し、必要な値を設定できます。
jQuery('#seriesTitle', detailChart.mytooltip).text( point.series.name );
jQuery('#seriesValue', detailChart.mytooltip).text( point.y );
jQuery('#seriesDate', detailChart.mytooltip).text( date.getMonth() + '/' + date.getDate() + '/' + date.getFullYear() );
問題は、VMLがforeignObjectのようなものをサポートしていないことです。SVGは、HTMLの問題をすべて抱えていないアプリケーションを構築するための優れたソリューションに非常に近いものです。