Hi,
I’m trying to use an interval slider to update xlims on a series plot but the xlims! function is not being triggered when the observables are being changed.
EndDate = Observable(500.0)
DateRange_is = IntervalSlider(fig[4,1],range = (0:100:600), startvalues=(100,500))
LabelText = lift(DateRange_is.interval) do int
string(int[1]," , ",int[2])
println("slider changed to ",int[1]," - ",int[2])
StartDate[] = int[1]
EndDate[] = int[2]
end
xlims!(Price_ax,StartDate[],EndDate[])
I get no errors but the xlims of the plot dont get updated unless I re-execute
xlims!(Price_ax,StartDate[],EndDate[])
I thought this line would automatically update the plot because I used observables as parameters.
The values StartDate and EndDate are getting updated correctly when the slider is moved but concerningly I noticed in the object browser that there are no listeners for the observables and that
If I change the xlims command to xlims!(Price_ax,StartDate,EndDate)
I just get a type error…
ERROR: MethodError: Cannot convert
an object of type Observable{Float64} to an object of type Float32
Can anyone tell me if my use case is appropriate and perhaps give me pointers to examples that use widgets and observables to trigger commands like xlims.
Thanks
Steve
Julia 1.6.2
Julia ext 1.4.3
vscode 1.61
Windows 10