I am working on a project using the AngularJS version of the SmartAdmin Bootstrap template available here.
As part of the project, I need to add sparklines to several of the pages. I have it working just fine with static data such as:
<div id="revenue-chart" class="sparkline no-padding bg-dark-orange"
data-sparkline-type="line"
data-fill-color="#ffc65d"
data-sparkline-line-color="#ffc65d"
data-sparkline-spotradius="0"
data-sparkline-width="100%"
data-sparkline-height="180px"> 90,60,50,75,30,42,19,100,99,76,89,65 </div>
The SmartAdmin template provides a way to implement the jQuery sparklines without direct manipulation of the javascript. That is the reason for the data-* directives.
However, when I switch the code to the following, it no longer displays a graph.
<div id="revenue-chart" class="sparkline no-padding bg-dark-orange"
data-sparkline-type="line"
data-fill-color="#ffc65d"
data-sparkline-line-color="#ffc65d"
data-sparkline-spotradius="0"
data-sparkline-width="100%"
data-sparkline-height="180px"> {{revenue.points}} </div>
I added a <div> {{revenue.points}} </div>
to the page, and it prints the values correctly, so I know the values are being passed to the page.
My guess is that the graph is being rendered before the Angular code is processed thereby showing no data for the graph to display. Is there some code I can add to trigger the graph to be redrawn after the Angular substitution occurs? Or is it possible to delay drawing the graph until after the substitution occurs?
I am new to both Angular and Bootstrap, so I am certain I am missing something, I just am not sure where else to look on this.
The template uses Bootstrap 3.3 and Angular 1.4.2.