Hallo Admin,
here I have a problem when I want to give a line to the label series on the ChartView (DonutSeries),
in this case I want to label the line always up, even though the position of the chart data is below
which I have created is in the image (Chart_No.png)
and I want to make like the image (Chart_Yes.png)
this is the method that i have created.
private void DrawRadChartViewDonutChart(RadChartView p_oRadChart)
{
p_oRadChart.View.Margin = new Padding(20); //set pie padding
p_oRadChart.AreaType = ChartAreaType.Pie; //set to pie chart type
p_oRadChart.Series.Clear();
#region Config New Chart Series
Telerik.WinControls.UI.DonutSeries smartPie = new Telerik.WinControls.UI.DonutSeries();
smartPie.Name = "Series";
smartPie.InnerRadiusFactor = 0.45f; //setting inner radious doughnut so it can change as Doughnut Chart
smartPie.LabelMode = PieLabelModes.Horizontal;
smartPie.ShowLabels = true; //show label text
smartPie.DrawLinesToLabels = true; //show label line connector
smartPie.LinesToLabelsColor = Color.FromArgb(197, 156, 97); //set label line connector color
smartPie.SyncLinesToLabelsColor = false; //set true if we want to set label line color the same as series color
smartPie.Size = new Size(200, 200);
//set angle range starting position
AngleRange range = smartPie.Range;
range.StartAngle = 250;
smartPie.Range = range;
#endregion
#region Generate Data
List<DataChart> lData = new List<DataChart>();
lData.Add(new DataChart("Savings", 30));
lData.Add(new DataChart("Deposit", 15));
lData.Add(new DataChart("Credit", 15));
lData.Add(new DataChart("BancaAssurance", 10));
lData.Add(new DataChart("MutualFund", 10));
lData.Add(new DataChart("Jasa Giro", 20));
#endregion
//add slice area
foreach (DataChart d in lData)
{
PieDataPoint point = new PieDataPoint(Convert.ToDouble(d.Value), d.Name);
point.Label = d.Name.ToUpper();
point.Label = string.Format("{0} | {1}%{2}{3} {4}", d.Name.ToUpper(), d.Value, Environment.NewLine, "IDR", Convert.ToDouble(d.ValueRp).ToString("N0"));
smartPie.DataPoints.Add(point);
}
p_oRadChart.Series.Add(smartPie);
#region Setting Series Slice Color
p_oRadChart.Series[0].Children[0].BackColor = Color.FromArgb(193, 152, 105);
p_oRadChart.Series[0].Children[1].BackColor = Color.FromArgb(207, 175, 140);
p_oRadChart.Series[0].Children[2].BackColor = Color.FromArgb(221, 198, 173);
p_oRadChart.Series[0].Children[3].BackColor = Color.FromArgb(235, 221, 206);
p_oRadChart.Series[0].Children[4].BackColor = Color.FromArgb(193, 152, 105);
p_oRadChart.Series[0].Children[5].BackColor = Color.FromArgb(207, 175, 140);
p_oRadChart.Series[0].IsVisible = true;
#endregion
}
please help, thank you