//tile
<section class="tile">
//tile header
<div class="tile-header">
<h1><strong>Sparkline</strong> Charts</h1>
<div class="controls">
<a href="#" class="refresh"><i class="fa fa-refresh"></i></a>
<a href="#" class="remove"><i class="fa fa-times"></i></a>
</div>
</div>
// /tile header
//tile body
<div class="tile-body">
<div class="row">
<div class="col-md-4">
<h5>Line chart</h5>
<span id="sparkline01"></span>
</div>
<div class="col-md-4">
<h5>Bar chart</h5>
<span id="sparkline02" data-values="5,6,7,2,1,-4,-2,4,6,8" data-type="bar" data-height="250px"></span>
</div>
<div class="col-md-4 text-center">
<h5 class="text-left">Pie chart</h5>
<span id="sparkline03"></span>
</div>
</div>
</div>
// /tile body
</section>
// /tile
//****************************//
//*********** jquery *********//
//****************************//
// Sparkline Line Chart
$('#sparkline01').sparkline([15,16,18,17,16,18,25,26,23], {
type: 'line',
width: '100%',
height:'250px',
fillColor: 'rgba(34, 190, 239, .3)',
lineColor: 'rgba(34, 190, 239, .5)',
lineWidth: 2,
spotRadius: 5,
valueSpots:[5,6,8,7,6,8,5,4,7],
minSpotColor: '#eaf9fe',
maxSpotColor: '#00a3d8',
highlightSpotColor: '#00a3d8',
highlightLineColor: '#bec6ca',
normalRangeMin: 0
});
$('#sparkline01').sparkline([1,2,1,3,1,2,4,1,3], {
type: 'line',
composite: true,
width: '100%',
height:'250px',
fillColor: 'rgba(255, 74, 67, .6)',
lineColor: 'rgba(255, 74, 67, .8)',
lineWidth: 2,
minSpotColor: '#ffeced',
maxSpotColor: '#d90200',
highlightSpotColor: '#d90200',
highlightLineColor: '#bec6ca',
spotRadius: 5,
valueSpots:[2,3,4,3,1,2,4,1,3],
normalRangeMin: 0
});
// Sparkline Bar Chart
var $el = $('#sparkline02');
var values = $el.data('values').split(',').map(parseFloat);
var type = $el.data('type') || 'line' ;
var height = $el.data('height') || 'auto';
var parentWidth = $el.parent().width();
var valueCount = values.length;
var barSpacing = 5;
var barWidth = Math.round((parentWidth - ( valueCount - 1 ) * barSpacing ) / valueCount);
$el.sparkline(values, {
width:'100%',
type: type,
height: height,
barWidth: barWidth,
barSpacing: barSpacing,
barColor: '#16a085',
negBarColor: '#FF0066'
});
// Sparkline Pie Chart
$('#sparkline03').sparkline([5,10,20,15 ], {
type: 'pie',
width: 'auto',
height: '250px',
sliceColors: ['#22beef','#a2d200','#ffc100','#ff4a43']
});