Full Version: Chart Auto-resizing
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
adammlange
I have a form with a chart on it. Every time I open the form, I want the chart to automatically size and format itself so that all of the x values will be displayed and everything will look decent. Is that possible?
cocoflipper
It is possible. Can you post a pic of what is produced, then I can offer some suggestions.
adammlange
I can't post a screenshot, but basically my chart has 20+ x-axis values. sometimes, the x-axis values spill over the right side of the chart and the user cannot see them.
cocoflipper
A picture tells a 1,000 words, as they say, so I'll try to offer a suggestion but without seeing what you are seeing it's tough for me to give a solid response....

In using the graph object, I've run into both too many x-axis values and y-axis values that are too high. For the x-axis problem, I came up with the solution of creating multiple reports based upon a query that I adjust with each report.

When I click on my button that says "Open Report", but before I open the report object, I determine how many values I have. Then using the maximum number of items printable (which during development I determined was 15), I open multiple reports objects which are the same report (myReport1, myReport2, etc.), using a counter on the end of the report name to open that specific report object. I also change the query ever time so that the basis of the report is the underlying query values, different for each report opened.

In my case, I determined that there was a maximum of 120 values ... divide by 15 and I get 8 report objects that I set up off the base object. So, when I have 20 items, two report objects will open. When I develop, I change myReport, then copy that to the other report objects (myReport1, myReport2, etc....) so these objects are exactly alike.

Since there are multiple reports, instead of one report with multiple pages, the user must click through the different reports instead of using the page button at the bottom of the report view. There are issues with the underlying query part that I had to adjust so that the reports print the correct thing if the user decides to print them.

You might try this - it may work for your situation. Good luck!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.