How can a difference in the first argument (object name) using Chart.DrawText() cause a difference in the location of the text?
How can a difference in the first argument (object name) using Chart.DrawText() cause a difference in the location of the text?
08 Jul 2020, 09:36
I was playing around with the arguments of Chart.DrawText and found that although all the arguments except the object ID are the same, the location of the text is different.
Why is the output of line abc different compared to the last line xyz?
line abc - Chart.DrawText(string.Concat("id-", themid), "abc", index, 45, Color.White);
line xyz - Chart.DrawText("wh", "abc", index, 45, Color.White);
Replies
fang0092
08 Jul 2020, 09:52
RE:
PanagiotisCharalampous said:
Hi francisang92,
You need to have a unique name for each object. Else when the DrawText() is called using the name of an existing object, the object will be replaced with the new one.
Best Regards,
Panagiotis
So code on line xyz creates a text, but since it has the same object ID, it keeps getting overwritten. Text only appears at the last bar, because nothing else is replacing.
Ok. Thank you.
@fang0092
PanagiotisCharalampous
08 Jul 2020, 09:41
Hi francisang92,
You need to have a unique name for each object. Else when the DrawText() is called using the name of an existing object, the object will be replaced with the new one.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous