# datacurve element

Type: | Graphs
Attributes: | color • marker • name
See: | areagraph linegraph sample simplecurve

The datacurve element is used inside a linegraph or areagraph to group a collection of samples into a single curve. These graphs may contain one or more DATACURVES, each of which must contain at least one sample element. Note that a datacurve with only one sample won't be any use at all unless the marker attribute is set.
The name attribute is mandatory, and the color and marker attributes are optional.

This graph shows two curves, one DATACURVE and one SIMPLECURVE

    <linegraph width="300" height="300">
      <datacurve name="Actual Measurements" color="red" marker="circle only">
        <sample x="10" y="24.5"/>
        <sample x="11" y="32"/>
        <sample x="12" y="20.7"/>
      </datacurve>
      <simplecurve name="Projected Measurements" method="mypackage.GuessValues" color="blue"/>
    </linegraph>

This linegraph plots date values.

    <linegraph width="300" height="300" xaxis-formatter="date()">
      <datacurve name="Plotting dates" marker="circle">
        <sample x="2001-10-01" y="1"/>
        <sample x="2001-10-15" y="2"/>
        <sample x="2001-10-22" y="3"/>
      </datacurve>
    </linegraph>

This linegraph plots dates and times.

    <linegraph width="300" height="300" xaxis-formatter="date()">
      <datacurve name="Plotting times" marker="circle">
        <sample x="2001-10-01 12:00" y="1"/>
        <sample x="2001-10-01 13:00" y="2"/>
        <sample x="2001-10-01 14:00" y="3"/>
      </datacurve>
    </linegraph>