How can I remove white areas (1,2) and reduce width of axis (3) in chart (C#, Visual Studio 2013). Width of chart about 16000px. PS: If width of chart short (1000-2000 px) there are no white areas and width of axis is normally.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
The large white spaces are the proportionally enlarged distances.
You can set the positions to smaller values when you enlarge the
Chart
width.Note that relevant property of the elements you can position is of type
ElementPosition
and that..0
, which meansAutomatic
.So you need to calculate the position each time you resize the chart and you can't initially set a single property since the others are still at
0
.These elements can be positioned:
Chartarea(s)
InnerPlotPosition
of (each)Chartarea
Legend(s)
Annotations
, we don't need hereYou can also set the sizes of the
Major
- andMinorTickMarks
fromAuto
to a suitable numeric value. Here is an example that work here for aChart.Width
of16,000
pixels:Also note that I can't see any way to position the
YAxis
label; so it will usually be off to the left. You canDrawString
it in thePaint
event, though:I use some suitable values here as well but you will want to work out new ones for other sizes!
But: I'm not sure whether you should enlarge the chart this way. Instead I believe you should allow the user to zoom in and scroll in the zoomed chart!