Hi, i am using line chart in my application. I am using two axis(X and Y) to display the graph.
I am facing a very weird problem.
My X-axis scale shows values in reverse order. For example if values in X-axis are : 1,2,3,4 and 5.
when i move the cursor on X-axis scale, then it displays the value like 5 at first place then 4, 3,2 and 1.
Kindly suggest what property i am missing to display the data in correct order.
Thanks.
I am not sure how you defined numeric value on X axis. LineChart does not support numeric value on X axis. X axis must be string or time, and Y axis must be numeric. Here is the data requirements for Line chart:
http://help.infragistics.com/NetAdvantage/WinForms/2009.1/CLR2.0/
Can you show me the code snippet how you have it defined?
Hi Sam,
I am using the datatable to fill the Linechart datasource. Please find below the code snippet:
public DataTable ShowLinescanXYdataWithInfragistics() {
{
DataTable table = new DataTable();
DataRow row;
try
double[] arrayXaxis = fileParser.GetXCoordinates();
if (arrayXaxis == null)
throw new Exception("XY Data not found."); table.Columns.Add(
table.Columns.Add(
"X-Axis", typeof(string)); table.Columns.Add(
"Y-Axis", typeof(double));
double[] arrayYaxis = fileParser.GetYCoordinates();
for (int i = 0; i < arrayXaxis.Length; i++) { row = table.NewRow(); row[
row = table.NewRow();
row[
"X-Axis"] = arrayXaxis[i].ToString(); row[
"Y-Axis"] = arrayYaxis[i]; table.Rows.Add(row); } }
table.Rows.Add(row);
}
catch(Exception ex)
{ throw ex; }
throw ex;
return table;
//Filling the chart datasorce with datatable.
XYChart.DataSource =ShowLinescanXYdataWithInfragistics();
XYChart.DataBind();
Please suggest, what steps i need to follow to show the x-axis scale in correct order.
Thanks in advance.
Regards,
Amit
It looks like the 'fileParser.GetXCoordinates()' returnes a string - then it would be used as a label on X axis. I still don't see any reversed numbers on X axis in my testing. You would need to have numeric coordinates for Y axis only. If you need X and Y coordinates, then you might want to consider ScatterLineChart or ScatterChart with Line connected setting.