Home Forums WinForms controls Xceed Chart for WinForms Change Costumer Axis Y Pecentage with out two 00

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19060 |

    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

    Imported from legacy forums. Posted by Hot (had 2225 views)

    User (Old forums)
    Member
    Post count: 23064

    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;

     

    Imported from legacy forums. Posted by André (had 2952 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.