
April 15th, 2008, 05:49 PM
|
|
Registered User
|
|
Join Date: Apr 2008
Posts: 1
Time spent in forums: 40 m 55 sec
Reputation Power: 0
|
|
|
MSChart control
Hello
I have a module that consist of Ms Chart show out all five month sales amount. Then I can show out the chart either in 2D bar or Pie chart. The problem is each time eg the first time I show the Pie chart, the amount of % of each slice is shown correctly. Then I change to 2D Bar and it also shows the amount correctly but when I change back to view pie chart, the amount of % of each slice is NOT SHOWN. Is there anyway , i can get % of each slice shown even after changing it back to pie chart
The coding that I used to show the data label is as below
Code:
With MSChart
blnChartType = graphType(0).Value
Select Case blnChartType
Case "True":
.chartType = VtChChartType2dPie ' Pie Chart
.ChartData = arrData
.Visible = True ' Making MSChart visible
For intA = 1 To .Plot.SeriesCollection.Count
With.Plot.SeriesCollection(intA).DataPoints.Item(-1).DataPointLabel
.LocationType = VtChLabelLocationTypeOutside
.Component = VtChLabelComponentPercent
.PercentFormat = "0%"
.VtFont.Size = 10 ' Setting Font Size to 10
End With
Next intA
Case "False":
.chartType = VtChChartType2dBar ' Bar Chart
.ChartData = arrData
.Visible = True ' Making MSChart visible
For intA = 1 To .Plot.SeriesCollection.Count
With.Plot.SeriesCollection(intA).DataPoints.Item(-1).DataPointLabel
.LocationType = VtChLabelLocationTypeAbovePoint
.Component = VtChLabelComponentValue
.VtFont.Size = 10 ' Setting Font Size to 10
End With
Next intA
End Select
End With
Thanks very much
|