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
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.