locked
YAxis RRS feed

  • Question

  • Is there anyway to format?  I don't want it to affect the values of my point labels.  Can I add a prefix/suffix to the labels that appear in the YAxis?  Thanks In Advance!
    Thursday, September 30, 2010 7:23 PM

Answers

  • Yes. I'm sure you're already familiar with the Chart Controls Samples Environment.

    There is an example under Contents > Chart Features > Labels > Formatting Labels.

    Chart1.ChartAreas(0).AxisY.LabelStyle.Format = "prefix 0 suffix"
    
    
    • Marked as answer by tochart Friday, October 1, 2010 4:38 PM
    Friday, October 1, 2010 8:43 AM
    Moderator

All replies

  • Yes. I'm sure you're already familiar with the Chart Controls Samples Environment.

    There is an example under Contents > Chart Features > Labels > Formatting Labels.

    Chart1.ChartAreas(0).AxisY.LabelStyle.Format = "prefix 0 suffix"
    
    
    • Marked as answer by tochart Friday, October 1, 2010 4:38 PM
    Friday, October 1, 2010 8:43 AM
    Moderator
  • Perfect.  Thanks, I didn't know 0 was the label.  The sample environment doesn't answer all the questions I have.  I don't understand in the samples what:

    ' Set X axis labels format

    Chart1.ChartAreas("Default").AxisX.LabelStyle.Format = "D"

    ' Set Y axis labels format

    Chart1.ChartAreas("Default").AxisY.LabelStyle.Format = "C0"

    ' Set series point labels format

    Chart1.Series("Series1").LabelFormat = "P3"

    do. 

    Note I have to escape certain things like % with a \. 

    Friday, October 1, 2010 4:38 PM