The plugin is using JS library from jQuery Sparklines which builds interactive spark charts. Currently, only a couple of options were brought over, but if there is a demand I will add others into the plugin.
Installation:
-
Copy tm1ui.sparkline.js to js\lib (create the folder if it doesn’t exist)
-
Open WEB-INF\pages\index.ftl
-
Find
var customAngularModules = []
and add ‘tm1uisparkline’ inside
var customAngularModules = [‘tm1uisparkline’]
-
Find
<!-- START: LINKS/PATHS TO YOUR NON-ANGULAR or other CSS -->
-
Add reference to tm1ui.sparkline.js file at the end of the list but before
<!-- END: LINKS/PATHS TO YOUR NON-ANGULAR or other CSS -->
<script src="../../js/lib/tm1ui.sparkline.js" ></script>
- Open css\style.css and add (this fixes tooltip issue)
.jqstooltip{
box-sizing: content-box;
}
Directive Name: tm1-ui-spark-chart
Example:
<tm1-ui-spark-chart tm1-data="product.v" tm1-columns="page.periods.length" tm1-chart="bar" tm1-tooltip="true"></tm1-ui-spark-chart>
Attributes:
tm1-data object/array of values
tm1-columns number of columns
tm1-chart chart type (line, bar, tristate, discrete, bullet, pie, box)
tm1-tooltip true/false
Check spark.html file to see how to implement spark lines on TM1 CXMD samples.
Sample installation
- Copy spark.html to html folder
- Copy spark.js to js\controllers folder
Files:
tm1UiSpark.zip (14.0 KB)