Ticket T304090
Visible to All Users

WPF ChartControl StringFormat on AXIS Labels

created 9 years ago

Hello,

Is it possible to display a custom string in conjunction with the Argument/Value of the data source?
For instance, my X-Axis represents seconds in a time range. I would like it to display the strings "5 secs", "10 secs" etc. on the label.
Tried setting the TextPattern for the Axis through the Chart Designer to "{A} secs " but the save button does nothing.

Answers approved by DevExpress Support

created 9 years ago

>> setting the TextPattern for the Axis through the Chart Designer to "{A} secs"
This is the correct approach.

>> the save button does nothing.
I have managed to reproduce this issue and created a separate ticket for this behavior from your behalf: The save button does not work in Chart's Designer in some situations. For now I suggest you use the following XAML code:

XAML
<dxc:ChartControl> <dxc:XYDiagram2D> <dxc:XYDiagram2D.AxisX> <dxc:AxisX2D> <dxc:AxisX2D.Label> <dxc:AxisLabel TextPattern="{}{A} sec"/> </dxc:AxisX2D.Label> </dxc:AxisX2D> </dxc:XYDiagram2D.AxisX> </dxc:XYDiagram2D> </dxc:ChartControl>
    Comments (2)
    AC AC
    Analysis Computers 9 years ago

      Hey John, I eventually did that for the AxisLabel.TextPattern property. Ηοwever, I was trying to set a bunch of other properties regarding the ChartControl through the designer that would otherwise take much more time to do it in XAML after understanding the control hierarcy and consulting the documentation.

      DevExpress Support Team 9 years ago

        Hi,
        Would you please describe what kind of properties you wish to show and provide a few use cases? This will help us find the best approach for your scenario. I hope to hear from you soon.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.