http://ko.infragistics.com/help/topic/3749cb6a-9858-447a-8fd2-80db85c7aca1I need to present labels under data values in my chart as shown in the above link.I would like to accomplish this:1.) Set the angle of the label to minus 15 (-15)2.) Display a label under every value3.) Position the label such that the entire label is visible to the viewer and not overlaid on top of the chart (see above link).For example if the value of the label is "My label" the "M" must not be outside the margin of the chart and the "l" must not be over the chart area.My chart displays only 20 values and the labels are timestamp strings i.e "11:21:56"
Thank you!
Here is xaml:
<
ig:XamDataChart Name="xamDataChart1" Width
="600" >
<ig:XamDataChart.Axes
>
<ig:NumericYAxis
MinimumValue="0"
IsLogarithmic
="False"
x:Name
="YAxis" >
</ig:NumericYAxis
<ig:CategoryXAxis
x:Name="XAxis"
ItemsSource="{Binding Load
}"
Label
="{}{Label}">
<ig:CategoryXAxis.LabelSettings
<ig:AxisLabelSettings Angle="-15" FontSize="9" Extent="100" HorizontalAlignment="Left" Location="OutsideBottom"></ig:AxisLabelSettings
</ig:CategoryXAxis.LabelSettings
</ig:CategoryXAxis
</ig:XamDataChart.Axes
<ig:XamDataChart.Series
<ig:ColumnSeries ItemsSource="{Binding Load
ValueMemberPath="Value"
XAxis="{Binding ElementName
=XAxis}"
YAxis="{Binding ElementName
=YAxis}">
</ig:ColumnSeries
</ig:XamDataChart.Series
</ig:XamDataChart
Hello,
Thank you for your post. I have been looking into it and I can suggest you set the CategoryXAxis like this:
<ig:CategoryXAxis x:Name="XAxis" Interval="1" ItemsSource="{Binding Load}"> <ig:CategoryXAxis.LabelSettings> <ig:AxisLabelSettings Extent="50" Location="OutsideBottom" FontSize="9" HorizontalAlignment="Left"/> </ig:CategoryXAxis.LabelSettings> <ig:CategoryXAxis.Label> <DataTemplate> <TextBlock Text="{Binding Item.Label}"> <TextBlock.RenderTransform> <TransformGroup> <RotateTransform Angle="-15" /> <TranslateTransform Y="30"></TranslateTransform> </TransformGroup> </TextBlock.RenderTransform> </TextBlock> </DataTemplate> </ig:CategoryXAxis.Label> </ig:CategoryXAxis>
in order to achiev the functionality you want.
Hope this helps you.
Thank you Stefan, unfortunately the textbox is not displayed correctly: The text does not display even when set to a hardcoded value as I have done below. Also, the textbox does not appear at an angle it is horizontal.
<code>
ig:CategoryXAxis
Interval
="1">
<ig:AxisLabelSettings
Extent="20"
FontSize="9"
HorizontalAlignment="Left"
Foreground
="LightGray"
Location
="OutsideBottom">
</ig:AxisLabelSettings
<ig:CategoryXAxis.Label
<DataTemplate
<TextBlock Text="this text does not display" Width="80">
<TextBlock.RenderTransform>
<TransformGroup>
<RotateTransform Angle="-15" />
<TranslateTransform Y="30"></TranslateTransform>
</TransformGroup>
</TextBlock.RenderTransform
</TextBlock
</DataTemplate
</ig:CategoryXAxis.Label
</code>
Hello Sam,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Problem was traced to one of our internal styles.
Thanks for your help Stefan.
Hi Stefan, There is some problem in my app that I am unable to find and I am unable to use the chart as you suggest. If I can find a resolution I will post it here.
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
I have asked you for a sample project with your sample data, because I created a sample where the code I have provided you works ok on my side. Now I attached the sample, so if it doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.