mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-08 10:16:36 +08:00
项目结构调整
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using LiveCharts;
|
||||
using LiveCharts.Events;
|
||||
using LiveCharts.Wpf;
|
||||
|
||||
namespace Wpf.CartesianChart.Events
|
||||
{
|
||||
public partial class EventsExample : UserControl
|
||||
{
|
||||
public EventsExample()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = new ViewModel();
|
||||
}
|
||||
|
||||
private void ChartOnDataClick(object sender, ChartPoint p)
|
||||
{
|
||||
var asPixels = Chart.ConvertToPixels(p.AsPoint());
|
||||
Console.WriteLine("[EVENT] You clicked (" + p.X + ", " + p.Y + ") in pixels (" +
|
||||
asPixels.X + ", " + asPixels.Y + ")");
|
||||
}
|
||||
|
||||
private void Chart_OnDataHover(object sender, ChartPoint p)
|
||||
{
|
||||
Console.WriteLine("[EVENT] you hovered over " + p.X + ", " + p.Y);
|
||||
}
|
||||
|
||||
private void ChartOnUpdaterTick(object sender)
|
||||
{
|
||||
Console.WriteLine("[EVENT] chart was updated");
|
||||
}
|
||||
|
||||
private void Axis_OnRangeChanged(RangeChangedEventArgs eventargs)
|
||||
{
|
||||
Console.WriteLine("[EVENT] axis range changed");
|
||||
}
|
||||
|
||||
private void ChartMouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
var point = Chart.ConvertToChartValues(e.GetPosition(Chart));
|
||||
|
||||
X.Text = point.X.ToString("N");
|
||||
Y.Text = point.Y.ToString("N");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user