Welcome to the Xceed Community | Help
Community Search  

Change Costumer Axis Y Pecentage with out two 00

Sort Posts: Previous Next
  •  11-28-2008, 4:00 AM Post no. 17248

    Change Costumer Axis Y Pecentage with out two 00

    it's my code

                Axis customAxis = chart1.Axes.AddCustomAxis(AxisOrientation.Vertical, AxisPredefinedPosition.FrontRight);

                // Store the axis id
                customAxisId = customAxis.AxisId;

                customAxis.PositionOffset = 0;
                customAxis.ValueFormatting.Format = ValueFormat.CustomNumber;
                customAxis.ValueFormatting.CustomFormat = "P";

    but it show like this xx.00%,I dont' want have tow 00 in the end ,how can i do?

    many thanks

  •  12-01-2008, 1:30 PM Post no. 17289 in reply to 17248

    Re: Change Costumer Axis Y Pecentage with out two 00

    You can do it in one of the following two ways :

    chart.Axis( StandardAxis.PrimaryY ).ValueFormatting.Format = ValueFormat.CustomNumber;

    chart.Axis( StandardAxis.PrimaryY ).ValueFormatting.CustomFormat = "##0%";

    //or

    chart.Axis( StandardAxis.PrimaryY ).ValueFormatting.Format = ValueFormat.Percentage;

    System.Globalization.CultureInfo cultureInfo = ( System.Globalization.CultureInfo )chart.Axis( StandardAxis.PrimaryY ).ValueFormatting.CultureInfo.Clone();

    cultureInfo.NumberFormat.PercentDecimalDigits = 0;

    chart.Axis( StandardAxis.PrimaryY ).ValueFormatting.CultureInfo = cultureInfo;

     


    André
    Software Developer and Tech Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.