I am trying to draw a line at y = 20, using some sample code I saw for a bar chart, however, e.Grid["X"] is always null.
How do I solve this?
{
//gets the X and Y axis
IAdvanceAxis y = (IAdvanceAxis)e.Grid["Y"];
//checks if axis exist
//figures out the coordinate to draw
//a line at y=100
int yVal = (int)y.Map(target);
int xEnd = (int)x.Map(50);
e.SceneGraph.Add(l);
}
#endregion
It's actually just a LineChart, not a composite chart.
if you're using a Composite Chart, you might need to reference the axes using an expression like
this.ultraChart1.CompositeChart.ChartLayers[0].ChartLayer.Grid["X"]