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

Message ListMessage List     Post MessagePost Message

  Finance Chart Track Line and Track Line with Axis Labels together in Finance Chart
Posted by Muhammad Yaseen on Mar-08-2016 17:46
How can i use Finance Chart Track Line and Track Line with Axis Labels together in Finance Chart. I am using Asp.net(C#).

  Re: Finance Chart Track Line and Track Line with Axis Labels together in Finance Chart
Posted by Peter Kwan on Mar-09-2016 04:21
Attachments:
Hi Muhammad,

I assume by axis labels, you are referring to the axis labels as in the "Cross Hair with Axis Labels" sample code.

In the "Finance Chart Track Line", the track cursor is drawn using the Javascript "traceFinance" function. You can modify the code to draw one more horizontal line (use JsChartViewer.drawHLine) at the current mouse y position, and draw one more label (use JsChartViewer.showTextBox) at the y-axis, and one more label at the x-axis of the bottom chart.

I have attached an example modified from the "Finance Chart Track Line" for your reference.

Hope this can help.

Regards
Peter Kwan
trackfinance.aspx
trackfinance.aspx

13.78 Kb

  Re: Finance Chart Track Line and Track Line with Axis Labels together in Finance Chart
Posted by Muhammad Yaseen on Mar-24-2016 15:14
Attachments:
Thank you for your example code. Actually I want some thing like this (Attached image) and i want this on all indicators.
w.png

  Re: Finance Chart Track Line and Track Line with Axis Labels together in Finance Chart
Posted by Peter Kwan on Mar-25-2016 01:11
Attachments:
Hi Muhammad,

Do you mean you want the y-axis labels to reflect the indicator values, like in the "Track Line with Axis Labels" sample code?

I copied and pasted the track cursor code from "Track Line with Axis Labels" to the "Finance Chart Track Line" sample code. After some modification, it works normally.

One thing I am not sure is what does "all indicators" means? Are high/low/open/close (the candlestick) an indicator? The 4 values typically are quite close in a chart and if all of them are shown as axis labels, they will likely overlap and hard to distinguish. In the attached code, I specifically added a line so that the candlestick is not treated as an indicator. If you want to show even the HLOC values, please remove that line.

Note that the code provided is only an example. You may need to modify it to fit your own needs.

Regards
Peter Kwan
trackfinance.aspx
trackfinance.aspx

13.80 Kb

  Re: Finance Chart Track Line and Track Line with Axis Labels together in Finance Chart
Posted by Muhammad Yaseen on Apr-06-2016 21:28
Thank you for your code it's exactly what i want. There is one problem in this code in the start of the chart (before bollinger line draw) instead of drawing horizontal line labels it's draw purple color horizontal line on the top of chart (Check attachment). One more thing is it possible if we draw only close value instead of all four OHLC value. it's like when we hover on OHLC it drwas only close value.

  Re: Finance Chart Track Line and Track Line with Axis Labels together in Finance Chart
Posted by Muhammad Yaseen on Apr-06-2016 21:29
Attachments:
Check attachment
Capture2.PNG
Capture.PNG

  Re: Finance Chart Track Line and Track Line with Axis Labels together in Finance Chart
Posted by Peter Kwan on Apr-07-2016 04:35
Hi Muhammad,

Because your data do not have "lead" values, so any indicator that requires previous data values (such as all indicators that are computed based on moving averages) can have missing values at the start of the chart. In your track cursor code, please check if null data values and do not draw them. This will avoid the line at the top (which is really a line at y = 0, as in Javascript, null is equivalent to 0 in numeric context).

In your current code, it does not draw the horizontal line for OHLC at all. If you want to draw the line for the closing value, please modify the code to draw the line for the closing value. The code that creates the legend on the top of the chart demonstrates how to obtain the closing value. You may use the same method to get the closing value and draw the line for the closing value.

Regards
Peter Kwan