I have a chart (see below) where my orange line should go straight throught the x axis but it is ending on a point, is there any way to stop this happening?
I assume it is something to do with the points on my x axis?
Thanks
One more thing I forgot to mention is that you could use Swaping rows and columns, and if you have any negative points they will be drawn bellow zero crossing the actual X axis. Here is how to set it up:
ultraChart1.Data.SwapRowsAndColumns = true;
The drawing area is between Y and X quarter with zero offset by default. What I suggested was to offset one of the axis below zero and include a horizontal line that would represent a line segmenent on zero coordinate toresemble an axis, but the actual axis would be the one set by using RangeMin property. Here is an example:
Hi
I tried your suggestion but I don't know If i explained myself correctly!
I need the yellow line to be a continous straight line through the x axis!
Is there any way to achieve this, stop the line changing its direction at month 1?
If you also would like to have a line on zero coordinate, while moving X axis below zero, you can handle FillSceneGraph event and draw a line there, here is how:
private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
{
IAdvanceAxis x = (IAdvanceAxis)e.Grid["X"];
IAdvanceAxis y = (IAdvanceAxis)e.Grid["Y"];
if (x != null)
int target = 0;
int yVal = (int)y.Map(target);
int xStart = (int)x.Map(0);
int xEnd = (int)x.Map(5);
Line line = new Line(new Point(xStart, yVal), new Point(xEnd, yVal));
line.PE.Stroke = Color.Red;
line.PE.StrokeWidth = 3;
e.SceneGraph.Add(line);
}
If you have a point below zero set the RangeType (custom), RangeMin and RangeMax in order to make them all visible such as:
ultraChart1.Axis.X.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom;ultraChart1.Axis.X.RangeMin = -5;ultraChart1.Axis.X.RangeMax = 10;
Please note that setting a RangeMin below zero will move the X axis to the specified (below zero) coordinate.
Let me know if this approach works for you.