Hello
My problem is with the FindObj class. It doesn't seem to take the rotation, of AxisTitle objects, into account. For example:
In my chart class (derived from ChartView)
private void InitializeChart()
{
CartesianCoordinates coord = new CartesianCoordinates(0, 0, 10, 10);
LinearAxis xAxis = new LinearAxis(coord, ChartObj.X_AXIS);
LinearAxis yAxis = new LinearAxis(coord, ChartObj.Y_AXIS);
NumericAxisLabels yAxisLabels = new NumericAxisLabels(yAxis);
Font font = new Font("Microsoft Sans Serif", 7);
AxisTitle yAxisTitle = new AxisTitle(yAxis, font, "AxisTitle");
SelectObj selectObj = new SelectObj(this);
xAxis.CalcAutoAxis();
yAxis.CalcAutoAxis();
AddChartObject(xAxis);
AddChartObject(yAxis);
AddChartObject(yAxisLabels);
AddChartObject(yAxisTitle);
SetCurrentMouseListener(new SelectObj(this));
}
The SelectObj class looks like this:
public class SelectObj : FindObj
{
public SelectObj(ExampleGraph component)
: base(component)
{
}
public override void OnMouseDown(MouseEventArgs mouseevent)
{
GraphObj currentObj;
this.SetClassToFind("AxisTitle");
base.OnMouseDown(mouseevent);
currentObj = this.GetSelectedObject();
if (currentObj != null)
((AxisTitle)currentObj).SetTextBoxMode(true);
else
((AxisTitle)currentObj).SetTextBoxMode(false);
this.GetChartObjComponent().UpdateDraw();
}
}
The FindObj class only seems to find the y axis title when clicking somewhere just below the middle (in the vertical direction) of the title (probably where the title would be withoout the rotation).
Can you please help me with this problem?
Thanks