-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor revisions, better example code.
- Loading branch information
1 parent
c9c12ac
commit ce56647
Showing
3 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
|
||
{{extend 'layout.html'}} | ||
<!-- need to source this in any view which has a LOAD chart --> | ||
<script src="https://www.google.com/jsapi" type="text/javascript"></script> | ||
|
||
<!-- In this example, the same data is used for both charts so the data_url is set only once --> | ||
<!-- Here, data and options same for both charts --> | ||
<!-- user_signature works if using logged-in users ... not well tested --> | ||
{{ data_url = URL('plugin_google_chart','plugin_return_data.json',user_signature=True)}} | ||
<div class="span6"> | ||
{{ | ||
{{ data_url = URL('plugin_google_chart','plugin_return_data.json',user_signature=True) | ||
#options are documented at https://developers.google.com/chart/ | ||
options ={'title':'Sales vs Expenses','width':0,'height':0} | ||
}} | ||
}} | ||
|
||
<div class="span6"> | ||
{{=LOAD('plugin_google_chart','plugin_google_chart.load',ajax=True, | ||
user_signature=True,vars={'type':'bar','data_url':data_url, | ||
'options_dict':options})}} | ||
'options_dict':options}) | ||
}} | ||
</div> | ||
|
||
<div class="span6"> | ||
{{=LOAD('plugin_google_chart','plugin_google_chart.load',user_signature=True,ajax=True, | ||
vars={'type':'column','data_url':data_url,'options_dict':options})}} | ||
vars={'type':'column','data_url':data_url,'options_dict':options}) | ||
}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
{{extend 'layout.html'}} | ||
<!-- need to source this in any view which has a LOAD chart --> | ||
<script src="https://www.google.com/jsapi" type="text/javascript"></script> | ||
|
||
<!-- Here, data and options same for both charts --> | ||
<!-- user_signature works if using logged-in users ... not well tested --> | ||
{{ data_url = URL('plugin_google_chart','plugin_return_data.json',user_signature=True) | ||
#options are documented at https://developers.google.com/chart/ | ||
options ={'title':'Sales vs Expenses','width':0,'height':0} | ||
}} | ||
|
||
<div class="span6"> | ||
{{=LOAD('plugin_google_chart','plugin_google_chart.load',ajax=True, | ||
user_signature=True,vars={'type':'bar','data_url':data_url, | ||
'options_dict':options}) | ||
}} | ||
</div> | ||
|
||
<div class="span6"> | ||
{{=LOAD('plugin_google_chart','plugin_google_chart.load',user_signature=True,ajax=True, | ||
vars={'type':'column','data_url':data_url,'options_dict':options}) | ||
}} | ||
</div> |