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
1060
Conditional Numeric YAxis in percentage
posted

Hello,

We are using XamDataChart in our WPF (MVVM) appliation and everything is working fine. However we need to plot (sometimes) item which has values in Percentage. You can say, we have a dropdown above the chart from which user select, which values will be plotted in Chart.

I know, for showing the percentage "%" value in Y-Axis we have to set Label="{}{:P1}".

So my question is that how can I handle it through binding with my Model, on conditional basis?

Thanks,

  • 30692
    Suggested Answer
    Offline posted

    Hi,

    If the chart has a data context to bind against you could try binding the y axis's label property against a string in your view model that either contained the percentage format string or not, depending on the situation.

    -Graham