How to Plot Graph to Show decimal Variation
I am able to draw the graph But the problem is that i am not able to show decimal Variation in my Graph.
Value that is plotted
it is doing decimal approximation
for value > 1.5 it is taking as 2
for value < 1.5 it is taking as 1
Code for the Plot is :
Private Sub Form_Load()
Dim i As Integer
MSChart2.ToDefaults
With MSChart2
.chartType = VtChChartType2dXY
'For X axis Plot
.Plot.Axis(VtChAxisIdX).Pen.VtColor.Blue = True
.Plot.Axis(VtChAxisIdX).Tick.Style = VtChAxisTickStyleOutside
.Plot.SeriesCollection(1).SecondaryAxis = False
.Plot.Projection = VtProjectionTypePerspective
'For Y axis Plot
.Plot.Axis(VtChAxisIdY).ValueScale.Auto = False
.Plot.Axis(VtChAxisIdY).ValueScale.MajorDivision = 10
.Plot.Axis(VtChAxisIdY).ValueScale.Maximum = 2
.Plot.Axis(VtChAxisIdY).ValueScale.Minimum = 0
.Plot.DataSeriesInRow = False
.Plot.Axis(VtChAxisIdY).AxisTitle.Text = "SNR/BER Value"
.Plot.Axis(VtChAxisIdY).Pen.VtColor.Green = True
'Properties of Chart
.Legend.TextLayout.HorzAlignment = 2
.AllowDithering = True
.ShowLegend = True
.Title.Text = "Tuner Performance Graph"
.Legend.TextLayout.WordWrap = True
.Legend.Location.LocationType = VtChLocationTypeLeft
.Legend.VtFont.VtColor.Blue = True
'.Legend.Location.LocationType = VtChLocationTypeTopRight
.Legend.Location.Rect.Max.Set 7560, 5132
.Legend.Location.Rect.Min.Set 1004, 4864
.Legend.VtFont.Style = VtFontStyleOutline
.Plot.UniformAxis = False
'For Plotting the Value On Graph
Dim Graph(1 To 400, 1 To 3) As Single
Dim xm As Integer
For xm = 1 To 400
Graph(xm, 1) = xm ' value for X-axis
Graph(xm, 2) = Rnd(xm) ' value for Y-axis
Next xm
'MSChart1.Plot.UniformAxis = False
.Refresh
MSChart2 = Graph ' populate chart's data grid using Graph array
.Refresh
End With
End Sub
Re: How to Plot Graph to Show decimal Variation
Does Any body face the problem like this ............???
Re: How to Plot Graph to Show decimal Variation
What is decimal variation ?
Re: How to Plot Graph to Show decimal Variation
By Decimal Variation i mean to say if value change in decimal
like 1.2 to 1.6 it should show exactly the same values like 1.2 and 1.6
I am able to draw the graph but the problem is :
Value that is plotted
it is doing decimal approximation
for value > 1.5 it is plotting as 2
for value < 1.5 it is plotting as 1
Am i clear ...
Re: How to Plot Graph to Show decimal Variation
You mean rounding...
Well, a "quick fix" that I'm thinking of, is to just multiply all the values that you have by 10 or 100 (depending on how many decimals you need)
So, on your report, it will say "16", but you should read it as 1.6...
You could also use some other graphing control, like this one for example:
Simple, but functional and VERY effective graph control
Or... if it's just a simple line graph (or something like that), you could make a simple function to draw the graph in a picturebox.