Is it possible to color code the y-axis in the windows forms UltraChart control? We have a chart which has some acceptable ranges and we would like to have the Y Axis background color correspond to the acceptable range. So for example Y-Axis values 0-3 would appear with a red background, 4-6 would have a yellow background and 7-10would have a green background.
Hello Nicholas,
Which series is your chart(s) configured with?
I'd recommend using the StripLine, however it only applies to charts that perform item grouping, such as column and bar charts.
http://help.infragistics.com/doc/WinForms/2015.1/CLR4.0/?page=Infragistics4.Win.UltraWinChart.v15.1~Infragistics.UltraChart.Resources.Appearance.StripLineAppearance.html
If you are using another series type, a potential workaround is to handle FillSceneGraph event of the chart and manually draw a colored region where a strip line would normally be. Perhaps this link can help you get started:
http://help.infragistics.com/NetAdvantage/WinForms/2015.1/CLR4.0?page=Chart_Modify_Scene_Graph_Using_FillSceneGraph_Event.html
Let me know if you have any questions regarding this matter.
Thanks Michael. I am using a line chart. I included a rough mockup of what I am trying to accomplish. Would I be able to do that with the FillSceneGraph method? Would it be possible to do this with the newer UltraDataChart? I am not currently using that control but could switch over if it would make this easier.
I built a sample that demonstrates how to use the FillSceneGraph and draw three individual box primitives that overlap the yaxis labels.
Inside the event you need to reference the X axis, find xAxis.MapMinimum (xRight), followed by subtract around 20 pixels and that’s your (xLeft) to move the box over the labels.
Then you need to reference the Y axis, to utilize the following members: yAxis.MapMinimum, yAxis.Map(), and yAxis.MapMaximum.
For more details please refer to my sample attached below. Let me know if you have any questions.