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
4110
Different colored lines in composite chart
posted

I have a composite chart with columns and two different lines as follows

   iColChart.ChartType = Styles.ChartType.Composite
  Dim area As New Appearance.ChartArea
  Dim xAxisColumn As New Appearance.AxisItem
  Dim aColumn As String() = Nothing
  Dim aLine As String() = Nothing

  xAxisColumn.axisNumber = Styles.AxisNumber.X_Axis
  xAxisColumn.DataType = Styles.AxisDataType.String
  xAxisColumn.SetLabelAxisType = SetLabelAxisType.GroupBySeries
  xAxisColumn.MajorGridLines.Visible = False
  xAxisColumn.MinorGridLines.Visible = False
  xAxisColumn.Labels.ItemFormat = Styles.AxisItemLabelFormat.ItemLabel
  area.Axes.Add(xAxisColumn)

  Dim xAxisLine As New Appearance.AxisItem
  xAxisLine.axisNumber = Styles.AxisNumber.X_Axis
  xAxisLine.DataType = Styles.AxisDataType.String
  xAxisLine.TickmarkInterval = 0.1
  xAxisLine.SetLabelAxisType = SetLabelAxisType.ContinuousData
  xAxisLine.MajorGridLines.Visible = False
  xAxisLine.MinorGridLines.Visible = False
  xAxisLine.Margin.Near.MarginType = Styles.LocationType.Percentage
  xAxisLine.Margin.Near.Value = 7
  xAxisLine.Margin.Far.MarginType = Styles.LocationType.Percentage
  xAxisLine.Margin.Far.Value = 7
  area.Axes.Add(xAxisLine)

  Dim yAxisColumn As New Appearance.AxisItem
  yAxisColumn.axisNumber = Styles.AxisNumber.Y_Axis
  yAxisColumn.DataType = Styles.AxisDataType.Numeric
  yAxisColumn.TickmarkInterval = 0.1
  yAxisColumn.RangeMax = 7
  yAxisColumn.RangeMin = 0
  yAxisColumn.RangeType = Styles.AxisRangeType.Custom
  yAxisColumn.TickmarkStyle = Styles.AxisTickStyle.Smart
  yAxisColumn.MajorGridLines.Visible = False
  yAxisColumn.MinorGridLines.Visible = False
  yAxisColumn.Labels.ItemFormat = Styles.AxisItemLabelFormat.DataValue
  area.Axes.Add(yAxisColumn)

  Dim yAxisLine As New Appearance.AxisItem
  yAxisLine.axisNumber = Styles.AxisNumber.Y2_Axis
  yAxisLine.DataType = Styles.AxisDataType.Numeric
  yAxisLine.TickmarkInterval = 0.1
  yAxisLine.RangeMax = 7
  yAxisLine.RangeMin = 0
  yAxisColumn.RangeType = Styles.AxisRangeType.Custom
  yAxisLine.TickmarkStyle = Styles.AxisTickStyle.Smart
  yAxisLine.MajorGridLines.Visible = False
  yAxisLine.MinorGridLines.Visible = False
  area.Axes.Add(yAxisLine)
  area.Bounds = New Rectangle(0, 10, 100, 90)
  area.BoundsMeasureType = Styles.MeasureType.Percentage


  Dim seriesColumn As New Appearance.NumericSeries
  aColumn = GetChartColumnSeriesArray(userProfile, choice)
  seriesColumn.Points.Add(New Appearance.NumericDataPoint(aColumn(0), "1st Qtr", False))
  seriesColumn.Points.Add(New Appearance.NumericDataPoint(aColumn(1), "2nd Qtr", False))
  seriesColumn.Points.Add(New Appearance.NumericDataPoint(aColumn(2), "3rd Qtr", False))
  tblChart4.Rows(1).Cells(1).Text = aColumn(0)
  tblChart4.Rows(1).Cells(2).Text = aColumn(1)
  tblChart4.Rows(1).Cells(3).Text = aColumn(2)

  aLine = GetChartLineSeriesArray(userProfile, choice)
  Dim seriesLine As New Appearance.NumericSeries
  seriesLine.Points.Add(New Appearance.NumericDataPoint(aLine(0), "1st Qtr", False))
  seriesLine.Points.Add(New Appearance.NumericDataPoint(aLine(1), "2nd Qtr", False))
  seriesLine.Points.Add(New Appearance.NumericDataPoint(aLine(2), "3rd Qtr", False))
  tblChart4.Rows(2).Cells(1).Text = aLine(0)
  tblChart4.Rows(2).Cells(2).Text = aLine(1)
  tblChart4.Rows(2).Cells(3).Text = aLine(2)

  Dim seriesLine2 As New Appearance.NumericSeries
  seriesLine2.Points.Add(New Appearance.NumericDataPoint(4.5, "1st Qtr", False))
  seriesLine2.Points.Add(New Appearance.NumericDataPoint(4.5, "2nd Qtr", False))
  seriesLine2.Points.Add(New Appearance.NumericDataPoint(4.5, "3rd Qtr", False))
  tblChart4.Rows(2).Cells(1).Text = 4.5
  tblChart4.Rows(2).Cells(2).Text = 4.5
  tblChart4.Rows(2).Cells(3).Text = 4.5

  iColChart.CompositeChart.Series.Add(seriesColumn)
  iColChart.CompositeChart.Series.Add(seriesLine)

  Dim columnLayer As New Appearance.ChartLayerAppearance
  columnLayer.ChartType = Styles.ChartType.ColumnChart
  ColumnLayer.AxisX = xAxisColumn
  ColumnLayer.AxisY = yAxisColumn
  ColumnLayer.ChartArea = area
  ColumnLayer.Series.Add(seriesColumn)
  iColChart.CompositeChart.ChartLayers.Add(columnLayer)

  Dim LineLayer As New Appearance.ChartLayerAppearance
  LineLayer.ChartType = Styles.ChartType.LineChart
  LineLayer.AxisX = xAxisLine
  LineLayer.AxisY = yAxisColumn
  LineLayer.ChartArea = area
  LineLayer.Series.Add(seriesLine)
  iColChart.CompositeChart.ChartLayers.Add(LineLayer)

  Dim LineLayer2 As New Appearance.ChartLayerAppearance
  LineLayer2.ChartType = Styles.ChartType.LineChart
  LineLayer2.AxisX = xAxisLine
  LineLayer2.AxisY = yAxisColumn
  LineLayer2.ChartArea = area
  LineLayer2.Series.Add(seriesLine2)
  iColChart.CompositeChart.ChartLayers.Add(LineLayer2)

  iColChart.Data.ZeroAligned = True
  iColChart.Data.MaxValue = 7
  iColChart.Data.MinValue = 0
  iColChart.ColorModel.ModelStyle = Infragistics.UltraChart.Shared.Styles.ColorModels.CustomLinear
  iColChart.ColorModel.CustomPalette = New Color() {Color.Blue, Color.Yellow, Color.Green, Color.Purple}
  iColChart.Section508Compliant = True
  iColChart.TitleTop.Text = choice
  iColChart.CompositeChart.ChartAreas.Add(area)

  Dim columnAppearance As New Appearance.ColumnChartAppearance
  columnAppearance.ColumnSpacing = 1
  columnLayer.ChartTypeAppearance = columnAppearance

  Dim legend As New Appearance.CompositeLegend
  iColChart.CompositeChart.Legends.Add(legend)
  legend.ChartLayers.Add(columnLayer)
  legend.ChartLayers.Add(LineLayer)
  legend.Bounds = New Rectangle(10, 245, 375, 17)
 

with the resulting chart

 

I can't seem to change the 2nd line to a different color. Using the FillSceneGraph, I am only able to change polyline, which changes both, but what I want is for each line to have a different color. Is there a way to do this?