The problem is that if I draw something using a "public override void OnAfterPaint(NPanel panel, NPanelPaintEventArgs eventArgs)" from NPaintCallback the HitTest always returns a Axis as result.
This way I can't know what am I clicking on.
I already solved this using this code to calculate if the point is In or Out the polygon:
private static bool pointInPolygon(PointF point, List
polygon)
{
int polySides = polygon.Count;
float x = point.X;
float y = point.Y;
int i, j = polySides - 1;
bool oddNodes = false;
for (i = 0; i < polySides; i++)
{
if ((polygon[i].Y < y && polygon[j].Y >= y || polygon[j].Y < y && polygon[i].Y >= y) && (polygon[i].X <= x || polygon[j].X <= x))
{
if (polygon[i].X + (y - polygon[i].Y) / (polygon[j].Y - polygon[i].Y) * (polygon[j].X - polygon[i].X) < x)
{
oddNodes = !oddNodes;
}
}
j = i;
}
return oddNodes;
}
The problem I'm having now is how to make the chart data appear over the OnAfterPaint drawn polygon...