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">
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 ?
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:ChartParameter Type="ValueX" Value="12/1/1987" />
<igCA:ChartParameter Type="ValueY" Value="4" />
<igCA:ChartParameter Type="ValueX" Value="12/1/1992" />
<igCA:ChartParameter Type="ValueY" Value="50" />
</igCA:Series.DataPoints>
</igCA:Series>
</igCA:XamChart.Series>
</igCA:XamChart>
I'm working with ScatterLine graph.
I've tried your sample and it really working well.
After this I started to play with it. I removed all hard-coded datapoints and start to add them pragmatically.
I found out the problem - exception occures when series has no datapoints.
This looks like Infragistics bug.