Chart for WPF

How to wrap the Y Axis lable if it is too long?

  •  luyan850922 said 1 year, 10 months ago:

    Hello,

    Could you tell me how to warp the lable of Y Axis and X Axis if it is too long?

    My Chart Type is "Bar".

    thanks.

  •  luyan850922 said 1 year, 10 months ago:

    This is the sample for this problem. thanks.

    Attachments:
    You must be logged in to view attched files.
  •  C1_UpkarS75p said 1 year, 10 months ago:

    Hi,

    You can use 'TextBlock’ as 'AnnoTemplate’ with TextWrapping as true:-

    <DataTemplate x:Key="annotemplate">
     <TextBlock Text="{Binding DataObject}" TextWrapping="Wrap" Width="150"/
    </DataTemplate>
    c1Chart1.View.AxisY.AnnoTemplate = this.Resources["annotemplate"] as DataTemplate;

    Thanks

    Answer
  •  luyan850922 said 1 year, 10 months ago:

    Hi,

    That works fine, thanks.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.