[DevExpress] Explode settings, devexpressexplode

Source: Internet
Author: User

[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 ,.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.