ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  chart director can draw overlay trend line,object like some stock program ?
Posted by k.yong on Jul-12-2014 02:48
Attachments:
I try to evaluate some chart for create stock software.  I interest chart director because it look good  chart and support but I want to know some specific topic

1. can I draw trend  line overlay like attach ?
    after draw line can I click point 2 point for change the value and redraw again
    please sample c# source code for winforms

2.can I draw circle(and other)  object overlay like the above and can move or scale and
  delete ?

3.can I retrieve the cross line,max,min of value ?

Thank you
2014-07-12_012129.png

  Re: chart director can draw overlay trend line,object like some stock program ?
Posted by Peter Kwan on Jul-14-2014 16:29
Hi k.yong,

ChartDirector allows you to do all you need with your own code. ChartDirector only
provides sufficient information and the necessary mouse events. You would need to use
your own code to achieve what you need.

For example, to use mouse drag to drawn a line, just remember to starting point of the
drag in the MouseDown event handler, and update the ending point of the drag in the
MouseMove event handler, and draw the line in the Paint event handler. (These are
standard .NET events.) I have just written a simple example for your reference. In total,
there are just 8 lines of code distributed in the 3 event handlers, so it should be easy to
understand.

http://www.advsofteng.com/dragtodrawline.zip

The above is just a simple example. You can modify it to fit your needs. For example, you
can change it to draw a circle instead of a line. For the line, you can draw two small
rectangles at the end points of the line. When the mouse is down, you can add code to
check if it is on the small rectangle, so that when the mouse moves, you can modify the
coordinates of that rectangle, etc..

I am not too sure what you refer to by the "cross line,max,min". In general, if the
"max,min" comes from your code (for example, you are referring to the max,min of your
data), then your code already have the data, and you can get the max,min without using
ChartDirector. If you are referring the the max,min of the y-axis (which can be auto-
scaled by ChartDirector), you can use Axis.getMinValue and Axis.getMaxValue.

Hope this can help.

Regards
Peter Kwan

  Re: chart director can draw overlay trend line,object like some stock program ?
Posted by k.yong on Jul-14-2014 22:14
Your code guild same to worked for me and other topics it good idea.

you support very well.

Thank you very much

k.yong

  Re: chart director can draw overlay trend line,object like some stock program ?
Posted by ravi on May-20-2015 16:41
Is there any sample for the above in PHP.

Thanks
ravi