Fill Plot Style + Customized Legend

This example shows an interesting use of multiple "fill" style plots in the same graph. The "fill" renderer fills the region between the plotted data line and the horizontal axis with a single color. Multigraph draws each of the plots in the order in which they appear in the MUGL file, so later plots are drawn on top of earlier ones.

This graph uses the <legend> tag to explicitly center the legend along the top of the graph, and to customize its appearance. Note in particular the use of the "opacity" attribute to allow the data to be visible behind the legend.

Here is the MUGL for this example:

<?xml version="1.0"?>
<mugl>
  <window margin="2" border="2" padding="5"/>
  <plotarea marginleft="50"/>
  <legend position="0 0" base="0 1" anchor="0 1" rows="1" border="1" color="0xFFFFFF" bordercolor="0x000000" opacity="0.8">
  	<icon width="25" height="25" border="0"/>
  </legend>
  <horizontalaxis id="xaxis"
                  min="1950"
                  max="2008">
    <title>Year</title>
    <grid visible="true"/>
    <zoom anchor="1950"/>
    <pan min="1950"/>
  </horizontalaxis>
 
  <verticalaxis id="yaxis"
                position="0"
                min="0"
                max="18">
    <title position="-50 0" angle="90" anchor="0 1">Waste Recovery (per million tons)</title>
    <labels format="%.1f" start="1" spacing="50 20 10 5 2 1 0.5 0.05"/>
    <zoom anchor="0"/>
    <pan min="0" max="25"/>
  </verticalaxis>
 
  <plot>
    <legend label="Particulate"/>
    <horizontalaxis ref="xaxis"/>
    <verticalaxis ref="yaxis">
      <variable ref="particulate" />
    </verticalaxis>
    <renderer type="fill">
      <option name="linecolor" value="0x3090C7"/>
      <option name="fillcolor"  value="0x3090C7"/>
    </renderer>
  </plot>
 
  <plot>
    <legend label="Combustion"/>
    <horizontalaxis ref="xaxis"/>
    <verticalaxis ref="yaxis">
      <variable ref="combustion" />
    </verticalaxis>
    <renderer type="fill">
      <option name="linecolor" value="0xF76541"/>
      <option name="fillcolor"  value="0xF76541"/>
    </renderer>
  </plot>
 
  <plot>
    <legend label="Recycling"/>
    <horizontalaxis ref="xaxis"/>
    <verticalaxis ref="yaxis">
      <variable ref="recycling" />
    </verticalaxis>
    <renderer type="fill">
      <option name="linecolor" value="0xCCFB5D"/>
      <option name="fillcolor"  value="0xCCFB5D"/>
    </renderer>
  </plot>
 
  <plot>
    <legend label="Landfill"/>
    <horizontalaxis ref="xaxis"/>
    <verticalaxis ref="yaxis">
      <variable ref="landfill" />
    </verticalaxis>
    <renderer type="fill">
      <option name="linecolor" value="0xEDE275"/>
      <option name="fillcolor"  value="0xEDE275"/>
    </renderer>
  </plot>
 
  <data>
    <variables>
      <variable id="year" column="0" type="number"/>
      <variable id="landfill" column="1"/>
      <variable id="recycling" column="2"/>
      <variable id="combustion" column="3"/>
      <variable id="particulate" column="4"/>
    </variables>
    <values>
      1950,0.1,0.2, 0.4, 0.0
      1951, 0.1, 0.2, 0.4, 0.0
      1952, 0.1, 0.3, 0.5, 0.0
      1953, 0.1, 0.4, 0.5, 0.0
      1954, 0.1, 0.2, 0.5, 0.0
      1955, 0.2, 0.4, 0.5, 0.7
      1956, 0.3, 0.5, 0.6, 0.8
      1957, 0.3, 0.4, 0.6, 0.9
      1958, 0.3, 0.4, 0.6, 1.0
      1959, 0.4, 0.5, 0.6, 1.1
      1960, 0.4, 0.5, 0.6, 1.2
      1961, 0.5, 0.59, 0.6, 1.3
      1962, 0.5, 0.59, 0.6, 1.4
      1963, 0.6, 0.69, 0.7, 1.5
      1964, 0.8, 0.9, 1.0, 1.6
      1965, 0.9, 1.0, 1.1,1.7
      1966, 1.0, 1.1, 1.2,1.8
      1967, 1.2, 1.3, 1.4,2.1
      1968, 1.4, 1.5, 1.6, 2.4
      1969, 1.6, 1.7, 1.8, 2.5
      1970, 2.0, 2.1, 2.2, 1.2
      1971, 1.6, 1.7, 1.9, 1.1
      1972, 1.7, 2.5, 2.7, 1.0
      1973, 1.4, 1.9, 2.2, 1.0
      1974, 1.2, 2.4, 2.6, 1.0
      1975, 1.1, 2.6, 2.7,1.0
      1976, 1.2, 2.4, 2.7, 1.0
      1977, 1.4, 3.0, 3.2, 3.5
      1978, 1.6, 2.5, 3.1, 3.5
      1979, 1.9, 2.4, 2.6, 3.6
      1980, 2.0, 3.0, 3.1, 3.6
      1981, 3.4, 3.6, 3.7, 3.9
      1982, 4.0, 5.0, 5.2, 5.4
      1983, 4.6, 4.7, 5.1, 5.4
      1984, 4.8, 4.9, 5.2, 5.4
      1985, 5.2, 5.5, 5.7, 5.8
      1986, 5.1, 5.5, 6.1, 6.2
      1987, 6.0, 6.1, 6.2, 6.3
      1988, 6.5, 6.6, 6.7, 6.9
      1989, 6.6, 6.7, 6.9, 7.1
      1990, 6.8, 6.9, 8.2, 8.5
      1991, 6.9, 7.6, 8.3, 8.5
      1992, 7.0, 7.9, 8.4, 8.5
      1993, 7.5, 8.1, 9.5, 9.8
      1994, 7.4, 8.4, 9.5, 9.9
      1995, 7.3, 8.5, 9.6, 9.9
      1996, 7.2, 8.6, 9.9, 10.0
      1997, 7.1, 8.8, 9.9, 10.0
      1998, 8.0, 8.9, 10.0, 10.3
      1999, 8.2, 9.2, 10.3, 11.5
      2000, 7.4, 9.5, 10.4, 12.5
      2001, 6.3, 9.7, 10.8, 13.5
      2002, 5.5, 9.9, 11.2, 14.5
      2003, 4.5, 10.2,12.3, 14.9
      2004, 4.7, 11.2,12.6, 15.3
      2005, 4.3, 12.4,13.6, 15.9
      2006, 4.2, 12.7, 13.1, 16.3
      2008, 4.1, 13.2, 15.4, 17.5
    </values>
  </data>
</mugl>
Note: this web site is for the old, Flash-based, version of Multigraph. Starting in December 2012, there is a new JavaScript/HTML5 version of Multigraph, which is distributed from the site multigraph.github.io. Future projects should use the new JavaScript/HTML5 version of Multigraph rather than the Flash version described here.