The Mark % showing 10000% when all the series item value = 0
Posted: Tue Nov 21, 2006 3:07 am
Dear Sir
The Mark % shouldn't show 10000% when all the series item value = 0.
By the way. Which mark able to display percent of value and percent,value and total.
Below is example code.
Click the button1 to draw the chart first and click the button to show the Percent Mark.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TChart1.Series.Add(New Steema.TeeChart.Styles.Bar3D)
TChart1.Series(0).Add(0, "test", TChart1.Series(0).Color)
TChart1.Series(0).Add(0, "test2", TChart1.Series(0).Color)
TChart1.Series(0).Add(0, "test3", TChart1.Series(0).Color)
End Sub
Private Sub SetMarkStyle(ByVal MarkStyle As Integer)
Dim i As Integer
If MarkStyle = 0 Then
For i = 0 To TChart1.Series.Count - 1
TChart1.Series(i).Marks.Visible = True
TChart1.Series(i).Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelPercent
TChart1.Series(i).Marks.Pen.Color = TChart1.Series(i).Color
TChart1.Series(i).Marks.Symbol.Visible = True
Next
ElseIf MarkStyle = 1 Then
For i = 0 To TChart1.Series.Count - 1
TChart1.Series(i).Marks.Visible = True
TChart1.Series(i).Marks.Style = Steema.TeeChart.Styles.MarksStyles.Percent
TChart1.Series(i).Marks.Pen.Color = TChart1.Series(i).Color
TChart1.Series(i).Marks.Symbol.Visible = True
Next
ElseIf MarkStyle = 2 Then
For i = 0 To TChart1.Series.Count - 1
TChart1.Series(i).Marks.Visible = True
TChart1.Series(i).Marks.Style = Steema.TeeChart.Styles.MarksStyles.PercentTotal
TChart1.Series(i).Marks.Pen.Color = TChart1.Series(i).Color
TChart1.Series(i).Marks.Symbol.Visible = True
Next
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
SetMarkStyle(Button2.Tag)
Button2.Tag = Val(Button2.Tag) + 1
If Button2.Tag = 3 Then
Button2.Tag = 0
End If
End Sub
Eric
The Mark % shouldn't show 10000% when all the series item value = 0.
By the way. Which mark able to display percent of value and percent,value and total.
Below is example code.
Click the button1 to draw the chart first and click the button to show the Percent Mark.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TChart1.Series.Add(New Steema.TeeChart.Styles.Bar3D)
TChart1.Series(0).Add(0, "test", TChart1.Series(0).Color)
TChart1.Series(0).Add(0, "test2", TChart1.Series(0).Color)
TChart1.Series(0).Add(0, "test3", TChart1.Series(0).Color)
End Sub
Private Sub SetMarkStyle(ByVal MarkStyle As Integer)
Dim i As Integer
If MarkStyle = 0 Then
For i = 0 To TChart1.Series.Count - 1
TChart1.Series(i).Marks.Visible = True
TChart1.Series(i).Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelPercent
TChart1.Series(i).Marks.Pen.Color = TChart1.Series(i).Color
TChart1.Series(i).Marks.Symbol.Visible = True
Next
ElseIf MarkStyle = 1 Then
For i = 0 To TChart1.Series.Count - 1
TChart1.Series(i).Marks.Visible = True
TChart1.Series(i).Marks.Style = Steema.TeeChart.Styles.MarksStyles.Percent
TChart1.Series(i).Marks.Pen.Color = TChart1.Series(i).Color
TChart1.Series(i).Marks.Symbol.Visible = True
Next
ElseIf MarkStyle = 2 Then
For i = 0 To TChart1.Series.Count - 1
TChart1.Series(i).Marks.Visible = True
TChart1.Series(i).Marks.Style = Steema.TeeChart.Styles.MarksStyles.PercentTotal
TChart1.Series(i).Marks.Pen.Color = TChart1.Series(i).Color
TChart1.Series(i).Marks.Symbol.Visible = True
Next
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
SetMarkStyle(Button2.Tag)
Button2.Tag = Val(Button2.Tag) + 1
If Button2.Tag = 3 Then
Button2.Tag = 0
End If
End Sub
Eric