Hello, I'm using IG 10.3 and C# I have this composite chart which for some reason does not take the ColorModel's settings below:
chart1.ColorModel.ModelStyle = Infragistics.UltraChart.Shared.Styles.ColorModels.CustomLinear;
chart1.ColorModel.CustomPalette = new Color[] { Color.FromArgb(241, 112, 34), Color.FromArgb(46, 63, 83), Color.FromArgb(238, 246, 108), Color.FromArgb(160, 174, 193), Color.FromArgb(237, 189, 62), Color.FromArgb(58, 95, 11), Color.FromArgb(98, 194, 204), Color.FromArgb(53, 6, 8), Color.FromArgb(204, 255, 187), Color.FromArgb(199, 59, 11), Color.FromArgb(129, 125, 98), Color.FromArgb(187, 119, 46), Color.FromArgb(233, 220, 185) };
It does take this setting though:
chart1.BackgroundImageFileName = page.Server.MapPath("~/images/BG.gif");
I should mention that the code for the charts on that page is in a separate class file, but all other charts seem to work fine with similar set up.
And also the legend is fixed to the top left corner and I'd like to move it to the top so it does not obscure the Y Axis labels. Here is the code for the legend:
<Legends> <igchartprop:CompositeLegend ChartLayerList="chartLayer1" Visible="true" BoundsMeasureType="Percentage" LabelStyle-Orientation="Horizontal">
<Border Thickness="0" /></igchartprop:CompositeLegend>
</Legends>
But it does not have any Location property like the regular legend would have: <Legend Visible="True" SpanPercentage="10" Location="Top"></Legend> so how can I place it on top of the chart?
Any ideas would be much appreciated.
Thank you.
Hello Aleksandr,
Please let me know if you need any additional assistance with this question.
Thanks, Alex, I will check your solution out and let you know if it works for me.
I have made a little example from data that you have provided and you may find it useful in resolving your issue. Example is located in my “Samples” folder here - http://community.infragistics.com/members/AEftimov/files/Samples/WebChartColor_2B00_Legend_2D00_Aleksandr.zip.aspx
I have placed the “ColorModel” data in separate class (“ChartColorModel.cs” in App_Code folder) and I use this class from my default page (“Default.aspx”) where chart is located.
In my example “CustomPallete” property works as expected and columns color is set by color array data.
If you want to change chart background only, you can use chart “BackColor” property.
For composite legend position change you can use programmatic approach from code behind file. I have created a simple class (“CreateCompositeLegend.cs” in App_Code folder) with one example method – “MakeCompositeLegend()” – that shows how you can place your legend on “Top”, “Bottom”, “Left”, or “Right” position and change legend properties programmatically.
To run the example you must change the data source location string in “web.config” file.
You can also modify my example, or send me your own example if you want.
I hope that this example can help you, but if you have any additional questions or difficulties feel free to contact me for further assistance.