Hi,
We are assigning series to chart (XamWebChart control) programmatically. We are facing following issues:
[1] I am assigning 9 series but control is showing first 4 series.
[2] on x-axis first 4 names are appear (“lynn..”) and after that numbers are appearing.
Please find the screenshot and data as attachment. In data “Value” field is Sales and “Name” field is Name.
We are using following code to add series to control:
_XamBarWebChart.Series.Clear();
foreach (ControlSeries Series in ListControlSeries)
{
#region Dynamic Series
Infragistics.Silverlight.Chart.Series MySeries = new Infragistics.Silverlight.Chart.Series();
MySeries.DataMapping = _clsDashBoard.DASHBOARD_Value + _clsDashBoard.DASHBOARD_LABELNAME;//"Value=Value" ";Label=Name"
MySeries.Label = "S" + Series.Value.ToString();
//Default Animation
Animation a = new Animation();
MySeries.Animation = a;
_XamBarWebChart.Series.Add(MySeries);
#endregion
var dataSource =
(from d in doc.Descendants(XML_ELM_GROUP_FIELD).Descendants(XML_ELM_DATA)
where d.Parent.Parent.Parent.Attribute(XML_ATR_CONTROL_NAME).Value == Convert.ToString(_XamBarWebChart.Tag).Trim() &&
d.Parent.Attribute(groupByAttribute).Value == Series.Value
select new ChartDataMapper
Value = (double)d.Attribute(xCol),
Name = (string)d.Attribute(yCol).Value
}).ToList<ChartDataMapper>();
if (_XamBarWebChart.Series.Count() >= i + 1)
_XamBarWebChart.Series[i].DataSource = dataSource;
_XamBarWebChart.Series[i].Label = Series.Value;
}
i++;
Kindly let us know, if you need anything else.
Hello Asit,
I was looking into your requirements, however I am not sure what may cause the issue you are describing. Could you please provide me with a small test sample, where this behavior is reproducible.
Thanks in advance.
Hi Elena,
Kindly find the attachment of area chart with sample xml.
From that xml "Area chart Horizontal label” is not showing proper.
This is major issue.
Kindly resolve this issue ASAP.
I have seen your given code.
In code manipulation on data.
We can't be modifying the records because we have dynamic data from dynamic table.
In case i will use your logic in "Line chart" then it will fail. Because extra 0 value adding into
Collection.
Please provide me solution without modify the data.
We are waiting your reply.
In case you don’t want to directly modify your data source I can suggest you use helper collection where you can store the data from your datasource and set it like a DataSource for the series. You can achieve this , for example, using helper method where you can provide as parameters your original datasource and the index of the series, and retrieve the new collection that you will be used like datasource for current series. This will provide you with the possibility to modify the data, so the chart is correctly populated and the labels are displayed the way you want. Also you will increase the level of abstraction and will make it easier to handle changes in the type of datasource you use.
If you have any additional questions on this, please let me know.
Thanks for your prompt reply.
We are not getting your solution. Kindly provide sample for the same.
We have some constraint which I mentioned in previous post.
We cannot make change on data side as all data coming dynamically. We have no control on series data, user can select any field from any table for series.
Thanks
Asit Sinha
Basically the XamChart works with tabular data and follows some rendering rules that are explain in details in the following link from our documentation:
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamChart_Column_Chart.html
So I believe that you can achieve the desired behavior if you try one of the suggested approaches- by adding 0 values in your DataSource or in the datasource you assign in the series. I believe that without modifying the data currently there is no build in functionality that can help you resolve this issue. For further reference please check the following forum thread which discusses the same functionality:
http://community.infragistics.com/forums/p/38082/220246.aspx#
If you have any additional concerns, please feel free to ask.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.