r.2 - AssetTitle_Bar (Boolean)
by Steve Thompson
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<div class="container">
<div class="cont-box-shadow">
<div class="info">
<div class="var-icon">
<div class="var-structure var-blue">
(
</div>
<div class="var-type var-blue">
A
</div>
<div class="var-structure var-blue">
)
</div>
</div>
<div class="var-name">Square Feet</div>
<a href="#">
<div class="info-icon"></div>
</a>
<a href="#">
<div class="alert-icon"></div>
</a>
</div>
<div class="chart-container">
<div id="chart1"></div>
</div>
<div class="menu-tools">
<a href="#">
<div class="nD-edit sm-icons" title="Edit"></div>
</a>
<a href="#">
<div class="nD-trash sm-icons" title="Delete"></div>
</a>
</div>
</div>
</div>
CSS
.container {
width: 196px;
height: 196px;
background-color: #eceded;
position: relative;
padding: 2px;
overflow: hidden;
}
.cont-box-shadow {
width: 100%;
height: 100%;
background-color: white;
-webkit-box-shadow: 0px 1px 1px 1px rgba(171, 172, 172, 1);
-moz-box-shadow: 0px 1px 1px 1px rgba(171, 172, 172, 1);
box-shadow: 0px 1px 1px 1px rgba(171, 172, 172, 1);
}
.info {
width: 100%;
height: 25px;
background-color: #555555;
margin: 0 auto;
}
.var-icon {
position: relative;
float: left;
margin: 5px;
width: 19px;
height: 14px;
font-size: 12px;
}
.var-blue {
color: #42a5f5;
}
.var-structure {
position: relative;
float: left;
}
.var-type {
position: relative;
float: left;
}
.var-name {
font-size: 12px;
color: white;
position: relative;
float: left;
margin-top: 5px;
}
.alert-icon {
// display: none;
background: url(http://i.imgur.com/TcAIU77.png) no-repeat;
position: relative;
float: right;
margin: 5px 3px;
width: 16px;
height: 14px;
}
.info-icon {
background: url(http://i.imgur.com/NhumKdn.png) no-repeat;
position: relative;
float: right;
margin: 5px 5px 5px 0;
width: 14px;
height: 14px;
}
.info-icon:hover {
background: url(http://i.imgur.com/Y4NJcU5.png) no-repeat;
}
.chart-container {
width: 100%;
height: 77%;
}
#chart1 {
cursor: pointer;
width: 100%;
height: 100%;
margin: 0 auto;
position: relative;
}
.menu-tools {
display: none;
position: relative;
float: right;
margin-right: 5px;
}
.container:hover .menu-tools {
display: block;
}
.sm-icons {
width: 15px;
height: 15px;
position: relative;
float: left;
margin-right: 5px;
}
.nD-edit {
background: url(http://i.imgur.com/2JA9xGB.png) no-repeat;
}
.nD-edit:hover {
background: url(http://i.imgur.com/wl0o0oZ.png) no-repeat;
}
.nD-trash {
background: url(http://i.imgur.com/5V6UKIT.png) no-repeat;
}
.nD-trash:hover {
background: url(http://i.imgur.com/PjzC5eV.png)...
JavaScript
$(function() {
Highcharts.setOptions({
lang: {
thousandsSep: ','
}
});
$('#chart1').highcharts({
chart: {
type: 'bar',
backgroundColor: 'transparent',
plotBorderColor: null,
spacingBottom: 5,
spacingTop: 15,
spacingLeft: 10,
spacingRight: 10
},
colors: ['#a8b1b8', {
linearGradient: {
x1: 0,
y1: 0,
x2: 1,
y2: 0
},
stops: [
[0, 'rgb(190, 199, 206)'],
[1, 'rgb(212, 217, 222)']
]
}],
credits: {
enabled: false
},
exporting: {
enabled: false
},
legend: {
enabled: false
},
title: {
text: ''
},
xAxis: {
visible: false
},
yAxis: {
visible: false,
endOnTick: false,
maxPadding: 0.025
},
tooltip: {
borderWidth: 0,
backgroundColor: "#3c3f42",
borderRadius: 5,
hideDelay: 1000,
shadow: false,
headerFormat: '',
followPointer: true,
useHTML: true,
pointFormat: '<span style="font-size: 10px; color: white;">{point.name}</span><br/><span style="color: white; font-weight: bold;">{point.y:,.0f} ({point.percentage:,.0f}%)</span><br/>'
},
plotOptions: {
bar: {
borderWidth: 0,
borderRadius: 0,
cursor: 'pointer',
stacking: 'percent',
states: {
hover: {
color: '#f37021'
}
}
}
},
series: [{
data: [{
name: 'n',
y: 103
}]
}, {
data: [{
name: 'y',
y: 1042
}]
}]
});
});