I have rendered a text successfully in the function OnRender. The text was a string.
I want to replicate the same thing with the DateTime instead of a string, but I am receiving an error message that the second argument is not allowed. Even after converting the Datetime to string as followed: DateTime time.toString. the same error message remains.
Here is the code:
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
SharpDX.DirectWrite.TextFormat textFormat1 = simpleFont.ToDirectWriteTextFormat();
string textToRender = "I am rendering my text here. What about DateTime?";
SharpDX.DirectWrite.TextLayout textLayout1 = new SharpDX.DirectWrite.TextLayout(NinjaTrader.Core.Globals.DirectWriteFactory,
ToTime(Time[0]).toString, textFormat1, ChartPanel.X + ChartPanel.W, textFormat1.FontSize);
}
Many thanks!

Comment