KB-14836: Plotting functions in E3.

Question:

How can I plot the functions y=x+2; y=X^2; y=x^3 in an E3Chart?

Solution:

To do so, use Pen’s AddPoint method, via scripts, to add points to a chart.

Examples:

** To plot a Y = X + 2 chart **

Dim X
Dim Y
Dim aux

X = 1
Y = 1

Screen.Item(“E3Chart1”).Pens.Item(“Pen1”).Clear()
Screen.Item(“E3Chart1”).Pens.Item(“Pen1”).Connect()

For aux=1 to 10
X = X + 0.11
Y = X + 2
Screen.Item(“E3Chart1”).Pens.Item(“Pen1”).AddPoint X, Y
Next

Screen.Item(“E3Chart1”).FitAll([FitStyle])

** To plot a Y = X ^ 2 chart**

Dim X
Dim Y
Dim aux

X = -1
Y = 1

Screen.Item(“E3Chart1”).Pens.Item(“Pen1”).Clear()
Screen.Item(“E3Chart1”).Pens.Item(“Pen1”).Connect()

For aux=1 to 18
X = X + 0.11
Y = X ^ 2
Screen.Item(“E3Chart1”).Pens.Item(“Pen1”).AddPoint X, Y
Next

Screen.Item(“E3Chart1”).FitAll([FitStyle])

** To plot a Y = X ^ 3 chart **

Dim X
Dim Y
Dim aux

X = -1
Y = 1

Screen.Item(“E3Chart1”).Pens.Item(“Pen1”).Clear()
Screen.Item(“E3Chart1”).Pens.Item(“Pen1”).Connect()

For aux=1 to 18
X = X + 0.11
Y = X ^ 3
Screen.Item(“E3Chart1”).Pens.Item(“Pen1”).AddPoint X, Y
Next

Screen.Item(“E3Chart1”).FitAll([FitStyle])

NOTE: Attached to this article is a demo application developed with Elipse E3 version 3.1 build 270.

Attachments:

Sample.zip

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *