By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,594 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,594 IT Pros & Developers. It's quick & easy.

don't want to show scale values of MSChart

P: 20
hi all
i am using mschart in my programm to display graph of Time (x-axis) and Temprature(y-axis) values stored in the database .problem is that the when i have 50 or more values in the database, value on the x-axis gathered to much and look very bad and meaning less .

how can i hide the time values on the x-axis of the graph.
thanks in advance to all.
Oct 29 '06 #1
Share this Question
Share on Google+
1 Reply


P: 1
hi all
i am using mschart in my programm to display graph of Time (x-axis) and Temprature(y-axis) values stored in the database .problem is that the when i have 50 or more values in the database, value on the x-axis gathered to much and look very bad and meaning less .

how can i hide the time values on the x-axis of the graph.
thanks in advance to all.

i had the same problem but i solve it
the code is:
MSChart1.Plot.UniformAxis = False

put that in your project ...wait i give u the full text

hen creating an XY Scatter chart using the MSChart control, the resulting chart may appear distorted; that is, very tall and narrow or very short and wide. This occurs on an XY Scatter chart whose axes have ranges that differ by a large amount. For example, an X axis with a range of 0 - 10000 and a Y axis of 0 - 50.

Back to the top
MORE INFORMATION
By default, the scale on the axes of an XY (Scatter) chart is uniform. If the x-values are small in comparison to the y-values, or vice versa, the chart may appear distorted. To allow the scaling of each axis to be independent, change the UniformAxis property of the Plot object to False. The default value of this property is True.

Back to the top
Step-by-Step Example
1. Start Visual Basic and create a new Standard EXE project. Form1 is created by default.
2. Click Components from the Project menu and check the "Microsoft Chart Control" component. The MSChart control is made available on the Toolbox.
3. Put an MSChart control on Form1.
4. Copy and paste the following code to the form's code window:

Private Sub Form_Load()
Dim Graph(1 To 10, 1 To 2) As Single
Dim x As Integer
For x = 1 To 10
Graph(x, 1) = x ' value for X-axis
Graph(x, 2) = x * 10 ' value for Y-axis
Next x
MSChart1.chartType = VtChChartType2dXY ' set to X Y Scatter chart
MSChart1 = Graph ' populate chart's data grid using Graph array
' Leave the following line commented until step 6:
'MSChart1.Plot.UniformAxis = False
End Sub



5. Press the F5 key to run the project. Note that the chart is not legible (tall and narrow) because both x and y axes are using the same scale and the y-values are larger than the x-values.
6. Stop the project and remove the comment on the last line of code.
7. Press the F5 key to run the project, and note that the chart is legible.
Apr 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.