Flotr2 Pie Chart

We are using the Flotr2 library to make a pie chart here.

To add a pie 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 pie chart, add to your HTML

 <data-ex-role="view" 
            data-ex-view-class="PieChart" 
            data-ex-values=".cases"
            data-ex-labels=".country">
         </div>
        

Replace .cases and .country 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 700 Width of the plot in pixels
explode int 6 Separation between the slices
group boolean false true, false All items less than the cutoff will be grouped into one slice
cutoff float 0.01 Cutoff used to group items into one slice