I would like to position the marker label, that you see above, inside the columns. Is this possible? And, if so, I would like to be able to do this with code behind.
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Attached is a solution with DataTemplate and xamChart build in C# to position marker in the column center.
i = 0; foreach (Dundas.Utilities.ChartControl.DataPoint dp in series.Points) { dp.BorderColor = Color.FromArgb(255, 0, 0, 0); dp.BorderStyle = PointAttributes.LineStyle.Solid; dp.BorderWidth = 1; dp.LabelFormat = "n0"; if (dp.YValues[0] < 10) { dp.CustomAttributes = ("LabelStyle = Top"); } i++; }
Hi Stefan,
Thank you for ToolTip binding trick. I am trying to achieve in code behind the same you have done in xaml. Mainly because I build XamChart dynamically. However still no success - both approaches will be fine assign resource from xaml to the chart or building datatemplate in C#. Please see the attached project.
Thank you,Iryna
Hello Iryna,
Thank you for your post. I have been looking into it and the sample Nikolay has provided and I created a new one in WPF based on his, but I bound the TextBlock in the DataPointTemplate to the ToolTip of the DataPoint, which is bound to its Value, because there is no access directly to the DataPoint’s Value. Please let me know if this helps you or you need further clarifications on this matter.
Looking forward for your reply.