I have attached the Chart image where i have problem in series chart binding and also find the below coding for series binding which i have used kindly go through the code and chart and help me as soon as possible
problem:
In the stack area chart for a new bar doesnt start from the zero position.
Code:-
dtSeries = oDs.Tables(1).Clone
drRow = dtSeries.NewRow
drRow(1) = oDs.Tables(1).Rows(i)("DEMAND_ORDER_ID")
drRow(3) = oDs.Tables(1).Rows(i)("ENDDTE")
dtSeries.Rows.Add(drRow)
drRow = Nothing
drRow(3) = oDs.Tables(1).Rows(i)("STARTDTE")
If dtSeries.Rows.Count > 0 Then
series = GetNumericSeriesBound1(dtSeries)
myColumnLayer1.Series.Add(series)
End If
Next
series.Label = table.Rows(0)(0)
series.Key = table.Rows(0)(0)
' this code populates the series from an external data source
series.Data.DataSource = table
series.Data.TimeValueColumn = "STARTDTE"
'series.Data.LabelColumn = "Label Column"
series.Data.ValueColumn = "MFG_QTY_IN_BLOCK"
End Function
Thanks in Advance,
Suresh
sorry, but i can't figure out what's going on based on the code you provided. all i can see is how you generate your data. do you have sample code or an explanation of how you've set up the composite chart?
Yes i have written the code for creating the composite chart
Dim strBlockID As String
Dim dtStartDate As DateTime
Dim iCount, iInnerCount, iOuterCount As Integer
Dim oDs As DataSet
Dim drRow As DataRow
Dim axisX, axisY As AxisItem
Dim myChartArea As ChartArea
Dim seriesA As NumericTimeSeries
Dim series As New NumericTimeSeries
Dim dtTable, dtChart As DataTable
Dim objBoxAnnotation As New Infragistics.UltraChart.Resources.Appearance.BoxAnnotation
Dim myColumnLayer, myColumnLayer1 As ChartLayerAppearance
Try
' MessageBox.Show(DateTime.Now.ToString("MM/dd/yy H:mm"))
oDs = SqlHelper.ExecuteDataset(strConnectionString, CommandType.StoredProcedure, "TEST_CHART")
myChartArea = New ChartArea()
'------- Chart Back Ground Color ---------
myChartArea.PE.Fill = Color.LightCyan
axisX = New AxisItem()
axisY = New AxisItem()
' myColumnLayer = New ChartLayerAppearance()
' myColumnLayer1 = New ChartLayerAppearance()
Me.UltraChart1.ChartType = ChartType.Composite
Me.UltraChart1.CompositeChart.ChartAreas.Add(myChartArea)
'-------- Setting the Width and Height of Chart --------
Panel1.Width = 1000
Panel1.Height = 650
Panel1.AutoScroll = True
Me.UltraChart1.Width = 1500
Me.UltraChart1.Height = 600
Me.UltraChart1.AcceptsFocus = False
'----- Defining X axis ----
axisX.OrientationType = AxisNumber.X_Axis
axisX.DataType = AxisDataType.Time
' axisX.Labels.SeriesLabels.Layout.Behavior = Infragistics.UltraChart.[Shared].Styles.AxisLabelLayoutBehaviors.[Auto]
axisX.TickmarkStyle = AxisTickStyle.Percentage
'axisX.TickmarkInterval = DateTime.Parse("6/2/2008").Ticks - DateTime.Parse("6/5/2008").Ticks
axisX.Extent = 100
axisX.Labels.Visible = False
axisX.SetLabelAxisType = SetLabelAxisType.GroupBySeries
axisX.Labels.ItemFormatString = "<ITEM_LABEL>"
axisX.Labels.Orientation = TextOrientation.VerticalLeftFacing
myChartArea.Axes.Add(axisX)
'----- Defining Y axis ------
axisY.OrientationType = AxisNumber.Y_Axis
axisY.Extent = 150
axisY.RangeType = AxisRangeType.Custom
axisY.TickmarkInterval = 10000
axisY.RangeMax = 260000
axisY.TickmarkStyle = AxisTickStyle.DataInterval
axisY.DataType = AxisDataType.Numeric
axisY.Labels.ItemFormatString = "<DATA_VALUE:00.##>"
axisX.MajorGridLines.Visible = False
axisX.MinorGridLines.Visible = False
axisY.MajorGridLines.Visible = False
axisY.MinorGridLines.Visible = False
myChartArea.Axes.Add(axisY)
dtTable = oDs.Tables(0).Copy
dtChart = fnEmptyRow(dtTable)
seriesA = GetNumericTimeSeriesBoundStepGraph(dtChart)
'----- Defining a Step Area Chart -------
Dim Paint As Infragistics.UltraChart.Resources.Appearance.PaintElement
Paint = fnColor(dtChart.Rows(0)("COLOR"))
seriesA.PEs.AddRange(New Infragistics.UltraChart.Resources.Appearance.PaintElement() {Paint})
myColumnLayer = New ChartLayerAppearance()
myColumnLayer.ChartType = ChartType.StepAreaChart
myColumnLayer.ChartArea = myChartArea
myColumnLayer.AxisX = axisX
myColumnLayer.AxisY = axisY
For i As Integer = 0 To oDs.Tables(1).Rows.Count - 1 dtSeries = oDs.Tables(1).Clone
drRow(0) = oDs.Tables(1).Rows(i)("Block_Id") drRow(1) = oDs.Tables(1).Rows(i)("DEMAND_ORDER_ID")
drRow(2) = oDs.Tables(1).Rows(i)("STARTDTE") drRow(3) = oDs.Tables(1).Rows(i)("ENDDTE")
drRow(4) = oDs.Tables(1).Rows(i)("MFG_QTY_IN_BLOCK")drRow(5) = oDs.Tables(1).Rows(i)("BLOCK_SIZE") dtSeries.Rows.Add(drRow)
drRow(2) = oDs.Tables(1).Rows(i)("ENDDTE") drRow(3) = oDs.Tables(1).Rows(i)("STARTDTE")
Me.UltraChart1.CompositeChart.Series.Add(series) End If
Private Function GetNumericSeriesBound1(ByVal table As DataTable) As NumericTimeSeriesDim series As New NumericTimeSeries series.Label = table.Rows(0)(0)
Return series End Function
your stated problem was "In the stack area chart for a new bar doesnt start from the zero position."
in your code, i only see one layer, "myColumnLayer," and it has its ChartType set to StepAreaChart.
is this the layer with the problem? and if so, where on the chart is the zero position?