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