Using line series as annotation

Sep 19, 2013 at 11:19 AM
Hello,

I would like to use annotations in the same way as the scatter example with least square fit, but with a polynomial fit.

I thought that I could use the "Equation" of the LineAnnotation, but the equation is too complex to define as I'm doing a graph that does a 2D representation of a 3D graph.

Is there a way to define the LineAnnotation with points, as we would do for the LineSeries?
Is there another way I could do that?

A "hack" that I tought would be to simply create LineSeries for my fit, but then when I click on the line I get the value of the fit, which I don't want. Can we remove the popup that displays when we click on the line?
Coordinator
Sep 20, 2013 at 8:05 AM
The LineAnnotation is intended for straight lines.
I think a PolylineAnnotation should be created for polylines, and the implementation should be much easier than the LineAnnotation :)
Sep 20, 2013 at 10:19 AM
You say that the line annotation is intended for straight lines, but I can easily do this:
LineAnnotation lineAnnotation = new LineAnnotation()
{
       Equation = (double x) => { return Math.Sin(x); },
       Type = LineAnnotationType.EquationY
};
And it gives me a nice sinusoid, doesn't seem to be any issue with displaying curves and the like.

I'll give a try at creating a PolylineAnnotation, will give me an excuse to dive into the code as I will probably have reason to do some changes for my needs in the future :).

Otherwise, is there a way to remove the popup that gives the value when we click for some specific series?

Thanks for your answer!
Coordinator
Sep 20, 2013 at 10:27 AM
Right, I forgot that :)
I think that feature should be removed from the LineAnnotation, and suggest to create a subclass FunctionAnnotation!