[DevExpress] Explode settings, devexpressexplode
Key code:
/// <Summary> /// pie chart highlight settings /// </summary> /// <param name = "chart"> ChartControl </param> /// <param name = "pieSeries"> Series [applies only to PieSeriesView] </param> // <param name = "explodeMode"> highlight mode [enumeration] </param> /// <param name = "explodedValue"> margin </param> // <param name = "dragPie"> whether to drag to highlight a pie chart </param> public static void SetPieExplode (this chartControl chart, series pieSeries, PieExplodeMode explodeMode, int explode DValue, bool dragPie) {if (pieSeries. View is PieSeriesView) {// bool _ hitTesting = chart. RuntimeHitTesting; if (! Chart. runtimeHitTesting) chart. runtimeHitTesting = true; PieSeriesView _ pieView = pieSeries. view as PieSeriesView; _ pieView. explodeMode = explodeMode; _ pieView. explodedDistancePercentage = explodedValue; _ pieView. runtimeExploding = dragPie; // chart. runtimeHitTesting = _ hitTesting ;}}
Code usage:
private void BuilderDevChart() { Series _pieSeries = new Series("Series 1", ViewType.Pie); _pieSeries.ValueDataMembers[0] = "Value"; _pieSeries.ArgumentDataMember = "Name"; _pieSeries.DataSource = CreateChartData(); chartControl1.Series.Add(_pieSeries); //---------------------------------------- _pieSeries.LegendPointOptions.PointView = PointView.ArgumentAndValues; _pieSeries.SetPiePercentage(NumericFormat.Percent, PointView.ArgumentAndValues); chartControl1.SetAxisXTitle("test", Color.Red); _pieSeries.SetLablePosition(PieSeriesLabelPosition.TwoColumns); chartControl1.SetPieExplode(_pieSeries, PieExplodeMode.MinValue, 5, true); }
Running effect:
How to use MATLAB to draw a pie chart
Pie tools in matlab can draw pie charts
X = [1 3 0.5 2.5 2];
Explode = [0 1 0 0 0];
Pie (x, explode)
Explode separates the number of items from others. If the value in explode is not zero, it will be separated. It starts to rotate counter-clockwise from the center. You can try it on your own.
Pie3 is a three-dimensional image of a pie chart. You can enter doc pie3 in the Command window to see the specific explanation!
When MATLAB draws a pie chart, x = [11 28 05 25 2]; explode = [0 1 0 0 0] How is the percentage determined by this?
1.1, 2.8 indicates the proportion, 1.1/1.1 + 2.8 + 0.5 + 2.5 + 2 = 1.1/8.9, generally the proportion of the pie chart calculated by percentage,
In explode, 0 indicates that the two slices are combined. 1 indicates that the two slices are separated. I don't know if it is clear. I hope it will help you ,.