HOw do i put a text in the middle of each area?Example i want to say
my first area graph is "high" by putting a text label high in the middle
of that high area
Chart.AddSeries scArea
Chart.Series(0).asArea.UseYOrigin = True
Chart.Series(0).asArea.YOrigin = Spimax
Chart.Series(0).Add Spimax CDate(GraphArray(1, i)), VbColor(14)
Chart.AddSeries scArea
Chart.Series(1).Title = "Project at Risk"
Chart.Series(1).asArea.UseYOrigin = True
Chart.Series(1).asArea.YOrigin = Spimin
Chart.Series(1).Add Spimax, CDate(GraphArray(1, i)), VbColor(12)
Area Graph question
-
- Newbie
- Posts: 19
- Joined: Fri Nov 15, 2002 12:00 am
- Contact:
Hi,
you could use something like the following ocde (also you can customize the text and the Marks you want to show) :
you could use something like the following ocde (also you can customize the text and the Marks you want to show) :
Code: Select all
Private Sub Form_Load()
With TChart1
.Aspect.View3D = False
.AddSeries scArea
.Series(0).FillSampleValues 10
.Series(0).Marks.Visible = True
End With
End Sub
Private Sub TChart1_OnGetSeriesMark(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, MarkText As String)
Dim BarHeight As Double
With TChart1
AreaHeight = (.Axis.Bottom.Position - .Series(0).CalcYPos(ValueIndex)) / 2
.Series(0).Marks.ArrowLength = AreaHeight * -1 - 8
.Series(0).Marks.Arrow.Visible = False
End With
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 19
- Joined: Fri Nov 15, 2002 12:00 am
- Contact:
How do i assign the MarkText?
Thanks for answering previous question.
Regaring this post, i just want to know how i assign MarkText to area graph?
Regaring this post, i just want to know how i assign MarkText to area graph?
Hi,
you must set the Marks labels visible to True :
tChart1.Series(0).Marks.Visible = true
and then you can do something like this :
you must set the Marks labels visible to True :
tChart1.Series(0).Marks.Visible = true
and then you can do something like this :
Code: Select all
Private Sub TChart1_OnGetSeriesMark(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, MarkText As String)
Dim BarHeight As Double
With TChart1
if ValueIndex = 5 then
AreaHeight = (.Axis.Bottom.Position - .Series(0).CalcYPos(ValueIndex)) / 2
.Series(0).Marks.ArrowLength = AreaHeight * -1 - 8
.Series(0).Marks.Arrow.Visible = False
MarkText = "My Custom Mark"
else
MarkText = ""
end if
End With
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com