Chart Control for dynamic & actual line - c#

I working a project with wpf in c#.. I want to use chart tools for graphics on the picture. Yellow line is reference position for purple (Actual) line. When Actual line touch reference line or when it cross the yellow line then I have to mark this touch point.(You can see an exmp. on picture). Of course same time I have to any action in programs.
How Can I do it with best easy way?
Can I do it with C# WPF or another question I use which editor program for this chart?
Thank you.

Related

Interactive chart in C# - set cursor by mouse-click

I'm new to C# and windowsforms applications. I'm trying to create a, at least to some extend, interactive chart. As of now I have not found a library or a built-in method to do what I have in mind.
I want to be able to:
Set a cursor when I click in the chart, set a 2nd cursor when I click again.
When 2 cursors are set, I want to be able to move them with the mouse (click to grab).
(If possible side by side with cursor click-placing:
"Zoom the chart by drawing a rectangle in the chart by clicking and moving the mouse".
My intention is to enable zoom as in: MS Chart Control: prevent zoom when clicking)
I'd like to do this to analyze data (see: Cursor setting example.png). With the cursors it should be possible to easily get the values of the two cursor positions (yellow and red lines) and to measure the distance in between (purple line).
Does anyone of you know how to do this with a mouse_click event OR know a chart library to easily do that?
Thanks for your help!
-Phill
Found another solution to my question and posted it as an answer there: How to retrieve the selected range in the .Net WinForms Chart Control?
To add colored cursors I also add 2 dataseries that are yellow and red to the method private void chart1_SelectionRangeChanging(object sender, CursorEventArgs e):
chart1.Series["CursorX1"].Points.AddXY(x1,y1Min);`
chart1.Series["CursorX1"].Points.AddXY(x1,y1Max);
chart1.Series["CursorX1"].Points.Color = Color.Red;
chart1.Series["CursorX2"].Points.AddXY(x2,y2Min);`
chart1.Series["CursorX2"].Points.AddXY(x2,y2Max);
chart1.Series["CursorX2"].Points.Color = Color.Yellow;

Get the position of the GanttPresenterSplitter in a <telerik:RadGanttView>

I am working on a WPF application using Telerik and coded in C# .NET.
My following question goes over a XAML page using the model “Code behind” to implement the logic of the page.
I would like to get the position of the GanttPresenterSplitter in a telerik:RadGanttView.
This information would allow me to set the position of another element in another part of the same screen.
I would also know if it is possible to add an event handler on that GanttPresenterSplitter in order to get its position each time that line moves.
The ASP .NET page is split into 3 parts (please find in attachment draft_screen) :
Red square : telerik:RadGanttView
Green square : telerik:RadGridView
Blue square : telerik:RadScheduleView
As you can see, there is a dividing line between telerik:RadGridView and telerik:RadScheduleView.
I would like that line moves at the same time and same position as the GanttPresenterSplitter in the RadGanttView.
Using a more explicit picture based on an example (please find in attachment explicit_screen) :
Orange line : GanttPresenterSpliter
Purple line : GridSplitter
My point is to coordinate the orange and the purple lines in order they have the same position all the time.
Any help will be much appreciated :)
There is no straightforward way to get the position of the GanttPresenterSplitter, however, you could, for example, get the Width of the Grid area of the GanttView, and more specifically the width of the visible area. It is presented by a ScrollBar element, so you could subscribe to its SizeChanged event to handle when the Grid area is resized.
I have prepared a sample example to demonstrate the approach, please download the attachment and give it a try.

Edit a single point in LineSeries oxyplot

I am currently exploring oxyplot and wanted to edit a single point in my lineseries. (see image)
For example I want to edit the second point. I want it to be twice the size that it normally is or change the colour. Is that possible without enlarging/changing the colour of all the other points?
I found a way arround it. I drew another graph (scatterseries graph) on the selected point.

Change line spacing in winform RichTextBox

I'm using in my winform project a RichTextBox control to display a kind of old console screen.
This works perfectly but there is a space between the lines.
Is it possible to change this space to be 0 or anything near that.
If i paint a line from vetical line from line 1 to line 5 i don't want any spacing between the line.
Hope you can help me.
There's actually a lot that the Windows Forms RichTextBox doesn't expose. If you have the HWND (Handle property) to the control, you can use the SendMessage API to send the EM_SETPARAFORMAT message to play with the formatting.
In particular the PARAFORMAT2 structure does have some line spacing options that may be relevant. You will have to get your hands dirty with interop though.

C# - Highlight Current Line

I am new to C#, and I am creating a notepad type of application. It's working good, but I would like to highlight the current line - meaning the current line where the cursor is or where the mouse has been clicked on would be highlighted in another color. I haven't worked with colors in C# so far, so any help on this would be appreciated.
Check CodeProject articles for Edit controls.

Categories