.NET Framework Bookmark and Share   
 index > Chart Controls for .NET Framework > How to auto Fix XAxis
 

How to auto Fix XAxis

I have two Series Date which have different number of row.Series 1 data and Serer 2 Data begin at Same pointofXAxis.
I want series 1 which is Tom's sales at each year begin at 2006 and Series 2 whirch is John's sales at each year begin at 2007.

DataSet ds = new DataSet();
ds.Tables.Add("Salary");

ds.Tables[0].Columns.Add("Dep");
ds.Tables[0].Columns.Add("Money");
ds.Tables[0].Columns.Add("Year");

ds.Tables[0].Rows.Add(new object[] { "Tom", 28000, 2006 });
ds.Tables[0].Rows.Add(new object[] { "Tom", 27500, 2007 });
ds.Tables[0].Rows.Add(new object[] { "Tom", 38500, 2008 });
ds.Tables[0].Rows.Add(new object[] { "Tom", 42300, 2009 });

ds.Tables[0].Rows.Add(new object[] { "John", 30000, 2007 });
ds.Tables[0].Rows.Add(new object[] { "John", 21000, 2008 });

Chart1.DataBindCrossTable(ds.Tables[0].DefaultView, "Dep", "Year", "Money", "");


geoinfor
i found answer is useing Chart1.AlignDataPointsByAxisLabel();
  • Marked As Answer bygeoinfor Monday, September 21, 2009 9:57 AM
  •  
geoinfor
i found answer is useing Chart1.AlignDataPointsByAxisLabel();
  • Marked As Answer bygeoinfor Monday, September 21, 2009 9:57 AM
  •  
geoinfor

You can use google to search for other answers

Custom Search

More Threads

• Data given to the MS Chart Control is (0,0), but still it do not plot it at proper location.
• Custom IChartStorageHandler implementation fails to load
• how to display lots of data on chart over 10 series
• problem installing chart controls
• Build Bar Chart Dynamically
• Creating a simple chart by two columns.
• ImageLocation - Networkshare
• Using MS Chart assemblies in ASP.NET Application without installation
• Bar Charts Question
• How to drawing dynamic Electrocardiogram (ECG)in Chart Control?