zoomrectline problem

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
fredd41
Posts: 113
Joined: Fri Sep 05, 2014 6:46 pm

zoomrectline problem

Post by fredd41 » Thu Oct 02, 2014 3:01 pm

hi

when you are zooming in the chart, if you press a key (ex: space, print screen, F7...),
the zoomin is canceled, is it normal ?

if yes, why it's not only Escape ?

and if you're zooming and you press a key. When you release the left mouse button, the zoomrectline doesnt disappear and the zoomin is canceled. But if you left click again on another place without moving, the fill color of the zoomrectline will disappear. If you move the mouse, the zoomrectline moves to the current location with the fill color. The behavior is very strange.

thanks

fredd41
Posts: 113
Joined: Fri Sep 05, 2014 6:46 pm

Re: zoomrectline problem

Post by fredd41 » Thu Oct 02, 2014 3:05 pm

you can try this code:

Imports Arction.LightningChartUltimate.SeriesXY
Imports Arction.LightningChartUltimate
Imports Arction.LightningChartUltimate.Axes

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load

Dim axisX As AxisX = m_Chart.ViewXY.XAxes(0)

axisX.ScrollMode = XAxisScrollMode.None
axisX.ValueType = AxisValueType.Number
AddHandler m_Chart.ViewXY.XAxes(0).RangeChanged, AddressOf RangeChanged


m_Chart.ViewXY.YAxes(0).ZoomingEnabled = False
m_Chart.ViewXY.YAxes(0).PanningEnabled = False


m_Chart.ViewXY.ZoomPanOptions.AxisMouseWheelAction = AxisMouseWheelAction.Zoom
m_Chart.ViewXY.ZoomPanOptions.MouseWheelZooming = MouseWheelZooming.Horizontal

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 Step 1
samples(i) = 70.0 * rand.NextDouble()
Next
sds.SamplingFrequency = 1
sds.FirstSampleTimeStamp = 1.0 / sds.SamplingFrequency
sds.SamplesDouble = samples
sds.MouseInteraction = False
m_Chart.ViewXY.SampleDataSeries.Add(sds)

axisX.SetRange(0, 50)
End Sub

Private Sub RangeChanged(newMin As Double, newMax As Double, axis As Arction.LightningChartUltimate.Axes.AxisBase, ByRef cancelRendering As Boolean)

Dim t1, t2 As Double
m_Chart.BeginUpdate()
For Each s As SampleDataSeries In m_Chart.ViewXY.SampleDataSeries
s.GetMinMaxFromXRange(t1, t2, newMin - 1 / s.SamplingFrequency, newMax + 1 / s.SamplingFrequency, False)
m_Chart.ViewXY.YAxes(s.AssignYAxisIndex).SetRange(t1, t2)
Next
m_Chart.EndUpdate()

End Sub

End Class

fredd41
Posts: 113
Joined: Fri Sep 05, 2014 6:46 pm

Re: zoomrectline problem

Post by fredd41 » Tue Oct 07, 2014 11:56 am

hi

I would like to know if this behavior is normal?

thanks

ArctionJari

Re: zoomrectline problem

Post by ArctionJari » Wed Oct 08, 2014 10:18 am

Yes, there seems to some sort of updating problem when pressing keyboard keys during zooming. We'll look into this. Thanks for bringing this to our attention.

fredd41
Posts: 113
Joined: Fri Sep 05, 2014 6:46 pm

Re: zoomrectline problem

Post by fredd41 » Wed Oct 08, 2014 11:55 am

ok thanks

Post Reply