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?
I've mentioned at the beginning of this post that our chart isn't capable of displaying paired stackcharts out of the box. You can use the code examples at the start of this thread to add an extra level of grouping. This is the best workaround we know of.
http://community.infragistics.com/forums/p/2886/17177.aspx#17177
Hi,
we are using VS2010 and Infragistics version 9.1 hot fix 2190,
we having a requirement using the column chart having columns of 3 groups
(category wise / location wise / month wise) as Fig(2).
Now we can acheive coulmns of 2 groups (category wise / location wise) shown below Fig(1).
Fig(1)
We need to achieve the chart as shown below in Fig(2), Please let us know how to achieve this?
Fig(2)
Regards,
sphinx.
You can use the Chart Text property to show data values on the bar. An object of ChartTextappearance needs to be created for the same. If the row and column values are given as
-2, data will appear in all stacks.Itemformatstring should be set to Data_Value_Item.
ChartTextAppearance
ct1 = new ChartTextAppearance();
ct1. ...(set all properties here)
ct1.ItemFormatString = "<Data_Value_Item>";
chartname.ChartText.Add(ct1)
You are setting the ChartTypeAppearance property on your layer and therefore overwriting any existing appearances that were set earlier, including ColumnSpacing. Simply include appearance.ColumnSpacing = 2 in your last code segment.
The text doesn't show up because you also need to set chartText.Visible = true
Max, I tried your code, the chart layer1 and layer 2 are overlapping each
other and the values are not displayed in the bar. Below is the code,
[] {s1, s2, s3, s4, s5,s6, s7, s8 });
();
layer1.ChartType = layer2.ChartType =
.StackColumnChart;
layer1.ChartArea = layer2.ChartArea = area;
layer1.AxisY = layer2.AxisY = yAxis;
layer1.AxisX = xAxis1;
layer2.AxisX = xAxis2;
yAxis.DataType =
.Numeric;
yAxis.SetLabelAxisType = Infragistics.UltraChart.Core.Layers.
.GroupBySeries;
yAxis.Labels.ItemFormat =
.DataValue;
yAxis.Labels.SeriesLabels.Format =
.Custom;
layer1.Series.Add(s1);
layer1.Series.Add(s3);
layer1.Series.Add(s5);
layer1.Series.Add(s7);
layer1.ChartArea.Border.Thickness = 100;
layer2.Series.Add(s2);
layer2.Series.Add(s4);
layer2.Series.Add(s6);
layer2.Series.Add(s8);
((
)layer1.ChartTypeAppearance).ColumnSpacing = 2;
)layer2.ChartTypeAppearance).ColumnSpacing = 2;
.ultraChart1.CompositeChart.ChartLayers.Add(layer1);
.ultraChart1.CompositeChart.ChartLayers.Add(layer2);
//To display data values in the bar
chartText.Row = -2;
chartText.Column = -2;
chartText.ItemFormatString =
;
appearance.ChartText.Add(chartText);
layer1.ChartTypeAppearance = appearance;
layer2.ChartTypeAppearance = appearance;