To add a bar chart to your exhibit, you must include the flotr extension for Exhibit (in addition to the Exhibit API):
<link rel="exhibit-extension" href="http://projects.csail.mit.edu/exhibit/api/extensions/flotr/flotr-extension.js"/>
To include a bar chart, add to your HTML
<data-ex-role="view" data-ex-view-class="BarChart" data-ex-values=".birthrate" data-ex-grouped-by=".deathrate"> </div>
Replace .birthrate and .deathrate with appropriate expressions.
Other settings include:
setting name | type of value | default | choices | meaning |
---|---|---|---|---|
plotHeight | int | 400 | Height of the plot in pixels | |
plotWidth | int | 600 | Width of the plot in pixels | |
color | text | #FF9000 | Any color in accepted html format | All the bars in the chart will be of this color in the absence of color coders |
colorCoder | text | null | id of a colorCoder | |
verticalChart | boolean | true | true, false | Orientation of bars; bars go horizontally in a vertical chart |
valueLabel | text | x | Label for the values | |
groupLabel | text | y | Label for each bar | |
barWidth | float | 0.8 | Width of each bar | |
axisType | enum | linear | linear, logarithmic, log | Scale for axis |
tickNum | int | Number of ticks along the axis | ||
xAxisMin | float | Minimum value on axis | ||
xAxisMax | float | Maximum value on axis | ||
lineChart | boolean | false | true, false |