Here you can find a WPF app with a click once deployment. I use Roslyn script engine to turn C# code into function that is being graphed on a canvas.

This is how a common output looks:

For example you can write something like:

x*x

OR

sin(x*PI)

OR something more complex like:

Continued...

This is a WPF control I just put on CodePlex that implements the basic functionality for a source code editor.

You define it in the XAML with something like this (of course after you put the assembly com.bodurov.WpfControls.SourceCodeEditor.dll in your bin folder):

Continued...