cxgridchart饼状图

var
 VIEW:TcxGridDBChartView;
 Level:TcxGridLevel;
 Series:TcxGridDBChartSeries;
begin

  View := cxGrid1.CreateView(TcxGridDBChartView) as TcxGridDBChartView;
  View.Name := 'MyChart';
  Level:=cxGrid1.Levels.Add;
  Level.GridView := View;
  View.DataController.DataSource := TheDataSource;
  View.DiagramPie.Active := true;
  Series :=View.CreateSeries;
  View.Series[0].DataBinding.FieldName := 'Value';
  View.DiagramPie.Values.CaptionPosition := pdvcpCenter;
  View.DiagramPie.Values.PercentageCaptionFormat := '0.0%';
  View.DiagramPie.Values.CaptionItems := [pdvciCategory,pdvciValue,pdvciPercentage]
end;

转载于:https://www.cnblogs.com/bwdblogs/p/10345788.html

你可能感兴趣的:(cxgridchart饼状图)