12

I want to programmatically turn on/off the labels on an Chart Control.

The chart is for a load of stats, by person, and I want to be able to anonymise it by removing the labels.

Can this be done from the Chart Control, or do I need to do it at the underlying data-table?

demonplus
  • 5,613
  • 12
  • 49
  • 68
Ben
  • 4,281
  • 8
  • 62
  • 103

2 Answers2

38

Yes just set the AxisX.LabelStyle to false

e.g

Chart1.ChartAreas["ChartArea1"].AxisX.LabelStyle.Enabled = false;
escouser
  • 1,913
  • 19
  • 15
4

I use following code, and works well too.

chart1.ChartAreas[0].AxisY.Enabled = AxisEnabled.False;
Owen Lee
  • 349
  • 1
  • 5
  • 19