Hello,I have couples Stackcolumn chart, they all work great except one that does not stack the data but only shows a chart like a regular column chart. I am very confused as I bind them the same wayAnyhow,Here is the Data that I bind to the chart:
DEFECT QtyA QtyBdefecta 8 0defectb 6 4defectc 0 3
Please let me know if you have any idea of what I could be doing wrong.
Thanks
It's hard to tell without seeing your code. Can you post the code you used to create these charts?
Binding to this data should be fairly simple:
DataTable dt = new DataTable();dt.Columns.Add("col1", typeof(int));dt.Columns.Add("col2", typeof(int));dt.Rows.Add(new object[] { 8, 0 });dt.Rows.Add(new object[] { 6, 4 });dt.Rows.Add(new object[] { 0, 3 });ultraChart1.ChartType = ChartType.StackColumnChart;ultraChart1.Data.DataSource = dt;ultraChart1.Data.DataBind();
Hi,The way I databind the chart is fairly simple:DataTable table4 = data.getClaimsByDefectByCommodityPerAcceptReject()UltraChart4.Data.DataSource = table4;UltraChart4.Data.DataBind();This query return table with 3 column, first column is the defect name and the 2 other column are values. I ran this query seperately and I am sure about the return.
Below is the html code :
<igchart:UltraChart ID="UltraChart4" runat="server" BackgroundImageFileName=""
BorderColor="Black" BorderWidth="1px"
EmptyChartText="Data Not Available. Please call UltraChart.Data.DataBind() after setting valid Data.DataSource"
Version="8.2" Height="557px" Width="1024px"
ChartType="StackColumnChart">
<TitleTop HorizontalAlign="Center"
Text="BMW E7x Warranty Parts analyzed at Fountain Inn GLOVE-BOX Status"
Font="Microsoft Sans Serif, 9.75pt, style=Bold">
</TitleTop>
<Tooltips Font-Bold="False" Font-Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False" />
<TitleBottom HorizontalAlign="Center" Extent="33"
Location="Bottom" Visible="False">
</TitleBottom>
<Data UseMinMax="True"></Data><TitleLeft HorizontalAlign="Center" Text="Claims" Visible="True" Extent="30"
Location="Left" Font="Microsoft Sans Serif, 9.75pt, style=Bold">
</TitleLeft>
<TitleRight Extent="30" Location="Right" Visible="True">
</TitleRight>
<ColorModel AlphaLevel="150" ModelStyle="CustomSkin">
<Skin ApplyRowWise="False">
<PEs>
<igchartprop:PaintElement ElementType="Gradient" Fill="Blue"
FillGradientStyle="ForwardDiagonal" FillOpacity="111"
FillStopColor="LightSkyBlue" />
<igchartprop:PaintElement ElementType="Gradient" Fill="108, 162, 36" FillGradientStyle="Horizontal"
FillStopColor="148, 244, 17">
</igchartprop:PaintElement>
</PEs>
</Skin>
</ColorModel>
<Axis>
<PE ElementType="None" Fill="Cornsilk" />
<X LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="True"
Extent="30">
<MajorGridLines AlphaLevel="255" Color="Gainsboro" DrawStyle="Dot"
Thickness="1" Visible="True" />
<MinorGridLines AlphaLevel="255" Color="LightGray" DrawStyle="Dot"
Thickness="1" Visible="False" />
<Labels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near"
ItemFormatString="<ITEM_LABEL>" Orientation="VerticalLeftFacing"
VerticalAlign="Center" Visible="False">
<SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Center"
Orientation="Horizontal" VerticalAlign="Center">
<Layout Behavior="Auto">
</Layout>
</SeriesLabels>
</Labels>
</X>
<Y LineThickness="1" TickmarkInterval="200" TickmarkStyle="Smart"
Visible="True" Extent="30">
<Labels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Far"
ItemFormatString="<DATA_VALUE:00.##>" Orientation="Horizontal"
VerticalAlign="Center">
<SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" FormatString=""
HorizontalAlign="Far" Orientation="Horizontal" VerticalAlign="Center">
</Y>
<Y2 LineThickness="1" TickmarkInterval="200" TickmarkStyle="Smart"
Visible="False">
<Labels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near"
<SeriesLabels Font="Verdana, 7pt" FontColor="Gray" FormatString=""
HorizontalAlign="Near" Orientation="Horizontal" VerticalAlign="Center">
</Y2>
<X2 LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart"
<Labels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Far"
<SeriesLabels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Far"
Orientation="VerticalLeftFacing" VerticalAlign="Center">
</X2>
<Z LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="False">
ItemFormatString="" Orientation="Horizontal" VerticalAlign="Center">
<SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near"
</Z>
<Z2 LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart"
<SeriesLabels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near"
</Z2>
</Axis>
<ColumnChart ColumnSpacing="1">
<ChartText>
<igchartprop:ChartTextAppearance ChartTextFont="Arial, 7pt" Column="-1"
ItemFormatString="<DATA_VALUE:0>" Row="-1" VerticalAlign="Far"
Visible="True" />
</ChartText>
</ColumnChart>
<Legend AlphaLevel="140" Location="Bottom" SpanPercentage="8" Visible="True">
<Margins Top="0" Bottom="0" Left="0" Right="0" />
</Legend>
</igchart:UltraChart>
There was an issue with the data , it is working now . Thanks so much for your assistance.
Regards
Try replacing the data from your database with dummy data that would otherwise create a stacked column chart. If this produces a stacked chart, then something's off in your data.
Try changing the chart type in code from StackedColumnChart to LineChart. If you still see a column chart, then you might have code somewhere else that erroneously sets the chart type.
Otherwise, if it's something less obvious, i'm afraid you'll have to start isolating and testing sections of the chart, because it's very difficult to speculate what could be wrong. I would also recommend testing with the latest version of the chart.
Let me know how it turns out.
Yes I tried and it works great. I also have other Stackedcolumn chart that work great.But for some reason this one is not working, I am really loosing my hair on this issue.
I tried also this way but I am still getting a column chart and not a Stackcolumn chart:
DataTable table4 = data.getClaimsByDefectByCommodityPerAcceptReject(DDL_commodity.SelectedValue, DDL_program.SelectedValue, Convert.ToDateTime(Tbx_start.Text), Convert.ToDateTime(Tbx_end.Text));
DataTable dt=new DataTable();dt.Columns.Add("col1", typeof(int));dt.Columns.Add("col2", typeof(int));dt.Columns.Add("col3", typeof(string));for (int i = 0; i < table4.Rows.Count; i++){ dt.Rows.Add(new object[] { table4.Rows[i][0], table4.Rows[i][1], table4.Rows[i][2] }); }
//dt.Rows.Add(new object[] { 8, 0, "a" });// dt.Rows.Add(new object[] { 6, 4,"b" });// dt.Rows.Add(new object[] { 0, 3,"c" });//UltraChart4.ChartType = ChartType.StackColumnChart;
UltraChart4.Data.DataSource = dt;UltraChart4.Data.DataBind();
I tried your sample code and the chart appears to be properly stacked. I'm not sure what the problem could be. Have you tried creating a new chart control and plugging in the sample code I posted earlier?