Home Forums WinForms controls Xceed Chart for WinForms Bar chart show on %

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

    I would like is there any define value to show the bar chart in % (percentage) instead of label and value only?

    I have try it few and can’t do it successfully, any idea on this?

    Imported from legacy forums. Posted by Steven (had 3316 views)

    Xceed Support
    Member
    Post count: 5658

    You need to assign the ValueFormatting.Format property and set it to ValueFormat.Percentage.

    <code>
    Chart chart = ( Chart )chartControl1.Charts[ 0 ];
    Axis YAxis = ( Axis )chart.Axis( StandardAxis.PrimaryY );

    //Setting the Axis
    YAxis.ValueFormatting.Format = ValueFormat.Percentage;

    LineSeries lineSerie = ( LineSeries )chart.Series.Add( SeriesType.Line );
    //Setting the DataLabel
    lineSerie.Values.ValueFormatting.Format = ValueFormat.Percentage;
    lineSerie.Add( 0.5 );
    lineSerie.Add( 0.35 );
    lineSerie.Add( 0.43 );
    lineSerie.Add( 0.47 );
    lineSerie.Add( 0.79 );
    </code>

    Imported from legacy forums. Posted by CharlesB (had 185 views)

    User (Old forums)
    Member
    Post count: 23064

    Thank you for your support. But what I means is to implement the percentage shown on the (BarSeries) bar chart instead of line chart. Let’s say I have different of 5 values, then when the chart control rendering for the bar chart using BarSeries, it will calculate the percentage based on total of 100 percentage.

    Imported from legacy forums. Posted by Steven (had 330 views)

    Xceed Support
    Member
    Post count: 5658

    Unfortunately, there is no automatic way of doing that. You will need implement it yourself.

    Imported from legacy forums. Posted by CharlesB (had 4473 views)

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