1

I am developing a chart (using ASP.NET CHART CONTROL) with about 2 or 3 series on it. Please look how it looks like now. As you can see, the labels are overlapping each other and it does not look very good. Is there any way I can solve this problem and improve the overall look of the chart?

Thanks.

enter image description here

My code:

series.ChartType = SeriesChartType.Line
series.YValueType = ChartValueType.Double
series.XValueType = ChartValueType.String
series.BorderWidth = 1
series.ShadowOffset = 1
series.IsValueShownAsLabel = True
series.ToolTip = dtrow.ToString
series.LabelForeColor = Color.Gray

series.LabelToolTip = dtrow.ToString

ChartRatings.Series.Add(series)
Erwin
  • 4,757
  • 3
  • 31
  • 41
Laurence
  • 7,633
  • 21
  • 78
  • 129

3 Answers3

1

You can also set labels outside the chart for more clear presentation.

Chart1.Series[0]["PieLabelStyle"] = "Outside";

For more, refer good article here: http://betterdashboards.wordpress.com/2009/01/20/overlapping-labels-on-a-pie-chart

Altaf Patel
  • 1,351
  • 1
  • 17
  • 28
0

Enable Smart Labels.

Chart1.Series["Series1"].SmartLabels.Enabled = true;

Take a look here SmartLabels

Quantbuff
  • 827
  • 7
  • 9
  • Dead link as well as .SmartLabel appears to be a Dundas property, rather than ASP.NET Chart. I only see Chart1.Series["Series1"].SmartLabelStyle... and its sub properties. Ref. https://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.smartlabelstyle(v=vs.110).aspx – Jeff Mergler Jan 17 '18 at 20:56
0

Adding to the marked answer, you can also add these

 chart1.Series[1].SmartLabelStyle.AllowOutsidePlotArea = LabelOutsidePlotAreaStyle.Yes
 chart1.Series[1].SmartLabelStyle.IsMarkerOverlappingAllowed = False
 chart1.Series[1].SmartLabelStyle.MovingDirection = LabelAlignmentStyles.Right
Smith
  • 5,765
  • 17
  • 102
  • 161