Hi - probably a very simple question just can't quite see how to do this!
I want to create a chart which lists the numner of hours worked by employees day-by-day. I have implemented this as a simple column chart using a dataset and this works fine. The chart is using multiple series - one per user.
Now I want to extend this so that I show both standard and overtime hours worked per employee so I believe that I want stacked column chart - again one column per employee per day but now the column is split to show both standard and overtime hours.
How do I create the necessary data set to achieve this?
If you're trying to design a stacked chart that also contains grouped columns, I would suggest taking a look at this post:http://forums.infragistics.com/forums/t/2886.aspx
The behavior isn't available out of the box, but can be achieved through various customizations.
Hi Max,
I saw your sample which you have posted at http://forums.infragistics.com/forums/t/2886.aspx . This demonstrates how you can achieve it in code behind.
Can you provide an example at earliest how can we achieve it via HTML/Markup for ASP.Net application and what datastructure it binds to?
Thanks in advance.
There are several different code pieces in that post, but I'm assuming you're referring to displaying groups of stacked charts. Unfortunately, you will not be able to use markup to achieve that. Grouped stacked charts are not inherently supported by the chart control. The code behind is used to modify the chart after it went through a rendering stage. Markup is always used prior to rendering, which is why you won't be able to use it.
Thank you for the reply Max.
Okay. I see what you are saying. Then the other thing is if I modify the chart in code behind after it goes through a rendering stage, How can I bind data from different dataset(s)? I mean I don't have control on the data. Do I always have to use NumericSeries the way you have used it below? Can I bind dataset(s) to Layers? If yes could you please show me how?
NumericSeries s1 = new NumericSeries();s1.Points.Add(new NumericDataPoint(5, "pt1", false));s1.Points.Add(new NumericDataPoint(3, "pt2", false));s1.Label = "series1";NumericSeries s2 = new NumericSeries();s2.Points.Add(new NumericDataPoint(12, "pt1", false));s2.Points.Add(new NumericDataPoint(17, "pt2", false));s2.Label = "series2";
NumericSeries s3 = new NumericSeries();s3.Points.Add(new NumericDataPoint(6, "pt1", false));s3.Points.Add(new NumericDataPoint(1, "pt2", false));s3.Label = "series3";
NumericSeries
s4 = new NumericSeries();s4.Points.Add(new NumericDataPoint(14, "pt1", false));s4.Points.Add(new NumericDataPoint(13, "pt2", false));s4.Label = "series4";
this
.ultraChart1.CompositeChart.Series.AddRange(new ISeries[ { s1, s2, s3, s4 });
Thank you again. Hope to hear soon.