Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3590
Can I hide the first and last ticks on a numericyaxis?
posted

I am stacking multiple charts on top of each other and then syncing them horizontally. I also hide the xaxis labels for all but the bottom chart. However, because they are so close together the last y axis tick label of one chart overlaps with the first tick label of the chart above it. Is there a way to let the chart decide the tick mark interval but just hide the first and last so the lables are completely contained within the chart area?

Parents
No Data
Reply
  • 30945
    Verified Answer
    Offline posted

    Hello Mike,

     

    Thank you for your post. I have been looking into the functionality that you are trying to achieve and I have suggest using a DataTempalte for the Label of the Y axis. You can add a TextBlock into the DataTemplate and bind it to the Item property of the AxisItemDataContext, which is the DataContext of the DataTemplate. The AxisItemDataContext aslo contains Axis property, which returns the axis that corresponds to the label. You can bind the Visibility property fo the TextBlock in the DataTempalte, using MultiBinding, to ActualMinimumValue, ActualMaximumValue properties of the Axis and also the the Item property of the AxisItemDataContext. In the converter for the MultiBinding you can return Visibility.Collapsed, if the item is equals to the ActualMinimumValue or the ActualMaximumValue property. By doing so you will be able to hide the labels at the top and at the bottom of the axis. I have created a sample application for you, that demonstrates how you can implement this approach.

     

    Please let me know if you need any further assistance on the matter.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

    DynamicallyGeneratedSeries.zip
Children
No Data