ZedGraph SetScaleToDefault Function?
I am having trouble when refreshing ZedGraphControl. Basically, what happens is that the scale gets messed up whe开发者_高级运维n I refresh the graph with completely new values. Sometimes it becomes too small, sometimes too big. Here is what I do when refreshing:
zgcControlAmp.AxisChange();
zgcControlAmp.Refresh();
When the scale gets messed up, I need to RightClick->SetScaleToDefault to fix the view, but sometimes it still messes up. When working with a clean graph (first run) however, all is good.
Any tips how to work around this?
Try
zgcControlAmp.AxisChange();
zgcControlAmp.Invalidate();
after refreshing the values.
Try this:
zgcControlAmp.RestoreScale(zgcControlAmp.GraphPane);
WherezgcControlAmp.GraphPane
can be replaced with whatever GraphPane you are working with.
(This is the same function that occurs when you RightClick->SetScaleToDefault)
精彩评论