The goals to be achieved are:
1. Bind data to PIE's background data to automatically generate pie charts.
2. The resulting pie chart has a detailed description of the text.
The specific implementation steps:
>> Front-desk interface settings:
1. Set the Chart1 property legends the default Legend1 in the Enable to false;
2. Set the ChartType of the series to Pie
3. Set the text content of the series display (key here)
At this point, the setup of the foreground is complete.
>> below to fill in the background code:
list<String> XData =New list<String> () {"A","B","C","D"}; list<Int> Ydata =New list<Int> () {10,20,30, 40};chart1. Series[0][ Pielabelstyle "] = " Outside0][ Pielinecolor "] = " Black draw black lines. Chart1. Series[0]. POINTS.DATABINDXY (XData, ydata);
Background code primarily implements data binding and moves the indicated text to the outside of the pie chart.
The final is as follows.
Resources can be seen here: Http://stackoverflow.com/questions/8403866/values-in-a-pie-chart
C # Draw pie chart with a chart control from. Net