Set parameters of a form Chart (1 Viewer)

cpampas

Registered User.
Local time
Yesterday, 22:02
Joined
Jul 23, 2012
Messages
218
Hi, I ' ve been trying to set the parameter values of a trend line in a chart with VBA
I was able to set the minimum and maximum values of the Y value of the chart with this, in the onActivate event of the form :

Code:
Dim objChart1 As Object
Dim objAxis1 As Object
Dim max As Variant, min As Variant

myVar=80

Set objChart1 = Me.GraphFX.Object

max = CDbl(replace(DMax("plaEmpata", "line3w"), ".", ","))
min = CDbl(replace(DMin("plaEmpata", "line3w"), ".", ","))

Set objAxis1 = objChart1.Axes(2)
objAxis1.MaximumScale = max * 1.005
objAxis1.MinimumScale = min * 0.99

What could I add here so that the number of days of the trend line moving average, would be the result of : Int(myVar *0,1)
Thanks
 

Dreamweaver

Well-known member
Local time
Today, 06:02
Joined
Nov 28, 2005
Messages
2,466
Thanks for the link @strive4peace I'm just finishing up my northwind example I only have 1 chart and could do with more practice so will follow one of your videos probably a line one I think 😍
 

strive4peace

AWF VIP
Local time
Today, 00:02
Joined
Apr 3, 2020
Messages
1,003
you're welcome, @MickJav! be sure to use a CLASSIC (not Modern) chart -- they have better programmability, imo

There's a download database on the page with a chart form, menu form, and code you can look at.
 

Users who are viewing this thread

Top Bottom