Click here to Skip to main content
16,011,626 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
in my chart i have :

Y
20
15
10
5
0
X10 20 30 40 50

I want :

X 1 2 3 4 5 6 7 8 9 10 ....

How to change scale ?
Posted
Updated 19-Dec-18 0:24am
Comments
Sergey Alexandrovich Kryukov 23-Sep-11 20:46pm    
Change what, using what library? You need to provide comprehensive information when asking a question.
--SA

1 solution

From Axes (Chart Controls)[^]:

<customizing grid="" and="" tick="" mode="hold">
By default, the Chart control automatically sets the scale of the axes in chart areas based on its data series. You can manually set the Minimum, Maximum, Interval, IntervalOffset, IntervalType, and IntervalOffsetType properties for each axis. You can further customize them by defining different settings for an axis's MajorGrid, MinorGrid, MajorTickMark, MinorTickMark, and LabelStyle properties. If you set the same property in the axis and in one of its components (for example, the Minimum property in both AxisY and AxisY.MajorGrid), the component setting takes precedence.

When Axis.Interval is set to Auto, the Axis.IntervalAutoMode property determines how many intervals should be calculated. If your chart is resized or redrawn often at run time, you can set the Axis.IntervalAutoMode property to VariableCount. This way, the chart dynamically calculates axis intervals. This is useful if the chart intervals are displayed differently depending on the data.

You can also use a logarithmic scale by setting the Axis.IsLogarithmic property to true.

See Axis Class[^] for the Axis properties.

Microsoft also has a comprehensive example Samples Environment for Microsoft Chart Controls[^] that might help you understand the chart control.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900