I just created a user macro as listed below. It produces a rendering error but I cannot see what to do about it. Adding the code using the html-macro it works perfectly fine. Thanks for help, BKS
## Macro title: Google Graph ## Macro has a body: N ## Body processing: No macro body ## Output: Selected output option ## ## Developed by: Firstname Lastname ## Date created: 15/09/2015 ## Installed by: Firstname Lastname ## ## @param SourceFile:title=Quelldatei|type=string|required=true|desc=Gib den Pfad zur Quelldatei an ## @param DataType:title=Datentyp|type=enum|enumValues=tav,role|default=tav|desc=Datentyp gibt an nach welcher Logik die Quelldatei geparst werden muss ## @param ChartID:title=Chart ID|type=string|required=true|desc=Vergebe jedem Chart eine eindeutige ID ## @param ChartTitle:title=Chart-Titel|type=string|required=true|desc=Der Titel des Charts ## @param ChartType:title=Chart-Typ|type=enum|enumValues=column,pie,line|default=column|desc=Waehle den Typen ## @param ChartWidth:title=Breite der Abbildung|type=string|required=true|desc=Angabe in Pixel - ohne px ## @param ChartHeight:title=Höhe der Abbildung|type=string|required=true|desc=Angabe in Pixel - ohne px ## @param AxisVertTitle:title=Titel der vertikalen Achse|type=string|required=true|desc=Setze die Beschriftung für die vertikale Achse ## @param AxisHorTitle:title=Titel der horizontalen Achse|type=string|required=true|desc=Setze die Beschriftung für die horizontale Achse <div id="chart_$paramChartID"> </div> <script type="text/javascript" src="https://www.google.com/jsapi"> </script> <script type="text/javascript" src="http://192.168.56.202:8090/download/attachments/1081346/DrawChart.js"> </script> <script type="text/javascript"> // Load the Visualization API and the piechart package. google.load('visualization', '1.0', {'packages':['corechart']}); </script> <script type="text/javascript"> $.ajax({ type: "GET", url: "$paramSourceFile", success: function(csvData) { switch ("$paramDataType") { case "tav": var data = ProcessTAVData(csvData); break; default: var data = ProcessTAVData(csvData); } // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(DrawChart( data, "$paramChartID", "$paramChartTitle", "$paramChartType", "$paramChartWidth", "$paramChartHeight", "$paramAxisHorTitle", "$paramAxisVertTitle" )); } }); </script>
It's probably the $.ajax({. I've had issues with the velocity engine mistaking the $ as a velocity variable. Try this instead.
## @param AxisHorTitle:title=Titel der horizontalen Achse|type=string|required=true|desc=Setze die Beschriftung für die horizontale Achse #set( $d = '$' ) <div id="chart_@paramChartID"> </div> .... .... ${d}.ajax({...
or you can just use jQuery instead of $
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yup. That'll work too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thx, that was pretty obvious. ;) I just replaced the $ with 'jQuery' and now everything works fine! :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you get any errors in the console when it tries to run on a page?
Also, have you tried just removing pieces of the code until it works to try and pin point where it is failing?
Here are some things that you may want to check also:
https://answers.atlassian.com/questions/21353
https://answers.atlassian.com/questions/201855
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.