How to add a highlow series???
Posted: Mon Jul 24, 2006 5:08 pm
I am trying to produce a chart of two x-y linear series with the area between the lines filled in with color. If the first line y value is greater than the second line yValue a different color would be used (or different transparency - some way to indicate an "above the line" situation).
So while the first series is below the second, the area between the two series would be green... while the first series is above the second, red would be the color used to indicate the difference between the lines.
I think I need to use the HighLow series but I have no idea how to make this happen via code. Here's the code I am using to init the series:
Here's what I am trying to use to get the values in but it does not pass the precompiler:
So there are two issues: how to set up the chart to produce the expected visual; and how to get values into the series via code.
How do I accomplish this? Or,,, is it even possible???
So while the first series is below the second, the area between the two series would be green... while the first series is above the second, red would be the color used to indicate the difference between the lines.
I think I need to use the HighLow series but I have no idea how to make this happen via code. Here's the code I am using to init the series:
Code: Select all
Private Sub InitSeries(ByRef chrt As Steema.TeeChart.TChart, ByVal strName As String, ByVal clr1 As System.Drawing.Color, ByVal clr2 As System.Drawing.Color)
Dim hl As New Steema.TeeChart.Styles.HighLow(chrt.Chart)
hl.Color = clr1
hl.Title = strName
hl.XValues.DateTime = True
hl.Pen.Visible = True
hl.HighBrush.Visible = True
hl.HighBrush.Color = clr1
hl.HighBrush.Transparency = 65
hl.HighBrush.Solid = True
hl.LowBrush.Visible = True
hl.LowBrush.Color = clr2
hl.LowBrush.Transparency = 65
hl.LowBrush.Solid = True
End Sub
Code: Select all
Private Sub AddChartVal(ByRef chrt As Steema.TeeChart.TChart, ByVal iSer As Integer, ByVal XVal As Date, ByVal LoVal As Double, ByVal HiVal As Double, ByVal strText As String)
chrt.Series(iSer).Add(XVal, LoVal, HiVal, strText)
End Sub
How do I accomplish this? Or,,, is it even possible???