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.
Unfortunately, we didn’t find a way that you can achieve this functionality with the XamChart. In our Silverlight XamWebChart there is a LabelAdding event in which you can change the displayed label, but this event doesn’t exist in the XamChart.
If you want you can submit a feature request here:
http://devcenter.infragistics.com/protected/requestfeature.aspx
Hi All
If I wanted to draw my chart like this http://ppt.cc/c8(1 , How can I do by using Line Chart.
I need to draw a vertical line at 0.5 unit, and to draw many lines which maybe has null data by XAxis.
I could not find examples for my goal. Would you mid to suggest me to do this?
I think for your case you can use Line chart instead of ScatterLine. With line chart you can simply use:
pP.Label = AxisXLabel[i];
pP.Value = i * i;
Hi,
I used ScatterLine Chart to draw chart, but want to change my XAxis Label from 1~30 to A~Z? Can I do this?
I have tried to set label in every datapoint, but the picture is still only show 1~30. How can I do?
this is my Code
private void funGenerator() {
Series ScatterLineSeries = new Series(); ScatterLineSeries.ChartType = Infragistics.Windows.Chart.ChartType.ScatterLine; xamChart1.Series.Add(ScatterLineSeries); Infragistics.Windows.Chart.DataPoint pP;
for (i = 0; i < datasize; i++) { pP = new Infragistics.Windows.Chart.DataPoint(); pP.ChartParameters.Add(ChartParameterType.ValueX, i);
//Set every datapoint's label pP.Label = AxisXLabel[i];
pP.ChartParameters.Add(ChartParameterType.ValueY, i*i);
ScatterLineSeries.DataPoints.Add(pP); } }
Thanks for the additional info. We tracked this issue in our system, so this should be fixed in next hotfix release.