.NET Framework Bookmark and Share   
 index > Chart Controls for .NET Framework > How to fix margin and padding of chart when dinamic resize occurs
 

How to fix margin and padding of chart when dinamic resize occurs

Hi, I have a chart (two stepline series) that is dinamically populated. The size of the series could vary a lot (e.g. from 50 to 5000) according to the data I am analizing. I can easily change the size of the chart when I load new data, but the new size also changes the distance between the Y-axis and the border of the chart.
Here two images which explain the problem.
The first image is about a large number of point in the chart. As you can see the Y-Axis is far from the border and also the label ticks are very long.





The second image is about a small set of data:





How to keep the axis ticks and its distance fixed at some value when doing the resize?
Thank you guys.
Michele Costantino

Hello,

Try setting the InnerPlotPosition of the area to something suitable, for example:

	Chart1.ChartAreas("ChartArea1").InnerPlotPosition = New ElementPosition(10, 10, 90, 90)

This should keep the axis at the specified position no matter how big the axis-labels are. Be sure to leave enough room for the labels.

sipla

You can use google to search for other answers

Custom Search

More Threads

• DataBindCrossTable giving a IEnumerable error
• Only background styling being applied from XML template
• Cross-Table Data Binding
• Reading Y values at cursor position
• Multiple X-Axis Values
• Printed chart looks different to that on screen
• ChartHttpHandler problem concurrency
• Connecting lines for supplemental pie chart?
• How to drawing dynamic Electrocardiogram (ECG)in Chart Control?
• Retain palette/custom palette when using PieCollectedDataHelper