# Using a Code String to Define a Function

## Content



When an interpretive code string is used to define a function of a function class ([YFunctionSeries](/componentone/api/wpf/online-chart/dotnet-framework-api/C1.WPF.C1Chart.Extended.4.6.2/C1.WPF.C1Chart.Extended.YFunctionSeries.html) or [ParametricFunctionSeries](/componentone/api/wpf/online-chart/dotnet-framework-api/C1.WPF.C1Chart.Extended.4.6.2/C1.WPF.C1Chart.Extended.ParametricFunctionSeries.html)), the string is compiled and the resulting code is dynamically included into the application. Execution speed will be the same as any other compiled code.

For simple, one-variable explicit functions, the **YFunctionSeries** class object is used. This object has one code property, **FunctionCode**. For **YFunction** objects, the independent variable is always assumed to be "x".

For parametric functions, a pair of equations must be defined using the **ParametricFunctionSeries** class object. This object has two properties, one for each coordinate. The properties, **XFunctionCode** and **YFunctionCode** accept code in which the independent variable is always assumed to be "t".

## See Also

[Calculating the Value for Functions](/componentone/docs/wpf/online-chart/overview/ChartFeatures/PlottingFunctions/FUNC)