Hello Team,
I am very new to the infragistics chart control. I have placed a chart control on a form and assigning a dataset to it.
I want to set the X axis and Y axis value to be displayed at runtime.
How do I do that ?
Note: I am using Visual Studio 2008 and Infragistics 2008
Take a look at my blog post in the Custom Axis Range section:
http://blogs.infragistics.com/blogs/skim/archive/2008/09/05/chart-university-chart-101-and-some-201-301-401-stuff.aspx
Thank you for the link, it is very helpful.
I still have one doubt. I have a dataset with following Values :
ClosingDate Price TotalPrice Month Year
October 2006 50,000.00 $ 50,000.00 10 2006January 2007 10,000.00 $ 10,000.00 1 2007July 2007 40,400.00 $ 40,400.00 7 2007February2008 70,000.00 $ 70,000.00 2 2008November2008 85,000.00 $ 85,000.00 11 2008
I want to plot the ClosingDate value on the X-axis and Price on the Y axis on the Column chart and display labels on its respective axis. How do i do this ?
Also the same data is ploted on the pie chart. Here I want to display the TotalPrice column value instead of the percentage label. Can you please tell me how to do this?
Thanks in advance .
You can try using a series object for the first question. you would do something like
NumericSeries ns=new NumericSeries();
ns.Data.ValueColumn = "Price"
ns.Data.LabelColumn="ClosingDate"
ns.Data.Datasource = your table
ns.DataBind();
chart.Series.Add(ns);
(code might not be 100%, just wrote it into here)
For the second portion, try setting the ultrachart.PieChart.Labels.FormatString to something else like <DATA_VALUE>
Saw your note - hope you might be able to advise on this. Requirement seems real easy - so I must be missing something. I have a binding list that contains Dataitems with 5 values and a Date. I want the date across the bottom, and the vlaues as seperate lines. Values get picked up on Y after I done the reverse axis option, but I cannot get the dates on the X axis. Cannot see how to simply specify 'Take X Axis Value from field X of my data item'. Any help appreciated
Hi,
Just try this code. Hope it works for u.
Dim ns As New NumericSeries dim dt as datatable ns.Data.ValueColumn = "Price" ns.Data.LabelColumn = "ClosingDate" ns.Data.DataSource = dt ns.Label = "Close Date" ns.DataBind() If dt.Rows.Count = 1 Then ulColumnChart.Data.ZeroAligned = True End If ulColumnChart.Series.Add(ns) If dt.Rows.Count = 1 Then ulColumnChart.Data.ZeroAligned = True End If