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
425
Exception thrown when formatting XamChart Axis label
posted

Hi, all

I'm trying to format X Axis of XamChart

I want that it will display as long time

 

 

 

 

 

<

igCA:Axis AxisType="PrimaryX" AutoRange="True">

 

 

<igCA:Axis.Label>

 

 

<igCA:Label Format="{}{0:T}" AutoResize="True" />

 

 

</igCA:Axis.Label>

 

 

</igCA:Axis>

But I receive folowing exception:

Exception has been thrown by the target of an invocation. -
Format specifier was invalid.

When I use

<

igCA:Label Format="{}{0:HH:mm:ss}" AutoResize="True" />

everithing work well.

It looks like a bug.

Any ideas ?

Parents
No Data
Reply
  • 17605
    posted

    What chart type you are using?

    Scatter and ScatterLine charts are the only charts that can accept X-Axis with DateTime values and your code is valid only for these types of chart.

    I tried:

    <igCA:XamChart x:Name="xamChart"> 

     

    <igCA:XamChart.Axes>

     <igCA:Axis AxisType="PrimaryX" AutoRange="True"> 

    <igCA:Axis.Label > 

    <igCA:Label Format="{}{0:T}" AutoResize="True" /> 

    </igCA:Axis.Label> 

    </igCA:Axis> 

    </igCA:XamChart.Axes> 

    <igCA:XamChart.Series> 

    <igCA:Series ChartType="ScatterLine" Fill="Green"> 

    <igCA:Series.DataPoints> 

    <igCA:DataPoint> 

    <igCA:DataPoint.ChartParameters> 

    <igCA:ChartParameter Type="ValueX" Value="12/1/1982" /> 

    <igCA:ChartParameter Type="ValueY" Value="70" /> 

    </igCA:DataPoint.ChartParameters>  

    </igCA:DataPoint> 

    <igCA:DataPoint>

    <igCA:DataPoint.ChartParameters> 

    <igCA:ChartParameter Type="ValueX" Value="12/1/1987" /> 

    <igCA:ChartParameter Type="ValueY" Value="4" /> 

    </igCA:DataPoint.ChartParameters> 

    </igCA:DataPoint> 

    <igCA:DataPoint> 

    <igCA:DataPoint.ChartParameters> 

    <igCA:ChartParameter Type="ValueX" Value="12/1/1992" /> 

    <igCA:ChartParameter Type="ValueY" Value="50" /> 

    </igCA:DataPoint.ChartParameters> 

    </igCA:DataPoint> 

    </igCA:Series.DataPoints> 

    </igCA:Series> 

    </igCA:XamChart.Series> 

    </igCA:XamChart>

     

Children