Hi,
I am using composite chart to display the chart types like Line, Scatter, Area and Bar chart. In my code, the Line and Scatter charts are working fine. But the Area and Bar charts are not appearing in the composite chart. Could you please suggest me the right steps to follow in displaying the Area and Bar charts in the composite chart?
Note: I have reffered the Axis Requirements in the Infragistics online help, they suggesting to use the following requirements for composite chart...
Area (2D)
Both:
AxisDataType=String/Time
and
SetLabelAxisType=Continuous
AxisDataType=Numeric
n/a
Bar (2D)
AxisDataType=String
SetLabelAxisType=GroupBySeries
But in my requirement, I need to use "X-axis as Time/Numeric" & "Y-axis as Numeric" for both Area and Bar chart. Please suggest me a solution.
Thanks & Regards,
Raaj
My requirement is very urgent. Could anyone suggest me solution or provide sample codes?
Regards,
Hi Raaj,
Did you have a time to take a look at my sample, that Boris upload yesterday in this forum thread http://community.infragistics.com/forums/p/68189/345467.aspx If so there is shown how to used AreaChart.
Right now I made small modification to combine Line, Area and ColumBar chart. Please take a look at the attached sample and let me know if you have any questions.
Regards
Have you been able to resolve your issue ? Did you have a time to take a look at the attached sample. Let me know if you have any questions
I have gone thru the attachment samples. But that is not given me complete solution. Because, for Area and Bar chart, the series I need to dsiplay is
1st requirement(both Area & Bar) is... in X-axis i need to display Date series and Y-axis as numeric series and
2nd requirement(both Area and Bar) is... in X-axis I need to display numeric series and Y-axis as numeric series.
I tried by using the NumericSeries datapoint style. But when I converted the Date value to string, it does not appearing in the x-axis range series. It simply shows a dark labels. Please see the below screen shot.
Let me know if you need further clarifications.
Hello Raaj,
If you take a look at the code in my previous sample you will see that I`m using two different X axis (one X axis for Area chart and other X Axis for Column chart ). The same is for Y axis. By this way each chartLayer using his own axis. Also you are able to create different type of Series (for example Numeric series for area chart and NumericTimeSeries for column chart) and apply these series to appropriate chartlayer with correct axis. By this way you could achieve desired behavior
Let me know if you have any questions
Would you be able to provide a drawing or other mock-up showing how you'd like the chart to look? If we had something like that from you, it would be much easier for us to help you find a solution.
Hi Dave,
I will provide you sample screen shots for the BAR and AREA chart taken from the DevXpress chart.
I am using the Ultra chart with type composite chart to display BAR and AREA charts in ultra chart.
Sample BAR chart with X-axis(Date) and Y-axis(Numeric):
Sample BAR chart with X-axis(Numeric) and Y-axis(Numeric):
Sample AREA chart with X-axis(Date) and Y-axis(Numeric):
Sample AREA chart with X-axis(Numeric) and Y-axis(Numeric):
To bind the values, I have using the below codes.
NumericSeries NumSeries = new NumericSeries(); NumSeries.Data.LabelColumn = xMemberData.ToString(); NumSeries.Data.ValueColumn = yMemberData.ToString(); NumSeries.Data.DataSource = dtTemp; NumSeries.DataBind(); series = NumSeries;
NumericSeries
NumSeries = new NumericSeries();
NumSeries.Data.LabelColumn = xMemberData.ToString();
NumSeries.Data.ValueColumn = yMemberData.ToString();
NumSeries.Data.DataSource = dtTemp;
NumSeries.DataBind();
series = NumSeries;
And to bind the series with the composite chart, I will be using the below codes..
chartPreview.ChartType =
ChartType.Composite;
chartPreview.CompositeChart.ChartAreas.Add(area1);
// AxisItem x2 = new AxisItem(chartPreview, AxisNumber.X2_Axis);
//*** for Y1 Axes
{
layerY1 =
new ChartLayerAppearance(chartPreview); layerY1.Key = graph.AxisY1Variables[Y1].Name.ToString(); layerY1.ChartType = UpdateSeries(graph.AxisY1Variables[Y1].SeriesType.ToString()); LayerY1Collection.Add(layerY1); } }
layerY1.Key = graph.AxisY1Variables[Y1].Name.ToString();
layerY1.ChartType = UpdateSeries(graph.AxisY1Variables[Y1].SeriesType.ToString());
LayerY1Collection.Add(layerY1);
}
//*** for Y2 Axes if (graph != null && nbgY2Axis.ItemLinks.Count != 0) { for (int Y2 = 0; Y2 < nbgY2Axis.ItemLinks.Count; Y2++) { layerY2 = new ChartLayerAppearance(chartPreview); layerY2.Key = graph.AxisY2Variables[Y2].Name.ToString(); layerY2.ChartType = UpdateSeries(graph.AxisY2Variables[Y2].SeriesType.ToString()); LayerY2Collection.Add(layerY2); } }
//*** for Y2 Axes
if (graph != null && nbgY2Axis.ItemLinks.Count != 0) {
for (int Y2 = 0; Y2 < nbgY2Axis.ItemLinks.Count; Y2++) { layerY2 =
layerY2 =
new ChartLayerAppearance(chartPreview); layerY2.Key = graph.AxisY2Variables[Y2].Name.ToString(); layerY2.ChartType = UpdateSeries(graph.AxisY2Variables[Y2].SeriesType.ToString()); LayerY2Collection.Add(layerY2); } }
layerY2.Key = graph.AxisY2Variables[Y2].Name.ToString();
layerY2.ChartType = UpdateSeries(graph.AxisY2Variables[Y2].SeriesType.ToString());
LayerY2Collection.Add(layerY2);
LayerY1Collection[Y11].ChartArea = area1; LayerY1Collection[Y11].AxisX = x; LayerY1Collection[Y11].AxisY = y;
LayerY1Collection[Y11].ChartArea = area1;
LayerY1Collection[Y11].AxisX = x;
LayerY1Collection[Y11].AxisY = y;
if
(area1.Axes.Count == 0) { area1.Axes.Add(x); area1.Axes.Add(y); } LayerY1Collection[Y11].AxisX.Extent = 75; LayerY1Collection[Y11].AxisY.Extent = 75;
area1.Axes.Add(x);
area1.Axes.Add(y);
LayerY1Collection[Y11].AxisX.Extent = 75;
LayerY1Collection[Y11].AxisY.Extent = 75;
//***** common settings for X-axis and Y-axis
LayerY1Collection[Y11].Visible = true; LayerY1Collection[Y11].AxisX.Visible =
LayerY1Collection[Y11].AxisX.Visible =
true; LayerY1Collection[Y11].AxisX.Labels.Visible = t
LayerY1Collection[Y11].AxisX.Labels.Visible = t
rue; LayerY1Collection[Y11].AxisX.ScrollScale.Visible = f
LayerY1Collection[Y11].AxisX.ScrollScale.Visible = f
alse; LayerY1Collection[Y11].AxisX.RangeType =
LayerY1Collection[Y11].AxisX.RangeType =
AxisRangeType.Automatic; LayerY1Collection[Y11].AxisX.TickmarkStyle =
LayerY1Collection[Y11].AxisX.TickmarkStyle =
AxisTickStyle.Smart; LayerY1Collection[Y11].AxisY.Visible =
LayerY1Collection[Y11].AxisY.Visible =
true; LayerY1Collection[Y11].AxisY.Labels.Visible = t
LayerY1Collection[Y11].AxisY.Labels.Visible = t
rue; LayerY1Collection[Y11].AxisY.ScrollScale.Visible = f
LayerY1Collection[Y11].AxisY.ScrollScale.Visible = f
alse; LayerY1Collection[Y11].AxisY.RangeType =
LayerY1Collection[Y11].AxisY.RangeType =
AxisRangeType.Automatic; LayerY1Collection[Y11].AxisY.TickmarkStyle =
LayerY1Collection[Y11].AxisY.TickmarkStyle =
AxisTickStyle.Smart;
//***** For Y1 Axis layer **************
if (LayerY1Collection[Y11].ChartType.ToString().Contains(SeriesType.Area.ToString())) { LayerY1Collection[Y11].ChartType =
LayerY1Collection[Y11].ChartType =
ChartType.AreaChart;
if (IsDateSeries) { x.DataType =
x.DataType =
AxisDataType.Time; y.DataType =
y.DataType =
AxisDataType.Numeric; x.SetLabelAxisType =
x.SetLabelAxisType =
SetLabelAxisType.ContinuousData; LayerY1Collection[Y11].AxisX.TickmarkIntervalType =
LayerY1Collection[Y11].AxisX.TickmarkIntervalType =
AxisIntervalType.Months; LayerY1Collection[Y11].AxisX.Labels.ItemFormat =
LayerY1Collection[Y11].AxisX.Labels.ItemFormat =
AxisItemLabelFormat.Custom; LayerY1Collection[Y11].AxisX.Labels.ItemFormatString =
LayerY1Collection[Y11].AxisX.Labels.ItemFormatString =
"<DATA_VALUE:MM/dd/yyyy>"; LayerY1Collection[Y11].AxisX.Labels.Orientation =
LayerY1Collection[Y11].AxisX.Labels.Orientation =
TextOrientation.Custom; LayerY1Collection[Y11].AxisX.Labels.OrientationAngle = -40; LayerY1Collection[Y11].AxisY.Labels.ItemFormat =
LayerY1Collection[Y11].AxisX.Labels.OrientationAngle = -40;
LayerY1Collection[Y11].AxisY.Labels.ItemFormat =
AxisItemLabelFormat.Custom; LayerY1Collection[Y11].AxisY.Labels.ItemFormatString =
LayerY1Collection[Y11].AxisY.Labels.ItemFormatString =
"<DATA_VALUE:00.0000>"; }
else
{ x.DataType =
AxisDataType.String; y.DataType =
SetLabelAxisType.ContinuousData;
LayerY1Collection[Y11].AxisX.Labels.Orientation = TextOrientation.VerticalLeftFacing;
LayerY1Collection[Y11].AxisX.Labels.ItemFormat = AxisItemLabelFormat.ItemLabel; LayerY1Collection[Y11].AxisY.Labels.ItemFormat =
AxisItemLabelFormat.DataValue; LayerY1Collection[Y11].AxisY.Labels.ItemFormatString =
"<DATA_VALUE:00.0000>"; } }
else if (LayerY1Collection[Y11].ChartType.ToString().Contains(SeriesType.Bar.ToString())) { LayerY1Collection[Y11].ChartType =
ChartType.BarChart;
AxisDataType.Numeric; y.DataType =
AxisDataType.String; y.SetLabelAxisType =
y.SetLabelAxisType =
SetLabelAxisType.GroupBySeries;
BarChartAppearance barAppearance = new BarChartAppearance(); barAppearance.NullHandling =
barAppearance.NullHandling =
NullHandling.Zero; barAppearance.BarSpacing = 1; LayerY1Collection[Y11].ChartTypeAppearance = barAppearance; LayerY1Collection[Y11].AxisX.TickmarkIntervalType =
barAppearance.BarSpacing = 1;
LayerY1Collection[Y11].ChartTypeAppearance = barAppearance;
AxisItemLabelFormat.ItemLabel; LayerY1Collection[Y11].AxisX.Labels.Orientation =
AxisItemLabelFormat.DataValue; }
AxisDataType.Numeric; y.DataType = A
y.DataType = A
xisDataType.String; y.SetLabelAxisType =
SetLabelAxisType.GroupBySeries; LayerY1Collection[Y11].AxisX.Labels.ItemFormat =
AxisItemLabelFormat.DataValue; LayerY1Collection[Y11].AxisX.Labels.ItemFormatString =
"<DATA_VALUE:00.0000>";
LayerY1Collection[Y11].AxisY.Labels.Orientation = TextOrientation.Custom; LayerY1Collection[Y11].AxisY.Labels.OrientationAngle = 0;
LayerY1Collection[Y11].AxisY.Labels.OrientationAngle = 0;
LayerY1Collection[Y11].AxisY.Labels.ItemFormat = AxisItemLabelFormat.ItemLabel;
BarChartAppearance barAppearance = new BarChartAppearance(chartPreview); barAppearance.NullHandling =
NullHandling.Zero; barAppearance.BarSpacing = 2; barAppearance.SeriesSpacing = 2;
barAppearance.BarSpacing = 2;
barAppearance.SeriesSpacing = 2;
LayerY1CollectioRaajn[Y11].ChartTypeAppearance = barAppearance; } }
Did you (or anyone from your team) find time to look into this issue?
Please let me know if you need any clarification regarding this issue.