Real time X,Y scale adjustment of the serum level graph has been on my wish list for quite some time. But I had been dragging my feet due to the mistaken impression that it would be difficult to pull off. However, it proved so easy that I now wish I had added this feature years ago.
First I dropped a couple of TJvSpinButtons, one on the upper left (for Y axis adjustment) and the other on the bottom right corner of the dialog (for X axis adjustment). I chose the TJvSpinButton control instead of the standard Windows TUpDown, because the project Jedi control captures the OnBottomClick and OnTopClick events separately. I coded the OnBottomClick to decrease the current X or Y value by 20%, while OnTopClick increases the value by 20%. I also added a Reset button to restore the graph scaling to the default value.
Then I changed the GraphPrep function within TfrmMain to a class function so that I could access it from TfrmGraph, and voila.
