Search code examples
zedgraph

How to shift x-axis right/left when resizing a ZedGraph chart?


I display a stock price chart with ZedGraph, hence using the Y2Axis and XAxis. When I resize by dragging the mouse in the right corners, or the right edge of form, I would like the left side of XAxis to shift along with the resize, such that the bar width and bar spacing remain constant. So a drag should make me see more or less candlesticks, instead of expanding or compacting the bars. How do I achieve this? (In the Y-direction it's OK, as it auto-scales, which is fine).

BTW, I use mostly intraday time frames, so the bar interval may be anything from 1 min up to daily or weekly bars.


EDIT: OK.. I fixed it by manually coding the scale.min/max on the resize event. I don't think there are auto-settings that gives this behavior.


Solution

  • I fixed it by manually coding the scale.min/max on the resize event. I don't think there are auto-settings that gives this behavior.