To add a stacked 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-stacked="true" data-ex-values=".confirmed, .suspected, .probable" data-ex-grouped-by=".countries"> </div>
Replace .confirmed, .suspected, .probable, and .countries 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 | |
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 | |
stackLabel | text | y | Label for each stack separated by commas; shown in the legend | |
barWidth | float | 0.8 | Width of each bar | |
tickNum | int | Number of ticks along the axis | ||
xAxisMin | float | Minimum value on axis | ||
xAxisMax | float | Maximum value on axis |