On an OHLC Financial Chart that overlays 2 or more series (imagine 2 or more different OHLC symbols data stacked in a Z order...) is there a way to slightly offset the Bars (that are stacked in a Z order) such has that the bars that are under other bars can be seen and not hidden by the bar on top of it?
To illustrate this, let’s say the same OHLC data is duplicated 3 times, stacked in a Z order of 1,2,3 with 3 on the top layer, 1 on the bottom layer... (for this example) only series #3 would be seen (because it completely covers 2 and 1) Is there a way to slightly offset 2 and 1 so that these are completely covered, that 2 and 1 can slightly be seen?
In application, 2 or more OHLC datasets may cover some of the bars under them (and not all of them like my extreme example above) the goal I’m seeking by slightly offsetting the entire series is to not cover completely any single bar, such that at least the High/Low could be seen in comparison to the other OHLC series bars.
I attached an image of what I am after for a single X-Axis interval.
Is there a way to dynamically set which dataset/series appears on the top Z order? This is so the user can select which series (of the 2 or more series described above) appears on the top after the Chart has been generated.
In the above code, when the chart first appears, the state of the user interface is at its default configuration. The charting code subroutine just draws based on the state of the user interface.
When the user changes the state of the user interface, no matter what has changed, the same charting subroutine is used to redraw the chart. So no additional charting code is necessary. The code that is used to draw the initial chart can be used for updating the chart too.
You mentioned "My user then issues a command to make the RED series the TOP of the Z Order". I assume this means you will design a user interface, and the user can use the user interface to "make the RED series the TOP of the Z Order".
In this case, it is the similar to the Interactive Financial Chart. Note that in this example, there is a user interface on the left side. The user can use it to specify the vertical ordering of the technical indicators. This is by the user selecting the indicators from the drop down list box in the order he wants. The charting code simply draws the chart according to the state of the user interface.
I have attached an example user interface. It is the user interface in Visual Studio used to customize the menu bar. The user can add, remove and change the ordering of the items in the list box.
Suppose you have a similar user interface to allow your user to change the z-order. The charting code only needs to draw based on the items the list box. There is no need to have any command to change the z-order in the charting code. The z-order is changed in the user interface, not in the charting code.
Thanks Peter, I missed the ordering of the indicators on my first review. I’ll dig into the example again... I had it in my mind that the series may have a Z Order property that simply could be set... I look how the dropdown drives the rendering instead.
I have a new question based on this functionality described in the above thread... you helped me display 3 “series” of data that falls on the same X Axis and offsetting each so they aren’t hidden by one another.... that said, using this configuration...
Can you point me to a VB.NET example where the Tracker Cursor can display the OHLCV info on each of the 3 “series”?
Currently, with no code modification, it appears that the “left most” of the combination of 3 series is displaying via the Tracker Cursor... how can I make the Tracker Cursor fall on each series (that is Offset from the X Axis they are all on) to give me the info of each one individually?
(Hope this was clear, I can provide a screen shot if clear...)
Unluckily, we do not have an example that matches you exact requirements.
Are you using the code similar to the "Finance Chart Track Line" sample code? If you read the code, you can see that the "nearest x value" (the position nearest to the mouse cursor) is rounded to an integer in the sample code. For the code in this post, the "other" OHLC bars are at non-integral x-coordinates. If the mouse is over them, the "nearest x value" will be non-integer, which will then be rounded to an integer by the sample code, and this will corresponds to the "main" OHLC.
For your case, you can remove the rounding in the sample code. In this case, it should display the OHLC that is at the mouse position. However, the time stamp label (if you display them as well) will not be correct, because in the sample code, the timestamps are only at integral x value. So you may want to modify the code to create the timestamp by using rounded x-value.