Graph currently uses document.write. More-over, it hardcodes if(window.mw) (instead of using ResourceLoader::makeLoaderConditionalScript) which means it is broken in current master because this condition changed.
$imgTagHtml::rawElement( 'img', array( 'class' => 'mw-wiki-graph-img', .. ); .. if ( $imgTag ) { $encImg = FormatJson::encode( $imgTag, false, FormatJson::UTF8_OK ); $result .= Html::inlineScript( 'if(!window.mw){document.write(' . $encImg . ');}' ) . Html::rawElement( 'noscript', array(), $imgTag );
If you need inline javascript that runs only when jQuery/ResourceLoader initialise, use ResourceLoader::makeInlineScript (which is a wrapper around Html::inlineScript and ResourceLoader::makeLoaderConditionalScript).
However in this case it actually does the opposite. It checks for absence rather than presence of window.mw. And also uses <noscript>. This no longer works in current MediaWiki master because mediawiki.js loads asynchronously.
Instead of this javascript and noscript code, use a plain image with a class and hide it in CSS. E.g. .client-js .mw-graph-something { display: none; }.
See also: