I am trying to change the color of the top part of a data column in a column chart where the data column does not go to the maximum of the chart's y-axis. Is this possible to do?
See attached for the example.
Thanks.
Hello, Curtis.
I'm attaching a sample that contains the code you have sent me and I'm also attaching a screenshot with the result. When you run the sample you should see the same result. In the sample I'm using a build that is 16.1.20161.1. You just need to replace that with the version you have installed on your computer and it should work. Please try it and I will wait for your feedback.
Best regards,
Nikolay Alipiev
Please see below for the front end:
<ig:UltraChart id="UltraChart1" runat="server" Width="1200px" ChartType="ColumnChart" EmptyChartText="<%$ Resources:CDWResource, Graph_not_available %>" Height="500px"> <ColumnChart SeriesSpacing="1" ColumnSpacing="1"></ColumnChart> <ColorModel ColorBegin="DarkGoldenrod" ColorEnd="Navy" AlphaLevel="150" ModelStyle="PureRandom" Grayscale="False" Scaling="None"> <Skin ApplyRowWise="False" >
</Skin> </ColorModel> <TitleTop Font="Microsoft Sans Serif, 7.8pt" Visible="True" Text="Infragistics Sales for <TODAY_DATE:MM/dd/yy>" FontSizeBestFit="False" Orientation="VerticalLeftFacing" WrapText="False" Extent="33" FontColor="Black" HorizontalAlign="Near" VerticalAlign="Center" Location="Top"> <Margins Bottom="5" Left="5" Top="5" Right="5"></Margins> </TitleTop> <Border CornerRadius="0" DrawStyle="Solid" Raised="False" Color="Black" Thickness="1"></Border> <TitleBottom Font="Microsoft Sans Serif, 7.8pt" Visible="True" Text="Copyright 2002 Infragistics Inc." FontSizeBestFit="False" Orientation="VerticalLeftFacing" WrapText="False" Extent="26" FontColor="Black" HorizontalAlign="Far" VerticalAlign="Center" Location="Bottom"> <Margins Bottom="5" Left="5" Top="5" Right="5"></Margins> </TitleBottom> <Axis BackColor="Cornsilk"> <Y LineEndCapStyle="NoAnchor" LineDrawStyle="Solid" Visible="True" RangeMin="0" LineColor="Black" RangeType="Automatic" TickmarkInterval="0" LineThickness="2" Extent="80" LogBase="10" RangeMax="0" TickmarkStyle="DataInterval" TickmarkPercentage="10" NumericAxisType="Linear" > <StripLines Interval="2" Visible="False"> <PE Fill="Transparent" StrokeOpacity="255" FillGradientStyle="None" ElementType="SolidFill" FillOpacity="255" FillStopColor="Transparent" Hatch="None" FillStopOpacity="255" ImageWrapMode="Tile" ImageFitStyle="Tiled" StrokeWidth="1" Stroke="Transparent"></PE> </StripLines> <ScrollScale Scale="1" Scroll="0" Height="10" Width="15" Visible="False"></ScrollScale> <Labels Font="Microsoft Sans Serif, 7.8pt" Visible="True" HorizontalAlign="Far" FontSizeBestFit="False" SeriesFormatString="<SERIES_LABEL>" Orientation="Horizontal" ItemFormatString="<DATA_VALUE:00.00>" FontColor="Black" ItemFormat="DataValue" VerticalAlign="Center" WrapText="False" ClipText="False"></Labels> <MajorGridLines AlphaLevel="80" DrawStyle="Dot" Color="80, 211, 211, 211" Visible="True" Thickness="1"></MajorGridLines> <MinorGridLines AlphaLevel="165" DrawStyle="Dot" Color="165, 211, 211, 211" Visible="False" Thickness="1"></MinorGridLines> </Y> <Y2 LineEndCapStyle="NoAnchor" LineDrawStyle="Solid" Visible="True" RangeMin="0" LineColor="Black" RangeType="Automatic" TickmarkInterval="0" LineThickness="2" Extent="80" LogBase="10" RangeMax="0" TickmarkStyle="Percentage" TickmarkPercentage="10" NumericAxisType="Linear"> <StripLines Interval="2" Visible="False"> <PE Fill="Transparent" StrokeOpacity="255" FillGradientStyle="None" ElementType="SolidFill" FillOpacity="255" FillStopColor="Transparent" Hatch="None" FillStopOpacity="255" ImageWrapMode="Tile" ImageFitStyle="Tiled" StrokeWidth="1" Stroke="Transparent"></PE> </StripLines> <ScrollScale Scale="1" Scroll="0" Height="10" Width="15" Visible="False"></ScrollScale> <Labels Font="Microsoft Sans Serif, 7.8pt" Visible="True" HorizontalAlign="Near" FontSizeBestFit="False" SeriesFormatString="" Orientation="VerticalLeftFacing" ItemFormatString="" FontColor="Black" ItemFormat="None" VerticalAlign="Center" WrapText="False" ClipText="False"></Labels> <MajorGridLines AlphaLevel="255" DrawStyle="Dot" Color="Gainsboro" Visible="True" Thickness="1"></MajorGridLines> <MinorGridLines AlphaLevel="255" DrawStyle="Dot" Color="LightGray" Visible="False" Thickness="1"></MinorGridLines> </Y2> <X2 LineEndCapStyle="NoAnchor" LineDrawStyle="Solid" Visible="True" RangeMin="0" LineColor="Black" RangeType="Automatic" TickmarkInterval="0" LineThickness="2" Extent="80" LogBase="10" RangeMax="0" TickmarkStyle="Percentage" TickmarkPercentage="10" NumericAxisType="Linear"> <StripLines Interval="2" Visible="False"> <PE Fill="Transparent" StrokeOpacity="255" FillGradientStyle="None" ElementType="SolidFill" FillOpacity="255" FillStopColor="Transparent" Hatch="None" FillStopOpacity="255" ImageWrapMode="Tile" ImageFitStyle="Tiled" StrokeWidth="1" Stroke="Transparent"></PE> </StripLines> <ScrollScale Scale="1" Scroll="0" Height="10" Width="15" Visible="False"></ScrollScale> <Labels Font="Microsoft Sans Serif, 7.8pt" Visible="True" HorizontalAlign="Near" FontSizeBestFit="False" SeriesFormatString="" Orientation="VerticalLeftFacing" ItemFormatString="" FontColor="Black" ItemFormat="None" VerticalAlign="Center" WrapText="False" ClipText="False"></Labels> <MajorGridLines AlphaLevel="255" DrawStyle="Dot" Color="Gainsboro" Visible="True" Thickness="1"></MajorGridLines> <MinorGridLines AlphaLevel="255" DrawStyle="Dot" Color="LightGray" Visible="False" Thickness="1"></MinorGridLines> </X2> <Z LineEndCapStyle="NoAnchor" LineDrawStyle="Solid" Visible="True" RangeMin="0" LineColor="Black" RangeType="Automatic" TickmarkInterval="0" LineThickness="2" Extent="80" LogBase="10" RangeMax="0" TickmarkStyle="DataInterval" TickmarkPercentage="10" NumericAxisType="Linear"> <StripLines Interval="2" Visible="False"> <PE Fill="Transparent" StrokeOpacity="255" FillGradientStyle="None" ElementType="SolidFill" FillOpacity="255" FillStopColor="Transparent" Hatch="None" FillStopOpacity="255" ImageWrapMode="Tile" ImageFitStyle="Tiled" StrokeWidth="1" Stroke="Transparent"></PE> </StripLines> <ScrollScale Scale="1" Scroll="0" Height="10" Width="15" Visible="False"></ScrollScale> <Labels Font="Microsoft Sans Serif, 7.8pt" Visible="True" HorizontalAlign="Near" FontSizeBestFit="False" SeriesFormatString="<SERIES_LABEL>" Orientation="Horizontal" ItemFormatString="<DATA_VALUE:00.00>" FontColor="Black" ItemFormat="DataValue" VerticalAlign="Center" WrapText="False" ClipText="False"></Labels> <MajorGridLines AlphaLevel="80" DrawStyle="Dot" Color="80, 211, 211, 211" Visible="True" Thickness="1"></MajorGridLines> <MinorGridLines AlphaLevel="165" DrawStyle="Dot" Color="165, 211, 211, 211" Visible="False" Thickness="1"></MinorGridLines> </Z> <X LineEndCapStyle="NoAnchor" LineDrawStyle="Solid" Visible="True" RangeMin="0" LineColor="Black" RangeType="Automatic" TickmarkInterval="5" LineThickness="1" Extent="80" LogBase="10" RangeMax="60" NumericAxisType="Linear"> <StripLines Interval="1" Visible="True"> <PE FillGradientStyle="None" FillOpacity="255" FillStopOpacity="255" ElementType="SolidFill" Fill="255, 224, 192" Hatch="None" Texture="GrainA" ImageFitStyle="StretchedFit" FillStopColor="Transparent" StrokeOpacity="255" ImagePath="" Stroke="Black" StrokeWidth="0" ImageWrapMode="Tile" TextureApplication="Normal"></PE> </StripLines> <ScrollScale Scale="1" Scroll="0" Height="10" Width="15" Visible="False"></ScrollScale> <Labels ItemFormatString="<ITEM_LABEL>" VerticalAlign="Center" WrapText="False" FontSizeBestFit="False" SeriesFormatString="<SERIES_LABEL>" ClipText="True" Font="Verdana, 7pt" Flip="False" ItemFormat="ItemLabel" FontColor="Black" Orientation="VerticalLeftFacing" Visible="True" OrientationAngle="0" HorizontalAlign="Near"> <SeriesLabels Font="Verdana, 7pt" Visible="True" HorizontalAlign="Center" FontSizeBestFit="False" ClipText="True" FormatString="<SERIES_LABEL>" Orientation="Horizontal" WrapText="False" Flip="False" FontColor="Black" VerticalAlign="Center" OrientationAngle="0"> </SeriesLabels> </Labels> <MajorGridLines AlphaLevel="255" DrawStyle="Dot" Color="Gainsboro" Visible="True" Thickness="1"></MajorGridLines> <MinorGridLines AlphaLevel="255" DrawStyle="Dot" Color="LightGray" Visible="False" Thickness="1"></MinorGridLines> <TimeAxisStyle TimeAxisStyle="Continuous"></TimeAxisStyle> <Margin> <Far MarginType="Percentage" Value="0"></Far> <Near MarginType="Percentage" Value="0"></Near> </Margin> </X> </Axis> <Data DataMember="" SwapRowsAndColumns="False" UseMinMax="False" UseRowLabelsColumn="False" MinValue="-1.7976931348623157E+308" RowLabelsColumn="-1" ZeroAligned="True" MaxValue="1.7976931348623157E+308"></Data> <Legend Font="Microsoft Sans Serif, 7.8pt" Visible="False" AlphaLevel="150" BorderThickness="1" BorderStyle="Solid" SpanPercentage="10" BorderColor="Navy" FontColor="Black" BackgroundColor="FloralWhite" DataAssociation="DefaultData" Location="Bottom" FormatString="<ITEM_LABEL>"> <Margins Bottom="5" Left="5" Top="5" Right="5"></Margins> </Legend> <Tooltips BorderThickness="1" FormatString="<DATA_VALUE:00.00>" EnableFadingEffect="False" Format="Custom" FontColor="Black" BorderColor="Black" Display="MouseMove" BackColor="AntiqueWhite" Padding="0"></Tooltips> <TitleRight Font="Microsoft Sans Serif, 7.8pt" Visible="False" Text="UltraChart for .NET is #1 !" FontSizeBestFit="False" Orientation="VerticalLeftFacing" WrapText="False" Extent="26" FontColor="Black" HorizontalAlign="Near" VerticalAlign="Center" Location="Right"> <Margins Bottom="5" Left="5" Top="5" Right="5"></Margins> </TitleRight> <TitleLeft Font="Microsoft Sans Serif, 7.8pt" Visible="False" Text="Component Market" FontSizeBestFit="False" Orientation="VerticalLeftFacing" WrapText="False" Extent="26" FontColor="Black" HorizontalAlign="Near" VerticalAlign="Center" Location="Left"> <Margins Bottom="5" Left="5" Top="5" Right="5"></Margins> </TitleLeft> </ig:UltraChart>
backend:
UltraChart1.Border.Color = Color.White UltraChart1.Axis.X.LineColor = Color.White UltraChart1.Axis.Y.LineColor = Color.White
UltraChart1.TitleTop.Visible = False UltraChart1.TitleBottom.Text = "" UltraChart1.Data.SwapRowsAndColumns = True 'Swapping makes each row a column bar ' UltraChart1.Legend.Visible = True UltraChart1.Legend.Location = Infragistics.UltraChart.Shared.Styles.LegendLocation.Right UltraChart1.ChartType = Infragistics.UltraChart.[Shared].Styles.ChartType.ColumnChart
UltraChart1.ColorModel.ModelStyle = Infragistics.UltraChart.Shared.Styles.ColorModels.CustomLinear UltraChart1.ColorModel.CustomPalette = Me.hldCustomColors UltraChart1.Data.DataSource = Me.hldDataTable UltraChart1.Data.DataBind() UltraChart1.Axis.X.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal UltraChart1.Axis.X.TickmarkInterval = 5 UltraChart1.Axis.X.StripLines.Visible = True UltraChart1.Axis.X.StripLines.PE.Fill = ColorTranslator.FromHtml("#D9E3EA") UltraChart1.Axis.X.StripLines.PE.FillStopColor = Color.White
Thanks
Hi, Curtis.
This is main functionality and I'm almost certain it's not because of the version you are having. If it is possible for you, can you send me the entire chart configuration, including its code behind. Then I will investigate and will see what the problem is. Thank you in advance for the cooperation!
Thank you for replying.
For some reason, the spacing still does not work for the background color. I currently have Infragistics 2012, could that be the reason this is unable to work?
Thanks,
Curtis
The distance between the columns in the bar chart is configured outside the axis configurations. Please try the following:
<igchart:UltraChart ID="UltraChart1" runat="server" >
<ColumnChart SeriesSpacing="1"></ColumnChart>
...
I hope this will help you. Don't hesitate to ask if you have more questions, related to that matter.
Best regards, Nikolay Alipiev Software Developer