Here is a sample BSV of a implementation of Sparklines in Aware IM (v7) standard queries. There is a total of 7 Sparklines available and works with some small quirks (explained below).
Screenshot: Instructions (Windows example):
1. Unzip "Sparklines.zip" (attached)
2. Create a folder called "sparklines" in the main Aware IM folder (same folder that contains the "startup.html" file) and move file "jquery.sparkline.min.js" into that folder
3. Create a folder called "Temp" on C: and move files "sparkline1.txt" to "sparkline7.txt" into that folder.
4. Add the following to "startup.html" (to just before the JS seperator):
Code: Select all
<script type="text/javascript" src="sparklines/jquery.sparkline.min.js"></script>
Code: Select all
.jqstooltip{
box-sizing: content-box;
}
7. Dissect/understand and use in your own app.
A couple of notes:
- This implementation uses the URL_CONTENTS function to populate plain text attributes with the HTML needed in the query and the advanced render script of the query then targets and draws the Sparklines based off the values in the attributes. That means you have to build a feature in you app where you populate txt files with the correct HTML you want to use in a Sparkline and this is then used in the Sparkline when drawn and all of this can be done via business rules and tags in a txt document template (see/dissect sample for more details). Not the best solution but works and the reason I had to go this way is because it isn´t possible to populate "valid" HTML with quotation marks etc. into attributes using business rules.
- Using paging bars doesn´t work (the Sparklines aren´t "re-drawn" when using the default paging bar) so you have to implement your own paging bar like the example I did (I only added a process to the query ("Next" button) to show how it would work but the process doesn´t do anything, you have to add the logic to filter entries to simulate a paging bar function).
- There is a small delay when displaying the query where the values are shown and then when the advanced render script is executed (500ms delay, see advanced scripts for the query and you can play around with the delay etc. and see if you can do something else maybe or decrease delay) the Sparklines are drawn.
- You have to use a process to refresh the query (otherwise the Sparklines aren´t drawn again).