Bootstrap 3-based Bar Chart Plugin

Add-ons
2026-07-26 04:10 3 次浏览 • 0 次下载 4.2KB
Bootstrap 3-based Bar Chart Plugin

Usage

This jQuery bar chart plugin can be initialized using JavaScript or generated directly using HTML tags.

Initialize Using JavaScript

1
<div id="population_chart"></div>
1
2
3
4
5
6
7
$("#population_chart").jChart({
name: "North American Regional Population Loss 2014",
headers: ["Arizona","Michigan","Ontario","British Columbia","Texas"],
values: [250000,478000,88000,429000,423000],
footers: [100000,200000,300000,400000,500000],
colors: ["#1000ff","#006eff","#00b6ff","#00fff6","#00ff90"]
});

Generate Bar Charts Directly Using HTML Tags

In HTML tags, the name attribute specifies the chart title. Similar to Bootstrap labels, chart-sm or chart-lg specifies the chart size, data-width specifies the chart width, and data-sort controls sorting.

1
2
3
4
5
6
7
8
9
10
11
12
<div id="bar_of_pies" data-sort="true" data-width="300" name="My Favorite Pies">
<div data-color="red" >13</div>
<div data-color="gray" >24</div>
<div data-color="green" >17</div>
<div data-color="orange" >26</div>
<div data-color="black" >12</div>
<div data-color="blue" >8</div>
<div >10</div>
<div >20</div>
<div >30</div>
</div>

Configuration Parameters

ParametersDefault ValueDescription
width750Chart width in pixels
namenullChart title, displayed above the chart
type"bar""bar"Chart type. Currently, only bar charts are supported.
headersnull(No label)Bar chart labels, specified as a Javascript array
valuesnullNumeric values displayed for each bar on the left side of the chart, specified as a Javascript array
footersnullA set of numeric values displayed below the bar chart, specified as a Javascript array
colors#6b9bd6#6b9bd6 (dark blue)An array of colors
sortfalseWhether to enable sorting
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare