데이터를 구문 분석하거나 msgraph 시리즈 콜렉션으로 편집하려고하는 제 머리카락을 꺼냅니다.
error 438 - object does not support this property or method
이 있습니다.msgraph seriescollection을 편집 할 수 없습니다.
개체에 ChartTitle.Font.Size는 있지만 seriescollection은없는 다른 속성을 조작 할 수 있습니다.
Intellisencing이이 객체와 함께 작동하지 않아 특정 참조를 설정하지 않았다는 사실을 알게되었습니다.
코드 섹션은 다음과 같습니다. 데이터 레코드는 다음의 모든 서브 루틴에 전달되어 내장되어
strReportName = "Security Selection"
strChartName = "MACD_Chart"
DoCmd.OpenReport strReportName, acViewDesign
Set rptMACD = Reports(strReportName)
Set chartMACD = rptMACD(strChartName)
:
주요 루틴은 개체를 얻을 나는 많은 것들을 시도했습니다
Call UpdateChart(chartMACD, rstMACD)
Public Sub UpdateChart(chartPlot As Object, rstChart As ADODB.Recordset)
'FUNCTION:
' a chart object is passed into the routine,
' source data is update to the recordset being passed in.
Dim lngType As Long
Dim i, j, iFieldCount As Integer
Dim rst As Recordset
Dim arXValues() As Date
Dim arValues() As Double
Dim strChartName, strYAxis, strXAxis As String
Dim ChrtCollection As ChartObjects
Dim colmCount As Integer
chartPlot.RowSourceType = "Table/Query"
'get number of columns in chart table/Query
iFieldCount = rstChart.Fields.Count
With chartPlot
'change chart data to arrays of data from recordset
.Activate
j = 0
rstChart.MoveFirst
Do While Not rstChart.EOF
j = j + 1
ReDim Preserve arXValues(1 To j)
arXValues(j) = rstChart.Fields("Date").Value
rstChart.MoveNext
Loop
For i = 1 To iFieldCount - 1 'Date is first field
j = 0
rstChart.MoveFirst
Do While Not rstChart.EOF 'get next array of data
j = j + 1
ReDim Preserve arValues(1 To j)
arValues(j) = rstChart.Fields(i + 1).Value
rstChart.MoveNext
Loop
.SeriesCollection(i).Name = rstChart.Fields(i + 1).Name
.SeriesCollection(1).XValues = arXValues
.SeriesCollection(i).Values = arValues
Next i
end sub
을 지금은 완전히 해요 혼란스러워. 나는 또한 레코드 세트 (내 선호도)에서 구문 분석하려고했지만 그 순간에 무엇이든 가져갈 것이다.
안녕하세요 @usncahill. 내가 사용하는 레코드 세트는 이동 알고리즘 (예 : MACD 및 RSI 표시기)의 결과입니다. 쿼리 양식에서이 작업을 수행하는 방법을 잘 모르겠습니다. 차트를 업데이트하거나 만드는 더 좋은 방법이 있습니까? 본질적으로 나는 만든 데이터 (배열, 레코드 세트 또는 쿼리 ... 나는 까다 롭지 않다)가있는 폼에 차트를 놓고 싶습니다. –
@ian 레코드 세트 'rstChart'는 어디서 오는가? MACD와 RSI는 어떻게 관련이 있습니까?레코드 단위로 생성됩니까? (즉, 각 레코드는 이동 평균이 생성 된 일 /시/분입니다)? – usncahill
@usnacahill. MACD는 스크립트에서 생성 된 다음 레코드 세트로 채워집니다. 예를 들어 'dEMAS (iCount) = (curPrice * dEXPSlowWeight) + (dEMAS (iCount - 1) * (1 - dEXPSlowWeight))' –