For Formula code types, the CodeText property of a function class must contain code that calculates the value of a function using a parameter. The code should fit into a single line and represents the right hand side of an equation.
Dim yf As C1.Win.C1Chart.YFunction = New C1.Win.C1Chart.YFunction()
yf.CodeType = C1.Win.C1Chart.FunctionCodeTypeEnum.Formula
yf.CodeLanguage = C1.Win.C1Chart.FunctionCodeLanguageEnum.VB
yf.CodeText = "x*x"
yf.MinX = -5
yf.MaxX = 5
yf.LineStyle.Color = Color.Red
yf.LineStyle.Thickness = 3
C1Chart1.ChartGroups(0).ChartData.FunctionsList.Add(yf)
· C#
C1.Win.C1Chart.YFunction yf = new C1.Win.C1Chart.YFunction();
yf.CodeType = C1.Win.C1Chart.FunctionCodeTypeEnum.Formula;
yf.CodeText = "x*x";
yf.MinX = -5;
yf.MaxX = 5;
yf.LineStyle.Color = Color.Red;
yf.LineStyle.Thickness = 3;
c1Chart1.ChartGroups[0].ChartData.FunctionsList.Add(yf);
· Delphi
var
yf: C1.Win.C1Chart.YFunction;
begin
yf := C1.Win.C1Chart.YFunction.Create;
yf.CodeType := C1.Win.C1Chart.FunctionCodeTypeEnum.Formula;
yf.CodeText := 'x*x';
yf.MinX := -5;
yf.MaxX := 5;
yf.LineStyle.Color := Color.Red;
yf.LineStyle.Thickness := 3;
C1Chart1.ChartGroups[0].ChartData.FunctionsList.Add(yf);
end;
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |