Page 1 of 1

Can an ImagePoint series plot X as a value and Y as pixel?

Posted: Tue Jun 07, 2011 6:35 am
by 8751509
Greetings,

I have a Chart on which I would like to plot an ImagePoint series to denote special actions that occur on special dates, however I'd like the complete series to be drawn on the bottom of my chart, now heres the problem my chart is stock prices and my Chart autoscales the Y axis maximum and minimums so the price data always fill up the chart space.

This means that the Y scale is always changing and so plotting the price as Y will make my ImagePoint series 'jump' up and down as I scroll left or right on the chart.

Now I noticed there is an ImagePoint.add(pointf) overload that says in the text description it accepts pixel positions .. but it doesnt really, it still treats the Y as a Price which explains why it takes floats.
public Int32 Add(System.Drawing.PointF)
Adds the pair of floating point x- and y-pixel coordinates
I know that in the TeeChart source code there is much conversion from Y value to pixel position and vice versa so maybe there is a way in the front end .. never know till you ask eh ...

Can I somehow plot my Y as pixels ??? or is there any other technique for 'fixing' the Y values in such a way that it stays put where I want it on the screen . in my case close to the bottom of the chart.

Re: Can an ImagePoint series plot X as a value and Y as pixel?

Posted: Tue Jun 07, 2011 9:09 am
by 10050769
Hello Phil,

I recommend use methods of CalcXPosValue, CalcYPosValue, CalcPosValue, to convert your values of series to pixels -screen co-ordinates- and besides to achieve to fix position of values of PointsImage you need calculate the position using methods I have proposed previously, in AfterDraw Event. If it doesn't help you please try to explain step to step how you want exactly.

Thanks,

Re: Can an ImagePoint series plot X as a value and Y as pixel?

Posted: Fri Jun 10, 2011 7:03 am
by 8751509
Bah humbug my post went missing .... ok reposting.

If I wanted to add a new series type and overload the add() method to be able to plot using x as index and Y as pixel coords .. aproximetely where in the source code should I look. What steema classess should I be focusing on.

I ask because I have added many tools successfully and they run like a dream compared to when I built them in the front end code ... if I can add some other series styles in a similiar fashion that would be ideal.
Last time I I asked the same question and you pointed me to the tools and told me all I need to do was inherit from the tool class and away I went with a bunch of my custom classes that I just drop into each new maintenance release .. hopefully the same could be done again ...

:-D

Re: Can an ImagePoint series plot X as a value and Y as pixel?

Posted: Tue Jun 14, 2011 4:00 pm
by 10050769
Hello Phil,

Sorry to delay. You have two ways implement your Add method::

1.- With Source code: If you have a source code only you have added your overload method in Series.cs.

2.-Without Source code: If you doesn't have source code you have two options:
  • 2.1 Implement your custom series as do in next example where there are overload of Add methods, OnDraw method etc.
    http://www.teechart.net/support/viewtop ... gle#p25371
    2.2 Create your Add Method using parameters as you want and into method do actions you need and finally call standard Adds of TeeChart.
I think the best option for you if you don't work with source code is Implement your custom series.

I hope will helps.

Thanks,