I guess I'm having a mental block on this one.
I put in a series of 200 candle points and show 50 at a time.
I want the left axis to be scaled to the points visible on the screen as I scroll. Right now it remains scaled to the entire data set.
I can do the scrolling programatically.
I must have some settings incorrect. I didn't notice this in the examples.
Thanks,
David
adjusting scale on vertical axis
Hi David,
you can use the MinVisibleSeriesValue and MaxVisibleSeriesValue methods :
TChart1.Axis.Left.SetMinMax TChart1.Axis.Left.MinVisibleSeriesValue(False, 0), TChart1.Axis.Left.MaxVisibleSeriesValue(False, 0)
you can use the MinVisibleSeriesValue and MaxVisibleSeriesValue methods :
TChart1.Axis.Left.SetMinMax TChart1.Axis.Left.MinVisibleSeriesValue(False, 0), TChart1.Axis.Left.MaxVisibleSeriesValue(False, 0)
Pep Jorge
http://support.steema.com
http://support.steema.com
Pep,
In the interest of simplifying the question, I indicated there was only 1 series on the chart. In fact, there are several and I want them all included.
I had seen the MinVisibleSeriesValue (and Max..) but I wasn's sure of the values.
When I tried your example, it didn't display any data until I changed the AllSeries value to true. I tried several values for the SeriesIndex. Zero allows the chart to display the first time but and chart movement causes an error.
With MultiChart.Axis.Left
.SetMinMax .MinVisibleSeriesValue(True, 0), .MaxVisibleSeriesValue(True, 0)
End With
I put this at the end of the chart display routine.
I forgot to say I'm using Version 6.
David
In the interest of simplifying the question, I indicated there was only 1 series on the chart. In fact, there are several and I want them all included.
I had seen the MinVisibleSeriesValue (and Max..) but I wasn's sure of the values.
When I tried your example, it didn't display any data until I changed the AllSeries value to true. I tried several values for the SeriesIndex. Zero allows the chart to display the first time but and chart movement causes an error.
With MultiChart.Axis.Left
.SetMinMax .MinVisibleSeriesValue(True, 0), .MaxVisibleSeriesValue(True, 0)
End With
I put this at the end of the chart display routine.
I forgot to say I'm using Version 6.
David
Tried again
I spent some more time trying to get this to work.
It now definitely changes the .max and .min values but it doesn't include all the points. They don't go high or low enough to cover all the visible points.
I have several series displayed on the chart at once including a function. Series0 is a candlestick series.
With MultiChart
.Environment.InternalRepaint
tempIncr = .Axis.Left.Increment
tempMax = .Axis.Left.MaxVisibleSeriesValue(False, 0)
tempMin = .Axis.Left.MinVisibleSeriesValue(False, 0)
tempMax = tempMax + tempIncr
tempMin = tempMin - tempIncr
.Axis.Left.SetMinMax tempMin, tempMax
End With
I was trying to bump the increment myself with tempIncr but it was nowhere near enough to cover the missing points.
If I change the "false" to "true" in both statements (which I thought was the answer for "AllSeries" I get an object failed error. Should I change the second parameter from 0 to something else?
I feel like I'm getting closer but I'm just guessing at this point. I thought this would be easier than it apparently is.
I'm using V6 of TeeChartAX and VB6.
Thanks again.
David
It now definitely changes the .max and .min values but it doesn't include all the points. They don't go high or low enough to cover all the visible points.
I have several series displayed on the chart at once including a function. Series0 is a candlestick series.
With MultiChart
.Environment.InternalRepaint
tempIncr = .Axis.Left.Increment
tempMax = .Axis.Left.MaxVisibleSeriesValue(False, 0)
tempMin = .Axis.Left.MinVisibleSeriesValue(False, 0)
tempMax = tempMax + tempIncr
tempMin = tempMin - tempIncr
.Axis.Left.SetMinMax tempMin, tempMax
End With
I was trying to bump the increment myself with tempIncr but it was nowhere near enough to cover the missing points.
If I change the "false" to "true" in both statements (which I thought was the answer for "AllSeries" I get an object failed error. Should I change the second parameter from 0 to something else?
I feel like I'm getting closer but I'm just guessing at this point. I thought this would be easier than it apparently is.
I'm using V6 of TeeChartAX and VB6.
Thanks again.
David
Hi David,
In your case you will have to use the MinVisibleValue and MaxVisibleValue methods of the Series, but as you're using more than one Series you will have to iterate through all the series to check which is the MinVisibleValue and MaxVisibleValue of each one. This method allow you to select the ValueList you want to check.
Yes, that's because TeeChart calculates the MaxVisibleSeriesValue and MinVisibleSeriesValue using the Close Values of a Candle Series.It now definitely changes the .max and .min values but it doesn't include all the points. They don't go high or low enough to cover all the visible points.
I have several series displayed on the chart at once including a function. Series0 is a candlestick series.
In your case you will have to use the MinVisibleValue and MaxVisibleValue methods of the Series, but as you're using more than one Series you will have to iterate through all the series to check which is the MinVisibleValue and MaxVisibleValue of each one. This method allow you to select the ValueList you want to check.
Code: Select all
Private Sub Form_Load()
With TChart1
.AddSeries scCandle
.Series(0).FillSampleValues 200
.Page.MaxPointsPerPage = 10
.Environment.InternalRepaint
End With
End Sub
Private Sub TChart1_OnAfterDraw()
With TChart1
.Axis.Left.SetMinMax .Series(0).MinVisibleValue(3), .Series(0).MaxVisibleValue(2)
End With
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi Pep,
(.MinVisibleValues(False,3)
What is supposed to happen if I set the "AllSeries" parameter to "true"?
Thanks, David
I see this as problematic because the High and low values need to be displayed as well. They can be very useful to the user. It doesn't seem correct to just use the close values.
Yes, that's because TeeChart calculates the MaxVisibleSeriesValue and MinVisibleSeriesValue using the Close Values of a Candle Series.
In this example, what does the 3 refer to in ".MinVisibleValue(3)" ? Is that saying to use the series 3 (for example) min visible? I notice you don't set the AllSeries parameter to either "false" or "true".In your case you will have to use the MinVisibleValue and MaxVisibleValue methods of the Series, but as you're using more than one Series you will have to iterate through all the series to check which is the MinVisibleValue and MaxVisibleValue of each one. This method allow you to select the ValueList you want to check.
Code: Select all
Private Sub Form_Load() With TChart1 .AddSeries scCandle .Series(0).FillSampleValues 200 .Page.MaxPointsPerPage = 10 .Environment.InternalRepaint End With End Sub Private Sub TChart1_OnAfterDraw() With TChart1 .Axis.Left.SetMinMax .Series(0).MinVisibleValue(3), .Series(0).MaxVisibleValue(2) End With End Sub
(.MinVisibleValues(False,3)
What is supposed to happen if I set the "AllSeries" parameter to "true"?
Thanks, David
Hi David,
From the help :
No, this is a different method than the "Axis.Left.MinVisibleSeriesValue(False, 0)". The 3 refers to the index of the ValueList (in that case low).In this example, what does the 3 refer to in ".MinVisibleValue(3)" ? Is that saying to use the series 3 (for example) min visible? I notice you don't set the AllSeries parameter to either "false" or "true".
(.MinVisibleValues(False,3)
From the help :
function MinVisibleValue(valueList: Integer): Double;
Type Library
TeeChartX
Description
Returns the Min Visible Value for a given ValueList.
Example
--------------
With TChart1.Series(0)
If .Count > 0 Then
OpenLabelMx.Caption = .ValueLists.Items(4).Name
OpenLabelMn.Caption = .ValueLists.Items(4).Name
OpenValMx.Caption = .MaxVisibleValue(4)
OpenValMn.Caption = .MinVisibleValue(4)
End if
End with
See also:
IAxis.MinVisibleSeriesValue
TeeChart Pro ActiveX Control Documentation. Copyright 1997-2004 Steema Software SL.
Should return the Max and Min value between all Active Series currently visible Points related to that Axis.What is supposed to happen if I set the "AllSeries" parameter to "true"?
Pep Jorge
http://support.steema.com
http://support.steema.com
Pep,
I finally got back to this issue and worked my way thru the solution.
I had some trouble finding the values for the lower band on the Bollinger band function but I finally got it to work.
I still got an error on the AllSeries method but it may be because some series did not have any values. Anyhow, I'll save that for another day since the rest is working.
Thanks for your help on this.
David
I finally got back to this issue and worked my way thru the solution.
I had some trouble finding the values for the lower band on the Bollinger band function but I finally got it to work.
I still got an error on the AllSeries method but it may be because some series did not have any values. Anyhow, I'll save that for another day since the rest is working.
Thanks for your help on this.
David
Hi David,
ok, I'm glad to know that works. If you sill getting errors or you've any problem send me the code with which I can reproduce the problem and we'll try to find a solution.
ok, I'm glad to know that works. If you sill getting errors or you've any problem send me the code with which I can reproduce the problem and we'll try to find a solution.
Pep Jorge
http://support.steema.com
http://support.steema.com