using stock graph in Office web component -
06-12-2005
, 10:19 PM
I am using Office web component and .net for a stock data analyzer
I could not get a hollow bar for a open>close and filled for close>open, as
when processsed in excel(open,high,low,close sequence)
This is the code i have used
opens = New Object(count + 3) {}
highs = New Object(count + 3) {}
lows = New Object(count + 3) {}
closes = New Object(count + 3) {}
cats = New Object(count + 3) {}
For i = 0 To (count - 1)
cats(i) = Form2.datatable2.Rows(i)(2)
'MessageBox.Show(cats(i))
opens(i) = Form2.datatable2.Rows(i)(4)
highs(i) = Form2.datatable2.Rows(i)(5)
lows(i) = Form2.datatable2.Rows(i)(6)
closes(i) = Form2.datatable2.Rows(i)(7)
Next
m_Chart = AxChartSpace1.Charts.Add
Dim oSer As owc10.ChSeries = m_Chart.SeriesCollection.Add
Dim trend As owc10.ChTrendline = oSer.Trendlines.Add
trend.IsDisplayingEquation = False
trend.Type = owc10.ChartTrendlineTypeEnum.chTrendlineTypeLinear
m_Chart.Type = owc10.ChartChartTypeEnum.chChartTypeStockOHLC
oSer.SetData(owc10.ChartDimensionsEnum.chDimCatego ries, -1, cats)
oSer.SetData(owc10.ChartDimensionsEnum.chDimOpenVa lues, -1, opens)
oSer.SetData(owc10.ChartDimensionsEnum.chDimHighVa lues, -1, highs)
oSer.SetData(owc10.ChartDimensionsEnum.chDimLowVal ues, -1, lows)
oSer.SetData(owc10.ChartDimensionsEnum.chDimCloseV alues, -1, closes)
'oSer.Interior.SetTextured(owc10.ChartPresetTextur eEnum.chTextureDenim)
'm_Chart.PlotArea.Interior.Color =
owc10.ChartColorIndexEnum.chColorNone
'm_Chart.PlotArea.Border.Color = owc10.ChartColorIndexEnum.chColorNone
' Turn on render and layout events.
AxChartSpace1.AllowLayoutEvents = True
AxChartSpace1.AllowRenderEvents = True |