arrow head on axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
serge wautier
Newbie
Newbie
Posts: 22
Joined: Tue Dec 16, 2008 12:00 am

arrow head on axis

Post by serge wautier » Tue Feb 02, 2010 4:42 pm

version: 3.5.3425.20245

Hi All,

My chart displays a tower series that looks like this.
A rotation tool is used to allow user other view angles.
The problem is that once the chart has been rotated, user is a bit-disoriented.

To fix this, I'd like to draw an axis with an arrowhead, like this. If this is not possible or too complicated, this could be considered ok.

I played with the feature demo and managed to have an axis without ticks and labels, moved using the Z parameter. But I haven't found a way to create the arrowhead at the end of the axis.

Also, as a bonus ;-), how could I replace the circle created using the data points in white by a real nicer circle such as this? Ideally, the circle should behave as the white data points: It's on Z=0 and parts of it should therefore be hidden behind the tower according to perspective laws.

Please help.

TIA,
Serge Wautier.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: arrow head on axis

Post by Sandra » Wed Feb 03, 2010 11:35 am

Hello serge wautier,
To fix this, I'd like to draw an axis with an arrowhead, like this. If this is not possible or too complicated, this could be considered ok.
You could use Tool AxisArrows, You can find an example of use to Demo AllFeatures\Welcome !\Tools\Axis Arrows.
Also, as a bonus ;-), how could I replace the circle created using the data points in white by a real nicer circle such as this? Ideally, the circle should behave as the white data points: It's on Z=0 and parts of it should therefore be hidden behind the tower according to perspective laws
.

I suggest that try, using Events BeforeDraw or BeforeDrawSeries , draw directly a shape in canvas you can examples in Demos AllFeatures\Welcome !\Canvas, and change shape.Style= ellipse or circle.

If trying the above suggestions does not behave as you'd like, please tell us exactly what do you want, because we could help you.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

serge wautier
Newbie
Newbie
Posts: 22
Joined: Tue Dec 16, 2008 12:00 am

Re: arrow head on axis

Post by serge wautier » Fri Feb 05, 2010 11:00 am

Sandra,

Thanks for your reply. I hadn't seen the Axis tab in the tools section ;-)

The AxisArrow tool is what I need but it doesn't seem flexible enough in my case :-( :
- It's drawn on a vertical plan. I need it drawn on the horizontal plan (bottom axis).
- It doesn't follow the ZPosition setting of its axis. I need the bottom axis and arrow drawn for Y=0 with Y values ranging from -max to max.

Here's a screenshot of a typical chart with axis correctly positionned (tChart1.Axes.Bottom.ZPosition = 50). You can see the arrow head remains at ZPosition 0. Also when you rotate the chart (there's a rotate tool), you can see that the arrow head is not very visible due to being drawn in a vertical plan instead of horizontal plan.

FWIW, here's my sample VS2008 project source code (and compiled debug version)

Can you help? It would be great because this axisarrow tool is what I need.

TIA,

Serge.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: arrow head on axis

Post by Yeray » Fri Feb 05, 2010 3:12 pm

Hi Serge,

I'm afraid that this is not possible right now. I'll add this to the wish list to be considered for inclusion in future releases (TF02014665).

In the meanwhile, I think you should be able to do it manually. Here is a starting point that shows how you could draw your arrow:

Code: Select all

    Steema.TeeChart.Drawing.Point3D[] arrow = new Steema.TeeChart.Drawing.Point3D[7];      

    void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
    {
        ArrowRecalc();

        tChart1.Graphics3D.Brush.Color = Color.Green;
        tChart1.Graphics3D.Polygon(arrow);        
    }

    private void ArrowRecalc()
    {
        int arrowWidth = 30;
        int arrowLength = 20;
        int arrowHeadLength = 10;

        arrow[0].X = tChart1.Axes.Bottom.IEndPos;
        arrow[0].Y = tChart1.Axes.Bottom.Position;
        arrow[0].Z = (int)((tChart1.Axes.Depth.IEndPos * tChart1.Axes.Bottom.ZPosition / 100) + (arrowWidth / 4));

        arrow[1].X = arrow[0].X + (arrowLength - arrowHeadLength);
        arrow[1].Y = arrow[0].Y;
        arrow[1].Z = arrow[0].Z;

        arrow[2].X = arrow[1].X;
        arrow[2].Y = arrow[1].Y;
        arrow[2].Z = arrow[1].Z + (arrowWidth / 4);

        arrow[3].X = arrow[2].X + arrowHeadLength;
        arrow[3].Y = arrow[2].Y;
        arrow[3].Z = arrow[2].Z - (arrowWidth / 2);

        arrow[4].X = arrow[3].X - arrowHeadLength;
        arrow[4].Y = arrow[3].Y;
        arrow[4].Z = arrow[3].Z - (arrowWidth / 2);

        arrow[5].X = arrow[4].X;
        arrow[5].Y = arrow[4].Y;
        arrow[5].Z = arrow[4].Z + (arrowWidth / 4);

        arrow[6].X = arrow[5].X - (arrowLength - arrowHeadLength);
        arrow[6].Y = arrow[5].Y;
        arrow[6].Z = arrow[5].Z;
    }
Once you have your arrow drawn you need to check if the mouse is over this area at OnMouseClick or OnMouseDown events and call SetMinMax to move your chart.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply