how to refresh values in mschart control....PLZ HELP!!!

dee2020
04-15-2008, 07:50 AM
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( its gone).

The coding that I used to show the data label is as below


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

THANK YOU VERY MUCH IN ADVANCE

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum