Click here to Skip to main content
15,886,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,I have made a chart on my form.I want to set the scale of x axis as logrithim.I mean that I have several point added to my chart.When showing the chart,I want the x_axis be shown in logarithim scale.How can I do that?
Posted

Here is the sample code for logrithm on x axis

VB
Dim axisID As VtChAxisId
' Change both x and y axes to Logarithmic scale for 2D
' Line chart.
MSChart1.chartType = VtChChartType2dLine
For axisID = VtChAxisIdX To VtChAxisIdY
With MSChart1.Plot.Axis(axisID).AxisScale
.Type = VtChScaleTypeLogarithmic
.LogBase = 10
End With
Next
 
Share this answer
 
Comments
ready to learn 9-Mar-12 11:20am    
Thanks.Sorry to ask:
Is this sample written in c#?If not,How can I write it in c#?
You wrote it changes both x_axis and y_axis.How can I change only x_axis?
I used the code:
C#
mychart.AxisX.IsLogarithmic = true;
 
Share this answer
 
v2

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