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 .
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
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
Thanks a lot Sung, it did work.
If you have one value for your column chart it may just be your axis that needs adjusting. Try setting the min value of the axis to something lower than the value of your row. You can also try setting it to start at zero in which case you would want to set ultrachart.data.zeroaligned to true.
Hi Sung,
Thanks for ur reply. The code given by you did work, but still there is one problem. I have a datatable as my datasource, If my datatable has only one record in it, then the the chart is not displayed in case of Column chart type, but it does display in the Pie chart type.
If you assign the datatable directly to a chart instead of the series then it works fine, even if the datatable has one record the chart is displayed.
I had downloaded a sample code from the Infragistics forum ("ChartSample.zip"), Even it has the same problem.
Can you please look into this.
Thank you.