Hi Guys
I am a newbie to Infragistics.
Is it possible to Bind a DataSet which has a single tabe with multiple columns to a Web pie chart and only show the required columns in the Pie chart and not all in the table. It just shows all of them regardless of the Include column.....what am I doing wrong?
I have the following sub.....
Me.UltraChart1.Data.SwapRowsAndColumns = True
Me.UltraChart1.Data.DataSource = Job_Chart_Data 'Data Set Me.UltraChart1.Data.DataBind()
With UltraChart1
.PieChart3D.ColumnIndex = 0 .PieChart3D.OthersCategoryPercent = 0
.Data.IncludeColumn(9, True) .Data.IncludeColumn(10, True) .Data.IncludeColumn(11, True)
End With
Hello Fahim,
Thanks for the update. It is possible to set color of your choice on each Pie Chart wedge using custom palette. The below line of code implement this:
Color[] ChartColors;ChartColors = new Color[] { Color.Red, Color.Orange, Color.Yellow};UltraChart1.ColorModel.CustomPalette = ChartColors;
You may set color value based on your business requirement. I have also noticed that Legend labels are also shown for the 0 values. I will notify development about this.
Hope this helps.
Thanks,
Bhadresh
Hi Rivlin
Thank you for your reply...My Pie chart is now working with the correct data values as per your suggestion. However, It seems to have an issue with Zero values. I have two data columns one has a positive value and other has just zero. But in my pie chart legend it display as 'Other 4,500 %' as attached here. It appears the data value from the 1st column is reapeating to the 2nd value. There are no other data values of 4,500 in a single column or combined total of columns.
I have formmatted the Legend to show the Data labels, Data value and Percenatges. I am expecting it show nothing when the data value is Zero for each column.
Also, need some help on setting the Colour of my choice on each Pie Chart wedge.
Please help.....
Fahim
The pie chart will always look for the first available numeric column in your data source. It will also only display that column and ignore the others. And though you can use IncludeColumn method to exclude all columns preceding the one you want to display, I would suggest a different approach.
Use a NumericSeries to bind to a specific column:Dim series as New NumericSeries()series.Data.DataSource = yourTableseries.Data.ValueColumn = "columnName"series.DataBind()UltraChart1.Series.Add(series)
Also, don't set SwapRowsAndColumns to true, as this will display rows from the tables instead of columns.