# simplecurve element

Type: | Graphs
Attributes: | color • method • name
See: | areagraph datacurve linegraph

The simplecurve element can be used inside a linegraph or areagraph element to plot a mathematical function.
The name attribute is mandatory - this is the name of the curve on the key.
The method attribute is mandatory, and must be set to the full name of a static Java method that takes a double and returns a double - for example, `java.lang.Math.sin`.
For more information see the API documentation for the Graph library.

This plots a Sine and Cosine curve. Note we have to set the "min-x" and "max-x" attributes.

    <linegraph width="100" height="100" min-x="-3.15" max-x="3.15">
      <simplecurve name="Sine" color=red method="java.lang.Math.sin"/>
      <simplecurve name="Cosine" color=green method="java.lang.Math.cos"/>
    </linegraph>