hi
the scrollbar is too long of one pixel
thanks
Imports Arction.LightningChartUltimate.SeriesXY
Imports Arction.LightningChartUltimate
Imports Arction.LightningChartUltimate.Axes
Public Class Form1
Public WithEvents m_Chart As New LightningChartUltimate
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
m_Chart.Parent = Me
m_Chart.Dock = DockStyle.Fill
Dim axisX As AxisX = m_Chart.ViewXY.XAxes(0)
axisX.SetRange(0, 50)
axisX.ScrollMode = XAxisScrollMode.None
axisX.ValueType = AxisValueType.Number
Dim y As AxisY = New AxisY(m_Chart.ViewXY)
m_Chart.ViewXY.YAxes.Add(y)
m_Chart.ViewXY.YAxes(0).SetRange(-200, -50)
m_Chart.ViewXY.YAxes(0).Title.Visible = False
m_Chart.ViewXY.YAxes(1).Title.Visible = False
m_Chart.ViewXY.YAxes(1).SetRange(-200, -50)
m_Chart.ViewXY.AxisLayout.YAxesLayout = YAxesLayout.Stacked
m_Chart.ViewXY.LegendBox.Visible = False
Dim sds As New SampleDataSeries(m_Chart.ViewXY, axisX, m_Chart.ViewXY.YAxes(0))
sds.LineStyle.Width = 3
sds.LineStyle.Color = Color.Red
Dim samples As Double() = New Double(49) {}
Dim rand As New Random()
For i As Integer = 0 To 49
samples(i) = -150 + 70.0 * rand.NextDouble()
Next
sds.SamplingFrequency = 1
sds.FirstSampleTimeStamp = 1.0 / sds.SamplingFrequency
sds.SamplesDouble = samples
m_Chart.ViewXY.SampleDataSeries.Add(sds)
sds = New SampleDataSeries(m_Chart.ViewXY, axisX, m_Chart.ViewXY.YAxes(1))
sds.LineStyle.Width = 3
sds.LineStyle.Color = Color.Azure
samples = New Double(49) {}
rand = New Random()
For i As Integer = 0 To 49
samples(i) = -150 + 70.0 * rand.NextDouble()
Next
sds.SamplingFrequency = 1
sds.FirstSampleTimeStamp = 1.0 / sds.SamplingFrequency
sds.SamplesDouble = samples
m_Chart.ViewXY.SampleDataSeries.Add(sds)
m_Chart.ViewXY.AxisLayout.YAxesLayout = YAxesLayout.Stacked
m_Chart.Title.Visible = False
With m_Chart.ViewXY.ZoomPanOptions
.RightToLeftZoomAction = RightToLeftZoomAction.FitView
.PanDirection = PanDirection.Horizontal
.AxisMouseWheelAction = AxisMouseWheelAction.Zoom
.RightMouseButtonAction = MouseButtonAction.None
.AutoYFit.Enabled = False
.ShiftEnabled = False
.CtrlEnabled = False
.AltEnabled = False
.AutoYFit.TargetAllYAxes = True
.MouseWheelZooming = MouseWheelZooming.Horizontal
.RectangleZoomDirection = RectangleZoomDirection.Horizontal
.AspectRatioOptions.AspectRatio = ViewAspectRatio.Off
.RectangleZoomLimitInsideGraph = True
.RectangleZoomingThreshold.X = 4
End With
GetScrollingBar()
End Sub
Public ScrollingBar As Arction.LightningChartUltimate.ScrollBar
Public Sub GetScrollingBar()
Try
ScrollingBar = New Arction.LightningChartUltimate.ScrollBar
With ScrollingBar
.Minimum = 0
.Maximum = 1
.Offset.Y = 0
.Offset.X = 0
.RepeatIntervalMs = 50
.ButtonOptions.Icon.BorderWidth = 0
.ButtonOptions.Icon.Color1 = Color.FromArgb(180, Color.Black)
.ButtonOptions.Icon.GradientFill = GradientFillPoint.Solid
.ButtonOptions.Icon.Width = 7
.ButtonOptions.Icon.Height = 7
.ButtonOptions.Icon.Antialiasing = True
.ButtonOptions.BorderWidth = 0
.ButtonOptions.GradientFill = GradientFillPoint.Solid
.ButtonOptions.Color1 = Color.FromArgb(255, Color.Gray)
.ScrollBoxOptions.BorderWidth = 0
.ScrollBoxOptions.GradientFill = GradientFillPoint.Solid
.ScrollBoxOptions.Color1 = Color.FromArgb(100, Color.Black)
.Border.Width = 0
.BackgroundFill.Color = Color.FromArgb(255, Color.Gray)
.BackgroundFill.Style = RectFillStyle.ColorOnly
.BackgroundFill.GradientFill = GradientFill.Solid
.Size = New Size(.Size.Width, 15)
.KeyControlEnabled = False
.Alignment = ScrollBarAlignment.AboveGraph
.Visible = True
m_Chart.ScrollBars.Add(ScrollingBar)
End With
Catch ex As Exception
End Try
End Sub
End Class
wrong scrollbar size
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: wrong scrollbar size
Hi Fred,
the size of the scrollbar is correct, but a small problem occurs heights that are not even: the right button is rendered one pixel too right.
So set scrollbar Height = 16
and
.Border.Style = BorderType.None
By default Border.Style is Outer and renders the border width count of pixels outside the graph size. That can be easily seen if hiding the Y axis.
the size of the scrollbar is correct, but a small problem occurs heights that are not even: the right button is rendered one pixel too right.
So set scrollbar Height = 16
and
.Border.Style = BorderType.None
By default Border.Style is Outer and renders the border width count of pixels outside the graph size. That can be easily seen if hiding the Y axis.
LightningChart Support Team, PT