Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

How to draw vertical Lines on Mouse left click event on Live Chart #1163

Open
PabitraSwain-ltts opened this issue Jun 8, 2022 · 0 comments

Comments

@PabitraSwain-ltts
Copy link

PabitraSwain-ltts commented Jun 8, 2022

How to reproduce?

I am trying to draw vertical lines on the mouse's left button click event on the chart for my WPF application. I am able to get the coordinate values from the chart and I tried with MouseLeftButtonDown() event but unfortunately not working.
I tried the below things on MouseLeftButtonDown() event:

var chart = (CartesianChart)sender;
var mousecoordinate = e.GetPiosition(chart);
var p = chart.ConvertToChartValues(mousecoordinate);

cartesianChart1.AxisX.Add( new Asix
{
Sections = new SectionCollection
   {
        new AxisSection{
             Value = p.X,
             Stroke = Brushes.Red,
             StrokeThickness =1
       }
    }
}
)

I tried this thing on Constructor but only one Red vertical line is coming but not on Mouse Click event even though I call this code multiple times.

Extra notes

I am using LiveChart.Geared.

Please click this link for Image ref(This is what I need ): https://imgbox.com/bblO0dUM

I really appreciate any help you can provide.

I am using

Live-Charts version 0.9.7.0
.Net Version Framework 4.7.2
Windows 10 Pro
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant