User (Legacy) Posted March 31, 2004 Report Share Posted March 31, 2004 Hello! I'm having problems with the AutoSize property for the series legend box. Sometimes the legend box is automatically resized to fit the contents, and sometimes - not. I'm using the latest version of Chart FX Client Server DLL. I have created a small sample app - see the attached zip (it's an MFC app created under VC++ 6). Chart-related code is located in MyView.cpp. The zip also includes a sample chart file, sample.chd. Please perform the following steps to repeat the problems. - Start the program. Its window's size is 800x600. - Open sample.chd file - The legend box at the bottom should contain 4 labels in a single row (gregtest, pmntest99, sw-sys..., test2) - Note the legend box has AutoSize = True Everything is fine up to this point. - However if you decrease the width of the window (say 2 times) you will see that some labels just disappear from the legend box. I would expect the legend box to be auto-resized to fit contents, i.e. it should be 2 lines. And this is the problem #1. - Right click the legend box and turn AutoSize off. - Right click again and turn AutoSize back on. Now the legend box is "fixed", i.e. 2 lines as expected. - However if you make the window wider again the legend's height will remain 2 lines though the labels are drawn as a single line. And this is the problem #2. - Again, right click the legend box and turn AutoSize off. - Right click again and turn AutoSize back on. The legend box is "fixed" again, i.e. a single line as expected. - Now select File - Test Paint() menu item. This will open a new window with its background 'painted' with a chart picture. The picture is created using the Paint method. - The legend box is wrong again as only 3 labels of 4 are shown. This is the problem #3. Is it a bug or a problem within the chart file? How can I make the legend box display _all_ labels? I mostly interested in the problem #3 with the Paint method because I have found a solution for #1 and #2. My workaround is to call SizeToFit method on WM_SIZE (though I believe the library must do this automatically). However SizeToFit doesn't seem to help with the Paint method problem. Any advice? Thanks in advance, Serge Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.