Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
739
Displaying Chart in PieLabelFormat.DataValue and PieLabelFormat.PercentValue
posted

Hi,

 

      I am working in Windows Application. I need to display the chart in both PieLabelFormat.DataValue and PieLabelFormat.PercentValue format.

      Please send me the source code

TIA

Maguesh

Parents
  • 17605
    posted

    Hi Maguesh,

    You can try this code as an example of using multiple chart areas: 

    private void Form1_Load(object sender, EventArgs e)

    {

    this.ultraChart1.ChartType = ChartType.Composite;

    ChartArea area1 = new ChartArea();

    area1.BoundsMeasureType = Infragistics.UltraChart.Shared.Styles.MeasureType.Percentage;

    area1.Bounds = new Rectangle(0, 0, 50, 100);

    ChartArea area2 = new ChartArea();

    area2.BoundsMeasureType = Infragistics.UltraChart.Shared.Styles.MeasureType.Percentage;

    area2.Bounds = new Rectangle(50, 0, 50, 100);

    this.ultraChart1.CompositeChart.ChartAreas.Add(area1);

    this.ultraChart1.CompositeChart.ChartAreas.Add(area2);

    NumericSeries series = new NumericSeries();

    series.Points.Add(new NumericDataPoint(60, "Label1", false));

    series.Points.Add(new NumericDataPoint(70, "Label2", false));

    series.Points.Add(new NumericDataPoint(80, "Label3", false));

    this.ultraChart1.CompositeChart.Series.Add(series);

    ChartLayerAppearance pieChart1 = new ChartLayerAppearance();

    pieChart1.ChartArea = area1;

    pieChart1.ChartType =
    ChartType.PieChart;

    pieChart1.Series.Add(series);

    ChartLayerAppearance pieChart2 = new ChartLayerAppearance();

    pieChart2.ChartArea = area2;

    pieChart2.ChartType =
    ChartType.PieChart;

    PieChartAppearance pieChartAppearance = pieChart2.ChartTypeAppearance as PieChartAppearance;

    pieChartAppearance.Labels.Format = PieLabelFormat.DataValue;

    pieChart2.Series.Add(series);

     

    this.ultraChart1.CompositeChart.ChartLayers.Add(pieChart1);

    this.ultraChart1.CompositeChart.ChartLayers.Add(pieChart2);

    }

Reply Children
No Data