From: dynamix . <dy...@li...> - 2009-01-09 07:52:25
|
I created a barchart based on a few values and in my prog i have an option do change the timeframe. when i look at a short timeframe all is well but when i extend it there are a few items at almost regular intervals where the bottom of the bar is below the zero line. my ordinate bottom data is all zeros or above so whats up with that ? also how is it best to handle the width of the bars - as you display a larger amount of data the width needs to shrink. This is what im doing at the moment : Private Sub callVolume(ByVal igraph As Integer) Dim lpvolume As NPlot.BarPlot = New NPlot.BarPlot lpvolume.AbscissaData = datedata1 lpvolume.OrdinateDataTop = volumedata1 Dim zz, aa, bb As Integer bb = volumedata1.Item(0) For z = 0 To volumedata1.Count - 1 zz = volumedata1.Item(z) If zz > aa Then aa = zz ElseIf zz < bb Then bb = zz ' get lowest value End If Next Dim zerodata As ArrayList = New ArrayList For Each item In datedata1 zerodata.Add(bb) Next lpvolume.OrdinateDataBottom = zerodata lpvolume.BarWidth = (PlotSurface2D1.Width - 200) / datedata1.Count lpvolume.BorderColor = Color.Orange lpVolume.Label = "Volume" If igraph = 1 Then PlotSurface2D2.Add(lpVolume, PlotSurface2D.XAxisPosition.Bottom, PlotSurface2D.YAxisPosition.Right) ElseIf igraph = 2 Then PlotSurface2D3.Add(lpVolume, PlotSurface2D.XAxisPosition.Bottom, PlotSurface2D.YAxisPosition.Right) End If End Sub = -- Powered by Outblaze |