Reputation: 463
I'm using the asp.net charting control, and liking it for the most part. However, I would like my charts to size with the panels they are contained in. I cannot set the width of the chart to 100%, I have to give them an exact size. I don't want to stretch and distort the rendered chart image. Does anyone have an example of how I might do this, or could you point me in the right direction?
Upvotes: 0
Views: 889
Reputation: 3611
With sizing requirement I would consider using flash or silverlight or javascript based charts like amCharts or other. I mean anything not generating static images. These are generated on the client so they can easily adopt to the dedicated space.
Upvotes: 0
Reputation: 5191
If you don't want to stretch generated chart you can load it via ajax and pass size of current image container in an ajax request (e.g. www.site.com/generateCoolChart?height=200&width=300 ). But size of the container may be changed after the user change size of the browser so your chart may become bigger than your container.
Upvotes: 1