AmCharts legend items do not break - amcharts

Example: https://jsfiddle.net/Lkn0j5gz/
When I use the following the legend items break, I want them to be displayed as list.
legend: {
position: 'absolute'
}
Cannot find anything usefull in the
API: http://docs.amcharts.com/3/javascriptcharts/AmLegend

If you meant for the legend to display a single entry per line, you need to set maxColumns to 1.
legend: {
maxColumns: 1,
// ...
}
Demo:
var chart = AmCharts.makeChart("chartdiv", {
"type": "pie",
"startDuration": 0,
"theme": "none",
"addClassNames": true,
"legend": {
"position": 'absolute',
"maxColumns": 1,
"marginRight": 100,
"autoMargins": false
},
"innerRadius": "30%",
"defs": {
"filter": [{
"id": "shadow",
"width": "200%",
"height": "200%",
"feOffset": {
"result": "offOut",
"in": "SourceAlpha",
"dx": 0,
"dy": 0
},
"feGaussianBlur": {
"result": "blurOut",
"in": "offOut",
"stdDeviation": 5
},
"feBlend": {
"in": "SourceGraphic",
"in2": "blurOut",
"mode": "normal"
}
}]
},
"dataProvider": [{
"country": "Lithuania",
"litres": 501.9
}, {
"country": "Czech Republic",
"litres": 301.9
}, {
"country": "Ireland",
"litres": 201.1
}, {
"country": "Germany",
"litres": 165.8
}, {
"country": "Australia",
"litres": 139.9
}, {
"country": "Austria",
"litres": 128.3
}, {
"country": "UK",
"litres": 99
}, {
"country": "Belgium",
"litres": 60
}, {
"country": "The Netherlands",
"litres": 50
}],
"valueField": "litres",
"titleField": "country",
"export": {
"enabled": true
}
});
chart.addListener("init", handleInit);
chart.addListener("rollOverSlice", function(e) {
handleRollOver(e);
});
function handleInit() {
chart.legend.addListener("rollOverItem", handleRollOver);
}
function handleRollOver(e) {
var wedge = e.dataItem.wedge.node;
wedge.parentNode.appendChild(wedge);
}
body, html {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
height: 100%;
width: 100%;
}
#chartdiv {
width: 100%;
height: 100%;
font-size: 11px;
}
.amcharts-pie-slice {
transform: scale(1);
transform-origin: 50% 50%;
transition-duration: 0.3s;
transition: all .3s ease-out;
-webkit-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
cursor: pointer;
box-shadow: 0 0 30px 0 #000;
}
.amcharts-pie-slice:hover {
transform: scale(1.1);
filter: url(#shadow);
}
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<div id="chartdiv"></div>

Related

Mapbox GL JS animating multiple points along separate paths, duration not consistent

I want to animate multiple points along predetermined paths on a Mapbox map. I have found this example on the Mapbox website. It animates only one point along one line: https://docs.mapbox.com/mapbox-gl-js/example/animate-point-along-route/
I also found this example here on stackoverflow: Animate multiple point along routes using Mapbox-GL.JS
With the second example (multiple points with multiple lines), I started experimenting, adding my own coordinates for routes and points. My issue is that although I can see all points "moving" along their designated paths, only the first one behaves as expected, the other two only jumps from the first coordinate to the second. I'd like all three points to behave as the first one, moving smoothly along an arc.
I include the full code below.
https://jsfiddle.net/szabokrissz96/dfxy0gcu/1/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Animate a point along a route</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link href="https://api.mapbox.com/mapbox-gl-js/v2.12.0/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v2.12.0/mapbox-gl.js"></script>
<style>
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
</style>
</head>
<body>
<style>
.overlay {
position: absolute;
top: 10px;
left: 10px;
}
.overlay button {
font: 600 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
background-color: #3386c0;
color: #fff;
display: inline-block;
margin: 0;
padding: 10px 20px;
border: none;
cursor: pointer;
border-radius: 3px;
}
.overlay button:hover {
background-color: #4ea0da;
}
</style>
<script src="https://unpkg.com/#turf/turf#6/turf.min.js"></script>
<div id="map"></div>
<div class="overlay">
<button id="replay">Replay</button>
</div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoiYXRsbyIsImEiOiJjam5mdDVldmkwbTJ6M3BwNW13ZXhuYXM4In0.gikvkhPkud0GJy1FxG6-Zg';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v9',
center: [118.0148634, -2.548926],
zoom: 1
});
var route = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[-24.716854,48.197951],[64.228455,17.102469]
]
}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[-17.861384,-18.016869],[56.845644,-22.305867]
]
}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[118.017516,30.565573],[11.669865,29.347228]
]
}
}
]
};
// A single point that animates along the route.
// Coordinates are initially set to origin.
var point = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-24.716854,48.197951]
}
},{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-17.861384,-18.016869]
}
},{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [118.017516,30.565573]
}
}
]
};
// Calculate the distance in kilometers between route start/end point.
for(i=0;i<2;i++) {
var lineDistance = turf.lineDistance(route.features[0], 'kilometers');
}
var arc = [];
// Number of steps to use in the arc and animation, more steps means
// a smoother arc and animation, but too many steps will result in a
// low frame rate
var steps = 500;
// Draw an arc between the `origin` & `destination` of the two points
for (var i = 0; i < lineDistance; i += lineDistance / steps) {
var segment = turf.along(route.features[0], i, 'kilometers');
arc.push(segment.geometry.coordinates);
}
// Update the route with calculated arc coordinates
route.features[0].geometry.coordinates = arc;
// Used to increment the value of the point measurement against the route.
var counter = 0;
map.on('load', function () {
// Add a source and layer displaying a point which will be animated in a circle.
map.addSource('route', {
"type": "geojson",
"data": route
});
map.addSource('point', {
"type": "geojson",
"data": point
});
map.addLayer({
"id": "route",
"source": "route",
"type": "line",
"paint": {
"line-width": 1,
"line-color": "#007cbf"
}
});
map.addLayer({
"id": "point",
"source": "point",
"type": "symbol",
"layout": {
"icon-image": "airport-15",
"icon-rotate": ["get", "bearing"],
"icon-rotation-alignment": "map",
"icon-allow-overlap": true,
"icon-ignore-placement": true
}
});
function animate(featureIdx, cntr) {
// Update point geometry to a new position based on counter denoting
// the index to access the arc.
if (cntr >= route.features[featureIdx].geometry.coordinates.length){
return;
}
point.features[featureIdx].geometry.coordinates = route.features[featureIdx].geometry.coordinates[cntr];
point.features[featureIdx].properties.bearing = turf.bearing(
turf.point(route.features[featureIdx].geometry.coordinates[cntr >= steps ? cntr - 1 : cntr]),
turf.point(route.features[featureIdx].geometry.coordinates[cntr >= steps ? cntr : cntr + 1])
);
// Update the source with this new data.
map.getSource('point').setData(point);
// Request the next frame of animation so long the end has not been reached.
if (cntr < steps) {
requestAnimationFrame(function(){animate(featureIdx, cntr+1);});
}
}
document.getElementById('replay').addEventListener('click', function() {
// Set the coordinates of the original point back to origin
point.features[0].geometry.coordinates = origin;
// Update the source layer
map.getSource('point').setData(point);
// Reset the counter
cntr = 0;
// Restart the animation.
animate(0,cntr);
animate(1,cntr);
animate(2,cntr)
});
// Start the animation.
animate(0, 0);
animate(1, 0);
animate(2, 0);
});
</script>
</body>
</html>

vuetable-2 - How to fetch data into table in laravel/vuejs usig API

I am trying implementing vuetable-2 in laravel/ vuejs but I don't know how to pass data to the table from api , in sample table we do it like below.
Any help please
methods: {loadBooks() { axios.get("api/Book").then(({ data }) =>
(this.Books = data)); }
mounted() { this.loadBooks(); },
> <tr v-for="Book in Books.data" v-bind:key="Book.id"> <td>{{ Book.name
> }}</td></tr>
here the full code of Book.vue
<template>
<div id="app">
<filter-bar></filter-bar>
<vuetable
ref="vuetable"
api-url="http://vuetable.ratiw.net/api/users"
:fields="fields"
pagination-path=""
:css="css.table"
:sort-order="sortOrder"
:multi-sort="true"
detail-row-component="my-detail-row"
:append-params="moreParams"
#vuetable:cell-clicked="onCellClicked"
#vuetable:pagination-data="onPaginationData"
></vuetable>
<div class="vuetable-pagination">
<vuetable-pagination-info
ref="paginationInfo"
info-class="pagination-info"
></vuetable-pagination-info>
<vuetable-pagination
ref="pagination"
:css="css.pagination"
#vuetable-pagination:change-page="onChangePage"
></vuetable-pagination>
</div>
</div>
</template>
<script>
import accounting from "accounting";
import moment from "moment";
import Vuetable from "vuetable-2/src/components/Vuetable";
import VuetablePagination from "vuetable-2/src/components/VuetablePagination";
import VuetablePaginationInfo from "vuetable-2/src/components/VuetablePaginationInfo";
import Vue from "vue";
import VueEvents from "vue-events";
import CustomActions from "./CustomActions";
import DetailRow from "./DetailRow";
import FilterBar from "./FilterBar";
Vue.use(VueEvents);
Vue.component("custom-actions", CustomActions);
Vue.component("my-detail-row", DetailRow);
Vue.component("filter-bar", FilterBar);
export default {
components: {
Vuetable,
VuetablePagination,
VuetablePaginationInfo
},
data() {
return {
Books: {},
getAllBook: {},
fields: [
{
name: "__sequence",
title: "#",
titleClass: "text-right",
dataClass: "text-right"
},
{
name: "__checkbox",
titleClass: "text-center",
dataClass: "text-center"
},
{
name: "نوم",
sortField: "نوم"
},
{
name: "ایمل",
sortField: "ایمل"
},
{
name: "birthdate",
sortField: "birthdate",
titleClass: "text-center",
dataClass: "text-center",
callback: "formatDate|DD-MM-YYYY"
},
{
name: "nickname",
sortField: "nickname",
callback: "allcap"
},
{
name: "gender",
sortField: "gender",
titleClass: "text-center",
dataClass: "text-center",
callback: "genderLabel"
},
{
name: "salary",
sortField: "salary",
titleClass: "text-center",
dataClass: "text-right",
callback: "formatNumber"
},
{
name: "__component:custom-actions",
title: "Actions",
titleClass: "text-center",
dataClass: "text-center"
}
],
data: [
{
id: 1,
name: "xxxxxxxxx",
nickname: "xxxxxxx",
email: "xxx#xxx.xxx",
birthdate: "xxxx-xx-xx",
gender: "X",
group_id: 1
},
{
id: 50,
name: "xxxxxxxxx",
nickname: "xxxxxxx",
email: "xxx#xxx.xxx",
birthdate: "xxxx-xx-xx",
gender: "X",
group_id: 3
}
],
css: {
table: {
tableClass:
"table table-bordered table-striped table-hover",
ascendingIcon: "glyphicon glyphicon-chevron-up",
descendingIcon: "glyphicon glyphicon-chevron-down"
},
pagination: {
wrapperClass: "pagination",
activeClass: "active",
disabledClass: "disabled",
pageClass: "page",
linkClass: "link",
icons: {
first: "",
prev: "",
next: "",
last: ""
}
},
icons: {
first: "glyphicon glyphicon-step-backward",
prev: "glyphicon glyphicon-chevron-left",
next: "glyphicon glyphicon-chevron-right",
last: "glyphicon glyphicon-step-forward"
}
},
sortOrder: [
{ field: "email", sortField: "email", direction: "asc" }
],
moreParams: {}
};
},
methods: {
loadBooks() {
axios.get("api/Book").then(({ data }) => (this.Books = data));
axios
.get("api/getAllBook")
.then(({ data }) => (this.getAllBook = data));
},
allcap(value) {
return value.toUpperCase();
},
genderLabel(value) {
return value === "M"
? '<span class="label label-success"><i class="glyphicon glyphicon-star"></i> Male</span>'
: '<span class="label label-danger"><i class="glyphicon glyphicon-heart"></i> Female</span>';
},
formatNumber(value) {
return accounting.formatNumber(value, 2);
},
formatDate(value, fmt = "D MMM YYYY") {
return value == null ? "" : moment(value, "YYYY-MM-DD").format(fmt);
},
onPaginationData(paginationData) {
this.$refs.pagination.setPaginationData(paginationData);
this.$refs.paginationInfo.setPaginationData(paginationData);
},
onChangePage(page) {
this.$refs.vuetable.changePage(page);
},
onCellClicked(data, field, event) {
console.log("cellClicked: ", field.name);
this.$refs.vuetable.toggleDetailRow(data.id);
}
},
events: {
"filter-set"(filterText) {
this.moreParams = {
filter: filterText
};
Vue.nextTick(() => this.$refs.vuetable.refresh());
},
"filter-reset"() {
this.moreParams = {};
Vue.nextTick(() => this.$refs.vuetable.refresh());
}
},
mounted() {
this.loadBooks();
},
created() {
this.loadBooks();
}
};
</script>
<style>
.pagination {
margin: 0;
float: right;
}
.pagination a.page {
border: 1px solid lightgray;
border-radius: 3px;
padding: 5px 10px;
margin-right: 2px;
}
.pagination a.page.active {
color: white;
background-color: #337ab7;
border: 1px solid lightgray;
border-radius: 3px;
padding: 5px 10px;
margin-right: 2px;
}
.pagination a.btn-nav {
border: 1px solid lightgray;
border-radius: 3px;
padding: 5px 7px;
margin-right: 2px;
}
.pagination a.btn-nav.disabled {
color: lightgray;
border: 1px solid lightgray;
border-radius: 3px;
padding: 5px 7px;
margin-right: 2px;
cursor: not-allowed;
}
.pagination-info {
float: left;
}
</style>

How to change path fill color for Kendo bar / line chart?

Click here for demo - https://dojo.telerik.com/#rikinshah/EQiMupoG
I have lots of elements for navigation in headers and icon buttons in footer. all of them are using svg > path elements.
I want to change color for all path elements except Kendo Chart which also contains path elements.
In css I use this to make all to use same color :
path {
fill: #4b4c4c
}
but this also changes color for Kendo chart background.
I tried using :not selector for div ID to fill path for kendo and also tried
chartArea: {
background: "#4b4c4c",
},
path: {
fill: "#4b4c4c"},
fill: {
color: "4b4c4c"}
none of this changes path for svg element in kendo graph.
<div id="kendoChart" class="demo-section k-content wide" style="margin-left: -3px;">
<div id="chart"></div>
</div>
function createChart() {
$("#chart").kendoChart({
theme: "flat",
chartArea: {
background: "transparent",
},
legendItemClick: function (e) {
e.preventDefault();
},
seriesDefaults: {
type: "column",
width: 90,
gap: 1,
},
legend: {
position: "bottom",
spacing: 15,
labels: {
font: "12px sans-serif",
color: "#7F7F7F"
},
},
series: [{
data: [parseFloat(($('#room-revenue1').text()).replace(/,/g, "")),
parseFloat(($('#room-revenue2').text()).replace(/,/g, "")),
parseFloat(($('#room-revenue3').text()).replace(/,/g, "")),
parseFloat(($('#room-revenue4').text()).replace(/,/g, "")),
parseFloat(($('#room-revenue5').text()).replace(/,/g, "")),
parseFloat(($('#room-revenue6').text()).replace(/,/g, "")),
parseFloat(($('#room-revenue7').text()).replace(/,/g, "")), ],
name: "Room Revenue",
color: "#4472c3",
width: 500,
tooltip: {
visible: true,
template: "#= series.name #: #= kendo.format('{0:C2}',value) #",
font: "12px sans-serif",
},
}, {
type: "line",
data: [$('#rooms-sold1').text(),
$('#rooms-sold2').text(),
$('#rooms-sold3').text(),
$('#rooms-sold4').text(),
$('#rooms-sold5').text(),
$('#rooms-sold6').text(),
$('#rooms-sold7').text()],
name: "Room Sold",
color: "#12ccbe",
axis: "Rooms Sold",
width: 2,
markers: { visible: true },
tooltip: {
visible: true,
template: "#= series.name #: #= value #",
font: "12px sans-serif",
},
}],
render: function (e) {
var el = e.sender.element;
el.find("text:contains(Room Revenue)")
.parent()
.prev("path")
.attr("stroke-width", 3);
el.find("text:contains(Room Sold)")
.parent()
.prev("path")
.attr("stroke-width", 0);
},
valueAxes: [
{
visible: false,
majorGridLines: {
visible: true,
width: 0.5,
dashType: "solid",
color: "#ededed"
}
},
{
name: "Rooms Sold",
color: "#4e4141",
visible: false,
line: { visible: false },
majorGridLines: {
visible: false
},
}],
categoryAxis: {
categories: [($('#date1').text()).substring(0, 3),
($('#date2').text()).substring(0, 3),
($('#date3').text()).substring(0, 3),
($('#date4').text()).substring(0, 3),
($('#date5').text()).substring(0, 3),
($('#date6').text()).substring(0, 3),
($('#date7').text()).substring(0, 3)],
labels: {
font: "12px sans-serif",
color: "#7F7F7F"
},
majorGridLines: {
visible: false,
},
},
});
}
$(document).ready(createChart);
$(document).bind("kendo:skinChange", createChart(), 400);
I want to keep kendo chart background color / path fill color unchanged.

Can't seem to get anything to happen in D3.js. How do I debug?

I am just starting out with D3. I have looked at the tutorials and now I am trying one my own. Trying to get some coloured div tags based on my data structure. Nothing at all happens and I need some help in how to debug this:
HTML:
<div class="chart"></div>
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
CSS:
.chart div {
font: 10px sans-serif;
background-color: white;
text-align: right;
padding: 3px;
margin: 1px;
color: gray;
width: 15px;
height: 15px;
}
JavaScript:
var threshold = 0.5
var data = []
data[0] = JSON.parse('{ "smiles": "CCCCC=O", "prediction": [ { "pValue": 0, "label": "bar" }, { "pValue": 0.7, "label": "foo" } ] }')
data[1] = JSON.parse('{ "smiles": "CCCCC=O", "prediction": [ { "pValue": 0.3, "label": "bar" }, { "pValue": 0.6, "label": "foo" } ] }')
data[2] = JSON.parse('{ "smiles": "CCCCC=O", "prediction": [ { "pValue": 0.4, "label": "bar" }, { "pValue": 0.4, "label": "foo" } ] }')
data[3] = JSON.parse('{ "smiles": "CCCCC=O", "prediction": [ { "pValue": 0.5, "label": "bar" }, { "pValue": 0.3, "label": "foo" } ] }')
data[4] = JSON.parse('{ "smiles": "CCCCC=O", "prediction": [ { "pValue": 0.6, "label": "bar" }, { "pValue": 0.2, "label": "foo" } ] }')
d3.select(".chart")
.selectAll("div")
.data(data)
.enter().append("div")
.style("background-color", function(d) {
if (d['prediction'][0]['pValue'] > threshold &&
d['prediction'][1]['pValue'] > threshold) {
"green"
}
if (d['prediction'][0]['pValue'] > threshold ) {
"blue"
}
if (d['prediction'][1]['pValue'] > threshold ) {
"yellow"
}
})
JSFiddle
In your function to colour the divs you don't have any returns. Fiddle. I added return color in your if statement and it works now!
if (d['prediction'][0]['pValue'] > threshold &&
d['prediction'][1]['pValue'] > threshold) {
return "green"
}
if (d['prediction'][0]['pValue'] > threshold ) {
return "blue"
}
if (d['prediction'][1]['pValue'] > threshold ) {
return "yellow"
}

set bar width- kendo bar chart using gap and spacing?

I need some help to set the width of the bars in kendo bar charts when the number of bars reduces.
Here is the jsFiddle link i am working on: http://jsfiddle.net/An59E/44/
In this example, there are 2 kendo bar charts, 1 has 6 bars and the other has 12 bars.
In the second graph the bars width is fine. Now when i remove 2 bars i need the same width of bars, instead the default behavior of the kendo is to resize bars. by setting the spacing and the gap values, the bars should resize. In this example, i have set the spacing and gaps value in series defaults attribute but it doesn't look like its working. Now the question is , how to change the width of the bars?
HMTL code:
<div id="chart1">
</div>
<div id="chart2">
</div>
JS code:
var series1= [70, 60, 40];
var series2= [-50, 40, 20];
var series3= [60, 60, -90, 60, 10, 50];
var series4= [60, 20, 20, 50, 40, 10];
$("#chart1").kendoChart({
seriesDefaults:
{
type: "column",
stack: true,
width:2,
gap: 50,
},
series:
[
{
data: series1,
color: "#00CC00",
negativeColor: "#CC0000",
spacing: 0
},
{
data: series2,
color: "#CCCCCC"
}
],
plotArea:
{
border:
{
color: "#CCCCCC",
width: 1
}
},
chartArea:
{
border:
{
color: "#CCCCCC",
width: 1
},
height: 300
},
categoryAxis:
{
pane: "top-pane",
color: "#0099FF",
majorGridLines:
{
visible: true,
},
line:
{
width: 3,
},
plotBands:
[
{from: 0, to:1, color: "#CCCCCC"},
],
},
seriesDefaults:
{
type: "column",
labels:
{
visible: true,
color: "green"
},
},
valueAxis:
{
title:
{
text: "A"
},
majorGridLines:
{
visible: false
},
labels:
{
visible: false,
},
line:
{
visible: false
}
},
tooltip: {
visible: true,
/*format: "{0}"*/
template: "Institutional Results:#=value#<br/>Institutional Target:#=value#<br/>"
}
});
$("#chart2").kendoChart({
series:
[
{
data: series3,
color: "#00CC00",
negativeColor: "#CC0000",
spacing: 0
},
{
data: series4,
color: "#CCCCCC"
}
],
plotArea:
{
border:
{
color: "#CCCCCC",
width: 1
}
},
chartArea:
{
border:
{
color: "#CCCCCC",
width: 1
},
height: 300,
},
categoryAxis:
{
pane: "top-pane",
color: "#0099FF",
majorGridLines:
{
visible: true,
},
line:
{
width: 3,
},
plotBands:
[
{from: 0, to:1, color: "#333333"},
],
/*categories: [2005, 2006, 2007, 2008, 2009, 2010],
labels:
{
margin:
{
top: 100,
}
},*/
},
seriesDefaults:
{
type: "column",
labels:
{
visible: true,
color: "green"
},
},
valueAxis:
{
title:
{
text: "O"
},
majorGridLines:
{
visible: false
},
labels:
{
visible: false,
},
line:
{
visible: false
}
},
tooltip: {
visible: true,
/*format: "{0}"*/
template: "Institutional Results:#=value#<br/>Institutional Target:#=value#<br/>"
}
});
Thanks.
just replace below code snippet in javascript and you are done!
seriesDefaults:
{
type: "column",
labels:
{
visible: true,
color: "green"
},
gap: 5,
},
In above code I have added gap value to define gap of bars which leads to make them thin which you want.
Please refer to below js fiddle.
http://jsfiddle.net/An59E/134/
Please let me know if you face any difficulty to implement the same.

Resources