I need to have multiple time frame on a zedgraph. I have to display the stock data on a daily time frame and then if user wishes to view the view in monthly time frame or hourly time frame i need to support it. Note that the data must be in candle stick bar and not the line bar.
Currently i have 3 curves and i display only one at a time and hide the others. For example initially i set up my graph to be on daily time frame and hide the hour and monthly time frame candle stick curve. When the user gives the command to see the hourly graph i hide the daily candle stick and show the hourly time graph. However i am not able to change the x axis as it still shows the daily time instead of changing to hourly. I need to do something to change the x axis time frame from daily to hourly.
Any kind of help is appreciable. Please advise even if there is a workaround. Thanks.
You probably can do it by changing Min
, Max
and Step
properties of XAxis.Scale
object.
So, your method/event handler that supports this user action should:
- show/hide proper curves at pane, change
- adjust the scale using properties I listed above
- refresh the graph.
Note, that Refresh()
method of ZedGraphControl isn't cheap. It redraws all elements on your graph, so if you have a lot of data, it isn't good idea to use it.
In that situation you should use combination of AxisChange()
and Invalidate()
methods. It should be faster and cheaper.