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
Composite Chart: X-Axis Labels not wrapping and Y-Axis labels not showing correctly
posted

I've included the screenshot, html & code for my composite chart with column and line. I'm having two issues, my x-axis labels are wrapping and my Y-Axis should have the scale for the columns, which it does, on the left, and the scale for the line, which it doesn't on the right. I can't seem to get either to display correctly. My extent is office, but I'll adjust that afterward. Thanks for you help!

<igchart:UltraChart ID="igChart5" runat="server" BackgroundImageFileName="" BorderColor="Black"
 BorderWidth="1px" ChartType="ColumnLineChart" EmptyChartText="Data Not Available"
 SplineAreaChart-LineDrawStyle="Solid" Style="position: relative" Version="8.1">
 <Effects>
  <Effects>
   <igchartprop:GradientEffect>
   </igchartprop:GradientEffect>
  </Effects>
 </Effects>
 <ColorModel AlphaLevel="150" ColorBegin="Green" ColorEnd="DarkRed" ModelStyle="CustomRandom">
 </ColorModel>
 <Axis>
  <PE ElementType="None" Fill="cornsilk" />
  <X LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="True">
   <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="&lt;ITEM_LABEL&gt;"
    Orientation="VerticalLeftFacing" VerticalAlign="Center">
    <SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near" Orientation="VerticalLeftFacing"
     VerticalAlign="Center">
     <Layout Behavior="UseCollection">
     </Layout>
    </SeriesLabels>
    <Layout Behavior="Auto">
    </Layout>
   </Labels>
  </X>
  <Y LineThickness="1" TickmarkInterval="20" TickmarkStyle="Smart" Visible="True">
   <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="Far" ItemFormatString="&lt;DATA_VALUE:00.##&gt;"
    Orientation="Horizontal" VerticalAlign="Center">
    <SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" FormatString="" HorizontalAlign="Far"
     Orientation="Horizontal" VerticalAlign="Center">
     <Layout Behavior="Auto">
     </Layout>
    </SeriesLabels>
    <Layout Behavior="Auto">
    </Layout>
   </Labels>
  </Y>
  <Y2 LineThickness="1" TickmarkInterval="10" TickmarkStyle="Smart" Visible="True">
   <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="Gray" HorizontalAlign="Near" ItemFormatString="&lt;DATA_VALUE:00.##&gt;"
    Orientation="Horizontal" VerticalAlign="Center">
    <SeriesLabels Font="Verdana, 7pt" FontColor="Gray" FormatString="" HorizontalAlign="Near"
     Orientation="Horizontal" VerticalAlign="Center">
     <Layout Behavior="Auto">
     </Layout>
    </SeriesLabels>
    <Layout Behavior="Auto">
    </Layout>
   </Labels>
  </Y2>
  <X2 LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="True">
   <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="Gray" HorizontalAlign="Far" ItemFormatString="&lt;ITEM_LABEL&gt;"
    Orientation="VerticalLeftFacing" VerticalAlign="Center">
    <SeriesLabels Font="Verdana, 7pt" FontColor="Gray" FormatString="" HorizontalAlign="Far"
     Orientation="VerticalLeftFacing" VerticalAlign="Center">
     <Layout Behavior="Auto">
     </Layout>
    </SeriesLabels>
    <Layout Behavior="Auto">
    </Layout>
   </Labels>
  </X2>
  <Z LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="False">
   <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=""
    Orientation="Horizontal" VerticalAlign="Center" Visible="False">
    <SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near" Orientation="Horizontal"
     VerticalAlign="Center">
     <Layout Behavior="Auto">
     </Layout>
    </SeriesLabels>
    <Layout Behavior="Auto">
    </Layout>
   </Labels>
  </Z>
  <Z2 LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="False">
   <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="Gray" HorizontalAlign="Near" ItemFormatString=""
    Orientation="Horizontal" VerticalAlign="Center" Visible="False">
    <SeriesLabels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near" Orientation="Horizontal"
     VerticalAlign="Center">
     <Layout Behavior="Auto">
     </Layout>
    </SeriesLabels>
    <Layout Behavior="Auto">
    </Layout>
   </Labels>
  </Z2>
 </Axis>
</igchart:UltraChart>

  iColChart.Visible = True
  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
  Dim aLine1 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
  xAxisColumn.Labels.Orientation = Styles.TextOrientation.VerticalLeftFacing
  xAxisColumn.Labels.SeriesLabels.Orientation = Styles.TextOrientation.VerticalLeftFacing
  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 = 2
  xAxisLine.Margin.Far.MarginType = Styles.LocationType.Percentage
  xAxisLine.Margin.Far.Value = 2
  xAxisColumn.Labels.Orientation = Styles.TextOrientation.VerticalLeftFacing
  xAxisColumn.Labels.SeriesLabels.Orientation = Styles.TextOrientation.VerticalLeftFacing
  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 = 100
  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 = 20
  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


  aColumn = GetChartColumnLineSeriesArray(userProfile, choice, 3)
  Dim seriesColumn As New Appearance.NumericSeries
  seriesColumn.Points.Add(New Appearance.NumericDataPoint(aColumn(0), "No Entry for Annual Meeting", False))
  seriesColumn.Points.Add(New Appearance.NumericDataPoint(aColumn(1), "General Required Training", False))
  seriesColumn.Points.Add(New Appearance.NumericDataPoint(aColumn(2), "Certificates not on File", False))
  seriesColumn.Points.Add(New Appearance.NumericDataPoint(aColumn(3), "No Office Review", False))
  seriesColumn.Points.Add(New Appearance.NumericDataPoint(aColumn(4), "Other", False))

  aLine = GetChartColumnLineSeriesArray(userProfile, choice, 4)
  Dim seriesLine As New Appearance.NumericSeries
  seriesLine.Points.Add(New Appearance.NumericDataPoint(aLine(0), "No Entry for Annual Meeting", False))
  seriesLine.Points.Add(New Appearance.NumericDataPoint(aLine(1), "General Required Training", False))
  seriesLine.Points.Add(New Appearance.NumericDataPoint(aLine(2), "Certificates not on File", False))
  seriesLine.Points.Add(New Appearance.NumericDataPoint(aLine(3), "No Office Review", False))
  seriesLine.Points.Add(New Appearance.NumericDataPoint(aLine(4), "Other", False))

  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 LineLayer2 As New Appearance.ChartLayerAppearance
  LineLayer2.ChartType = Styles.ChartType.LineChart
  LineLayer2.AxisX = xAxisLine
  LineLayer2.AxisY = yAxisColumn
  LineLayer2.ChartArea = area
  iColChart.CompositeChart.ChartLayers.Add(LineLayer2)

  iColChart.Data.ZeroAligned = True
  iColChart.Data.MaxValue = 100
  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.Bounds = New Rectangle(10, 285, 375, 35)