Make a Bar Chart with WAPlot

Make a bar chart using Mathematica® syntax.
Bar chart with four bars. Bar z has value 415 and is labeled Tiffany in the legend; Bar y has value 500 and is labeled Janelle in the legend; Bar x has value 230 and is labeled Derek in the legend, Bar w has value 145 and is labeled Natalie in the legend.

  1. Click Questions > Create.
    The Question Editor opens.
  2. In Name, type a name for the question.
  3. In Mode, select one of the question modes to define the basic behaviors for your question.
  4. In Question, type your question.

    Use the answer placeholder string <_> to specify where the answer box should be displayed.

  5. In Answer, specify the answer key for your question. Often, you will specify distractors or options configuring your question's behavior.
  6. Add WAPlot tags to the question, answer, or solution field of a question.
    If a WAPlot image is used in the answer field, the question mode must be multiple-choice, and there cannot be linebreaks in the WAPlot code. WAPlot images cannot be placed in assignment descriptions.
    <waplot type='MathematicaSyntax'> </waplot>
  7. Insert the Mathematica code for your function inside the WAPlot tags.
    More options are available on the Mathematica site. Because WebAssign uses version 7 of Mathematica, not everything on the Mathematica site is available for use in WebAssign.
    <waplot type='MathematicaSyntax'>
        BarChart[
            {145, 230, 500, 415},
            BarOrigin -> Left,
            BarSpacing -> 0.5, 
            ChartLabels -> Placed[{{"Natalie", "Derek", "Janelle", "Tiffany"}, {145, 230, 500, 415}}, {Before, After}]
        ]
    </waplot>
  8. In the <waplot> tag, use the @alt attribute to add alternative text describing the image for students using screen readers.
    <waplot type='MathematicaSyntax' alt='Bar chart with four bars. The bar labeled Tiffany has value 415; 
    the bar labeled Janelle has value 500; the bar labeled Derek has value 230, and the bar labeled Natalie has value 145.'>
    Make sure the content of the alternative text is appropriate to the pedagogy of your question.

Graphing a Bar Chart

The following table summarizes an actual question.

QID

3997159

Name

Template2 6.WAPLOT.09.

Mode

Multiple-Choice

Question

Four students participated in a fundraiser selling magazine subscriptions. Janelle sold the most subscriptions, and Natalie the fewest. Which of the following charts reflects this?
<table>
<tr><td><_></td><td><_></td></tr>
<tr><td><_></td><td><_></td></tr>
</table>

Answer

<eqn $SET_EACH_POSITION=1; ''><waplot type='MathematicaSyntax' alt='Bar chart with four bars. The bar labeled Tiffany has value 415; the bar labeled Janelle has value 500; the bar labeled Derek has value 230, and the bar labeled Natalie has value 145.'> BarChart[{145, 230, 500, 415}, BarOrigin -> Left,BarSpacing -> 0.5, ChartLabels -> Placed[{{"Natalie", "Derek", "Janelle", "Tiffany"}, {145, 230, 500, 415}}, {Before, After}]]</waplot>
<waplot type='MathematicaSyntax' alt='Bar chart with four bars. The bar labeled Tiffany has value 415; the bar labeled Janelle has value 500; the bar labeled Derek has value 180, and the bar labeled Natalie has value 300.'> BarChart[{300, 180, 500, 415}, BarOrigin -> Left,BarSpacing -> 0.5, ChartLabels -> Placed[{{"Natalie", "Derek", "Janelle", "Tiffany"}, {300, 180, 500, 415}}, {Before, After}]]</waplot>
<waplot type='MathematicaSyntax' alt='Bar chart with four bars. The bar labeled Tiffany has value 300; the bar labeled Janelle has value 140; the bar labeled Derek has value 230, and the bar labeled Natalie has value 500.'> BarChart[{500, 230, 140, 300}, BarOrigin -> Left,BarSpacing -> 0.5, ChartLabels -> Placed[{{"Natalie", "Derek", "Janelle", "Tiffany"}, {500, 230, 140, 300}}, {Before, After}]]</waplot>
<waplot type='MathematicaSyntax' alt='Bar chart with four bars. The bar labeled Tiffany has value 300; the bar labeled Janelle has value 250; the bar labeled Derek has value 450, and the bar labeled Natalie has value 250.'> BarChart[{250, 450, 250, 300}, BarOrigin -> Left,BarSpacing -> 0.5, ChartLabels -> Placed[{{"Natalie", "Derek", "Janelle", "Tiffany"}, {250, 450, 250, 300}}, {Before, After}]]</waplot>

Display to Students

Question as displayed to students