Hi,
I am writing a customer service portal, and for one of the modules I'd like to use the google chart API, the code to pull the data and present it is already finished, but I am having trouble with how to get it to work in the DTL? I suppose I have to put it in the dtl::js_on_document_complete right?
Has anyone tried something like this?
Google Chart and dtl?
Moderator: crythias
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Google Chart and dtl?
I wrote this in 2012, but don't know how it currently applies.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Re: Google Chart and dtl?
Ah yes, I was confused as to the variable scope in javascript and the relation to the script tags, in the end I just made a dtl block where I basically did
Passing the finished JSON object in as graphData, and I just loaded the Google Chart JS in the top of the dtl file.
Works fine!
Code: Select all
<script type="text/javascript">
var graphData = $Data{"graphData"};
</script>
Works fine!