I am facing another issue, ollowing up the problem with the values in OnRender().
I am trying to draw dynamic texts in OnDender(), but after failling to achieve the goal, I have deceided to draw the fixed text to check if there could be an issue with my values from the region Helpers. The fixed text can be seen on the chart, but not the dynamic texts.
Here is my code:
protected override void OnRender(ChartControl chartControl, ChartScale chartScale) { SharpDX.Vector2 startPoint; startPoint = new SharpDX.Vector2(ChartPanel.X, ChartPanel.Y); float canvasEndCoordinate = chartControl.CanvasRight; int xCoordinate1 = chartControl.GetXByTime(endX1); // Fixed text SharpDX.Vector2 vecMyTag = new SharpDX.Vector2(canvasEndCoordinate-75, startPoint.Y+35); SharpDX.DirectWrite.TextLayout textLayout1 = new SharpDX.DirectWrite.TextLayout(NinjaTrader.Core.Gl obals.DirectWriteFactory, "Here is my text", textFormat1, ChartPanel.X + ChartPanel.W, textFormat1.FontSize); RenderTarget.DrawTextLayout(vecMyTag, textLayout1, firstColorDx, SharpDX.Direct2D1.DrawTextOptions.NoSnap); // Dynymic text SharpDX.Vector2 vecMyTag = new SharpDX.Vector2(xCoordinate1, endY); SharpDX.DirectWrite.TextLayout textLayout1 = new SharpDX.DirectWrite.TextLayout(NinjaTrader.Core.Gl obals.DirectWriteFactory, "Here is my text", textFormat1, ChartPanel.X + ChartPanel.W, textFormat1.FontSize); RenderTarget.DrawTextLayout(vecMyTag, textLayout1, firstColorDx, SharpDX.Direct2D1.DrawTextOptions.NoSnap); }
Thanks in advace!
Comment