Hello,
I create a BarColumnLine chart well but i want a stacked column + Line :( so i try to use composite chart.
Now, i create my first composite chart (stacked column + line chart) with the wizard designer. I fill the data source with the code behind :
ultraChart.Data.DataSource = table;
ultraChart.Data.DataBind();
but it fill only the stacked column chart not the line chart. How i specify the datasource link to the stacked chart and the line chart ?
Do you know if is it possible to create composite chart with wizard and fill different data source charts by the code behind ? If yes, how please?
Thank you.
Hi jc,
Thank you for posting in our forums!
You will need to set the DataSource for each series. You can see an example of this below:
NumericSeries ns = (NumericSeries)UltraChart1.CompositeChart.ChartComponent.Series.FromKey("seriesA");ns.Data.DataSource = GetData();
If you need further assistance with this, please let me know and I will be glad to help.
Thank you very much for your answer.
Another stuff, so when i try to create my composite chart(stackedColumn chart + line Chart) by the wizard designer chart, i get an issue after i added new chartType : ChartLayer "Line Chart" with the axis. Before this step, i created an another area with axisX(string) et axisY(Numeric) but i still get the error with axis.
I attach printscreens. Can you help me again ?
I would like create the composite chart by the wizard designer and fill serie by code behind.
Thank you for your help.
Nothing happens.
Regards,
Thank you for checking on that. After discussing this with my team, it looks like a new series will be needed for each numeric column in your data.
I am working on a sample that will help demonstrate how this can be done. I will have another update on my findings for you tomorrow.
Please find my sample attached that demonstrates how you can create the chart through the designer and bind data through codebehind for a StackedColumnChart and LineChart.
If you have any further questions with this, please let me know.
Hi,
Thanks you very much, it help me very much. I took your example but i still get an issue with the linedata.
I tried to fill the linedata with datasource but i get all my point in the same axix X = 0 (please see my attachment)
private XYSeries GetLineSeries() { XYSeries series = new XYSeries(); series.Label = "Line"; DataTable table = GetDataLine(); series.Data.DataSource = table; series.Data.LabelColumn = "region"; series.Data.ValueXColumn = "region"; series.Data.ValueYColumn = "TPBM"; series.DataBind(); //series.Points.Add(new XYDataPoint(1, 20, "ActiveX", false)); //series.Points.Add(new XYDataPoint(3, 80, "Java", false)); //series.Points.Add(new XYDataPoint(5, 60, ".NET", false)); series.PEs.Clear(); series.PEs.Add(new PaintElement(Color.Red)); return series; }
Thanks you very much for your help.
It looks like you may not be setting up the data or the axes correctly. Please see the documentation topics below for more information on this:
https://ko.infragistics.com/help/aspnet/chart-working-with-2d-line-chart-datahttps://ko.infragistics.com/help/aspnet/chart-axis-requirements-for-composite-charts
If you are using the line chart from my sample, take note of the Range values set for the "axisXLine" axis. This axis displays from 0-6 and the XYDataPoints I was using for the series have X values 1, 3, and 5 to appear at the correct spacing. There should be a better way to accomplish this depending on what data you have to work with that you can use the above documentation to help find.
If you need anything else, please let me know.
Thanks you, it works well.
Finally, i decided to add a legend for my composite chart (stackcolumnchart + linechart) by wizard. It added in my mark-up:
<Legends> <igchartprop:CompositeLegend ChartLayerList="stackColumnLayer|lineLayer"> </igchartprop:CompositeLegend> </Legends>
but nothing display.
Could you please help me again ?
You can alter the margins for the axes to provide more space. You would want to use something like the following settings to give some extra space above the Y axis.
axisY.Margin.Far.MarginType = LocationType.Percentage;axisY.Margin.Far.Value = 10;
If you need anything else, please let us know. Please be aware that I will be out of the office next week. It would better benefit you instead to create a new support case or forum thread for any new questions you may have.
Thanks you for your answer.
Another issue with composite chart, i have no space between top windows and title, i tried all things in designer without success.
See my attachment.
Can you help me again ?