First off, I'm on version 2006 volume 3.
I originally had a simple line chart showing 2 lines (interest paid for interest rate A in blue and interest rate B in red) over several years. Dollars paid is the Y Axis and Year is the X Axis. Now, I need to show both principle and interest paid in a stacked chart (to show the total amount paid during each year). However, because I have 2 sets of rates (A and B), I'd like my 2 sets of stacks to be "paired" or "side-by-side" for each year.
It would be similar to the demo picture below, except there would only be 2 items (principle and interest) stacked for each bar, and only 2 bars (rates A and B) per year. I'm lost as to how to tell Infragistics exactly what to stack, and what to group together...if it's even possible. Can anyone shed light on the situation?
Unfortunately, our chart doesn't have such functionality. Our stack charts don't have that extra level of grouping (grouping by month in the image). The grouping is done by stacking column values in each row of data. The column chart has the same type of grouping as your image does, but no stacking. The're a few workarounds that I can think of. You can use a column chart and add stack another box on top of the existing one using a custom layer. You can use a composite chart and add a stacked column layer for each of the monthly groups. Each group would also have to be on a separate x axis. I'd go with a custom layer approach, as it would be more friendly to databinding.
Thank you for the clarification and suggestions! I'm not familiar with what's involved for Custom Layers and Composite Charts yet, so pardon my lack of knowledge. Would it, instead, be possible to:
Is that possible? If so, how would I accomplish that? Would that require Custom Layers, a Composite Chart, or something entirely different?
Thanks!
Well, here's my attempt at this using a composite chart. Hopefully it will get you going in the right direction. The data is pretty simple here: 2 series with 2 points for each of the 2 stackcolumn layers:
using Infragistics.UltraChart.Shared.Styles;using Infragistics.UltraChart.Resources.Appearance;using Infragistics.UltraChart.Data.Series;
this.ultraChart1.ChartType = ChartType.Composite;ChartArea area = new ChartArea();this.ultraChart1.CompositeChart.ChartAreas.Add(area);
AxisItem xAxis1 = new AxisItem(ultraChart1, AxisNumber.X_Axis);AxisItem xAxis2 = new AxisItem(ultraChart1, AxisNumber.X_Axis);AxisItem yAxis = new AxisItem(ultraChart1, AxisNumber.Y_Axis);xAxis1.DataType = AxisDataType.String;xAxis2.DataType = AxisDataType.String;xAxis1.Margin.Far.Value = 20;xAxis2.Margin.Near.Value = 20;area.Axes.Add(xAxis1);area.Axes.Add(xAxis2);area.Axes.Add(yAxis);
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 });
layer1.ChartType = layer2.ChartType = ChartType.StackColumnChart;layer1.ChartArea = layer2.ChartArea = area;layer1.AxisY = layer2.AxisY = yAxis;layer1.AxisX = xAxis1;layer2.AxisX = xAxis2;layer1.Series.Add(s1);layer1.Series.Add(s3);layer2.Series.Add(s2);layer2.Series.Add(s4);
((ColumnChartAppearance)layer1.ChartTypeAppearance).ColumnSpacing = 2;((ColumnChartAppearance)layer2.ChartTypeAppearance).ColumnSpacing = 2;
this.ultraChart1.CompositeChart.ChartLayers.Add(layer1);this.ultraChart1.CompositeChart.ChartLayers.Add(layer2);
BoxAnnotation label1 = new BoxAnnotation();label1.Text = "group1";label1.Border.Color = Color.Transparent;label1.Location.Type = LocationType.DataValues;label1.Location.ValueX = 1;label1.Location.ValueY = 0;label1.TextStyle.Dy = 30;
BoxAnnotation label2 = new BoxAnnotation();label2.Text = "group2";label2.Border.Color = Color.Transparent;label2.Location.Type = LocationType.DataValues;label2.Location.ValueX = 4;label2.Location.ValueY = 0;label2.TextStyle.Dy = 30;
this.ultraChart1.Annotations.Annotations.Add(label1);this.ultraChart1.Annotations.Annotations.Add(label2);
Do you know if i can plot same this type of with silverlight chart control? I want to be able to group the stackedColumn in the chart.
it's not possible in silverlight or wpf right now.
you can submit a feature request here: http://devcenter.infragistics.com/protected/requestfeature.aspx