Posted 19 September 2017, 8:02 am EST
I want to add a line marker to a C1FlexChart (line chart) in response to a mouse click but I am having trouble. I need to know how to set the horizontal position based on the hit test. Also, the line marker does not seem to render.
private void MainChart_MouseDown(object sender, MouseButtonEventArgs e)
{
var hitInfo = mainChart.HitTest(e.GetPosition(mainChart));
var time = hitInfo.X; // DateTime
mainChart.Layers.Add(new C1LineMarker()
{
Lines = LineMarkerLines.Vertical,
Interaction = LineMarkerInteraction.Drag,
Alignment = LineMarkerAlignment.Auto,
DragLines = true,
});
}