Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Numeric values are not displayed in infragistics ultrawinchart
posted

Hi.

I have an issue that I can't solve.

I've created winultrachart with two layers. One of them is ColumnChart, the second one is Linechart.

The line chart is populated nice if I have only integer values. But if some of values are not integer the disappears from the chart.

Please help!!!

Here's the datatable, representing values for the linechart:

  SC1 35.5
  SC2 35.5
  SC3 62.875
  SC4 90.25
  SC5 70.375
  SC6 50.5
  SC7 63.25
  SC8 76
  SC9 57.125
  SC10 38.25
  SC11 38.25

Here's the code:

Me.chrtCCFPM.ChartType = ChartType.Composite

Me.chrtCCFPM.CompositeChart.Series.Clear()

Me.chrtCCFPM.CompositeChart.ChartLayers.Clear()

If blnFirstLoad = False Then

Me.chrtCCFPM.CompositeChart.ChartAreas.Item(0).Axes.Clear()

End If

Me.chrtCCFPM.CompositeChart.ChartAreas.Clear()

Me.chrtCCFPM.DataSource = Nothing

Dim myChartArea As New ChartArea()

Me.chrtCCFPM.CompositeChart.ChartAreas.Add(myChartArea)

Dim axisX As New AxisItem()

axisX.OrientationType = AxisNumber.X_Axis

axisX.DataType = AxisDataType.String

axisX.SetLabelAxisType = SetLabelAxisType.GroupBySeries

axisX.Labels.Visible = False

Dim axisXLine As New AxisItem()

axisXLine.OrientationType = AxisNumber.X_Axis

axisXLine.DataType = AxisDataType.String

axisXLine.SetLabelAxisType = SetLabelAxisType.ContinuousData

axisXLine.Labels.Visible = False

Dim axisY As New AxisItem()

axisY.RangeMin = 0

axisY.RangeMax = 100

axisY.RangeType = AxisRangeType.Custom

axisY.OrientationType = AxisNumber.Y_Axis

axisY.DataType = AxisDataType.Numeric

axisY.Labels.ItemFormatString = "<DATA_VALUE:0.#>"

 

Dim axisYLine As New AxisItem()

axisYLine.RangeMin = 0

axisYLine.RangeMax = 100

axisYLine.RangeType = AxisRangeType.Custom

axisYLine.OrientationType = AxisNumber.Y_Axis

axisYLine.DataType = AxisDataType.Numeric

 

myChartArea.Axes.Add(axisX)

myChartArea.Axes.Add(axisY)

myChartArea.Axes.Add(axisXLine)

 

For i = 0 To dsChartDtata.Tables.Count - 2

Dim series As New NumericSeries()

series.Label = marrSeriesNames(i + 1)

series.Data.DataSource = dS.Tables(i)

series.Data.LabelColumn = "Label"

series.Data.ValueColumn = "Value"

Me.chrtCCFPM.CompositeChart.Series.Add(series)

Next

'Line series

Dim seriesLine As New NumericSeries()

seriesLine.Label = String.Empty

seriesLine.Data.DataSource = dS.Tables(dsChartDtata.Tables.Count - 1)

seriesLine.Data.LabelColumn = "Label"

seriesLine.Data.ValueColumn = "Value"

Me.chrtCCFPM.CompositeChart.Series.Add(seriesLine)

 

Dim myColumnLayer As New ChartLayerAppearance()

myColumnLayer.ChartType = ChartType.ColumnChart

myColumnLayer.ChartArea = myChartArea

myColumnLayer.AxisX = axisX

myColumnLayer.AxisY = axisY

For i = 0 To Me.chrtCCFPM.CompositeChart.Series.Count - 2

myColumnLayer.Series.Add(Me.chrtCCFPM.CompositeChart.Series(i))

Next

Me.chrtCCFPM.CompositeChart.ChartLayers.Add(myColumnLayer)

Dim myLineLayer As New ChartLayerAppearance()

myLineLayer.ChartType = ChartType.LineChart

myLineLayer.ChartArea = myChartArea

myLineLayer.AxisX = axisXLine

myLineLayer.AxisY = axisY

DirectCast(myLineLayer.ChartTypeAppearance, LineChartAppearance).MidPointAnchors = False

myLineLayer.Series.Add(Me.chrtCCFPM.CompositeChart.Series(dsChartDtata.Tables.Count - 1))  --the dataset above is used here

 

Me.chrtCCFPM.CompositeChart.ChartLayers.Add(myColumnLayer)

Me.chrtCCFPM.CompositeChart.ChartLayers.Add(myLineLayer)

 

axisX.Extent = 12

axisXLine.Extent = 12

 

axisY.Extent = 15

axisX.MajorGridLines.Visible = False

axisX.MinorGridLines.Visible = False

axisXLine.MajorGridLines.Visible = False

axisXLine.MinorGridLines.Visible = False

 

axisY.MajorGridLines.Visible = False

axisY.MinorGridLines.Visible = False

axisYLine.MajorGridLines.Visible = False

axisYLine.MinorGridLines.Visible = False