score:1

If you're using JSTL, you can do something like:

<script th:inline="javascript" type="text/javascript">
    $(document).ready(function () {
        var graphData = '<c:out value="${d3Data}"/>';
        alert(graphData);
        // continued javascript detailed on the example
    });
</script>

Related Query

More Query from same tag