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

Message ListMessage List     Post MessagePost Message

  How to show the value in Y axis like my post and how to using mouse change the height of MACD indicator?
Posted by poohwen on Jan-12-2019 19:53
Attachments:
1.I want to show the current value of Y axis if i use crosshair like my post?

2.In many stock application, we can adjust the height of each indicator using the mouse in the border of the indicator.

Can you show me the code how to do these?

Thanks for your help!
PIC1.png

  Re: How to show the value in Y axis like my post and how to using mouse change the height of MACD indicator?
Posted by Peter Kwan on Jan-15-2019 11:09
Hi poohwen,

You can modify the "CrossHair with Axis Labels" sample code and apply it to the FinanceChart. Basically, you code and iterate the main chart and each indicator charts in the FinanceChart, and draw the crosshair cursor.

There is an example for C#/ASP.NET at:

https://www.advsofteng.com/doc/cdnet.htm#crosshair.htm

If you need an example, would you mind to inform me which programming language you are using and the GUI framework (such as C++/MFC, C++/Qt, C#/WPF, C#/ASP.NET, Java/SWING, etc).

To change the height of the indicators, you can use mouse up/down/move events to detect if the user has drag on the border between the indicators. Then you can raise a "ViewportChanged" event to redraw the chart with different indicator height. The exact code structure depends on your programming language and GUI framework.

Regards
Peter Kwan

  Re: How to show the value in Y axis like my post and how to using mouse change the height of MACD indicator?
Posted by poohwen on Jan-16-2019 22:45
Thank you for your help.

I am using C# to develop my application.

If possible, could you give me an example with 2 indicators and use mouse event to change the height of the border.

Thank you for your help!

  Re: How to show the value in Y axis like my post and how to using mouse change the height of MACD indicator?
Posted by poohwen on Jan-16-2019 22:59
Hi,

I modify my application try to get the Y-axis value from your example.

I use the code
            string label = "<*block,bgColor=FFFFDD,margin=3,edgeColor=000000*>" + c.formatValue(c.getYValue(
                mouseY, c.yAxis()), "{value|P4}") + "<*/*>";

Unfortunately, I get the Y value is not exactly the value I want.

I want to get related future price like crosshair get.

Can you help me to fix this problem?

Thanks.

  Re: How to show the value in Y axis like my post and how to using mouse change the height of MACD indicator?
Posted by Peter Kwan on Jan-18-2019 04:24
Attachments:
Hi poohwen,

I have modified the "Finance Chart Track Line" sample code to include crosshair cursor and make the indicator charts resizable.

Hope this can help.

Regards
Peter Kwan
finance_crosshair_resize.zip
finance_crosshair_resize.zip

7.18 Kb

  Re: How to show the value in Y axis like my post and how to using mouse change the height of MACD indicator?
Posted by poohwen on Jan-18-2019 17:02
Thank you for your kindly help!

Your example really help.

Have nice weekend!!!!