Jump to content
Software FX Community

Would like to add 1 Open-High-Low-Close bar to existing chart without the whole chart repainting and bars X-shifting


User (Legacy)

Recommended Posts

Hi,

I have created an Open-High-Low-Close ChartFX Winforms VS .NET 2005 chart

that is not databound. When the user clicks one button, Open-High-Low-Close

bars are plotted for the first part of the day using the normal ChartFX API

and a for loop to plot the 1 X value and 4 Y values one point at a time.

Once the original bars are plotted, the application every so often goes and

looks for more Open-High-Low-Close bar data to plot the the right of the

original bars.

The problem I am having with plotting the Open-High-Low-Close bars at the

end of the Chart are twofold:

1. When an Open-High-Low-Close bar is plotted, ALL the bars are getting

repainted, because they all shift slightly to the left. I want the chart to

do as little work as possible by only drawing the last bar to the right of

the pre-existing bars without recalculating the position of the first bars.

How can I achieve this?

2. The fact that the Open-High-Low-Close are shifting at all seems like a

serious bug in Chart FX that I need a fix for. The problem is that the

original bars are plotted too far to the right on the timeline. The ticks

and vertical bars that I create in code are plotted perfectly on the X-Axis,

but Open-High-Low-Close bars whose X-value I set in code are plotted

significantly too far to the right. In the past with databound charts whose

data I plot all at once, the only way I could find to solve the problem was

to add fake Open-High-Low-Close bars in any timespan that had no real

Open-High-Low-Close bars, even to any empty space at the right side of the

chart. Doing this made the bars shift into the correct positions on the

X-Axis.

I would really like the Open-High-Low-Close bars to plot correctly on the

X-Axis without having to create fake bars. For instance, if I try to plot a

15 minute Open-High-Low-Close bar at 2:30 PM and also plot a vertical line

at 2:30 PM on the X-Axis, I would like vertical line and the

Open-High-Low-Close bar to be displayed at the same X-Value on the chart.

How can I do this?

Thank you very much,

Brook Hunter

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...