[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 draw a pie chart in Matlab

You can use the pix function in Matlab to create a pie chart. The Calling format of the pie function is as follows:
Pie (X)
Use the data in X to draw a pie chart. Each element in X is represented by a slice area in the pie chart.
Pix (X, eplode)
Separate a slice area from the pie chart. The explode is a zero or non-zero matrix corresponding to X. The Slice corresponding to the non-zero value is separated from the pie chart. Therefore, if explode (I, j) is not zero, the slice corresponding to X (I, j) is separated from the center. Exploade must have the same size as X.
H = pie (...)
Returns the handle vector to the shadow and Text Graphics objects.

How to draw a pie chart in matlab


A = [30 30 10];
T = {'State units '; 'private-owned enterprises'; 'research and study'; 'unemployed '};
Explode = [1 0 1 0];
Pie (a, explode );
Colormap jet;
Title ('graduate whereabouts ', 4 );
Legend (t, 4 );



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.