Skip to content

Instantly share code, notes, and snippets.

View BartDM's full-sized avatar

Bart De Meyer BartDM

View GitHub Profile
@BartDM
BartDM / gist:5161080
Last active December 14, 2015 22:48
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
using System.ComponentModel;
using OxyPlotDemo.Annotations;
namespace OxyPlotDemo.ViewModels
{
public class MainWindowModel: INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
@BartDM
BartDM / gist:5161138
Created March 14, 2013 13:05
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
using System.ComponentModel;
using OxyPlot;
using OxyPlotDemo.Annotations;
namespace OxyPlotDemo.ViewModels
{
public class MainWindowModel: INotifyPropertyChanged
{
private PlotModel plotModel;
public PlotModel PlotModel
@BartDM
BartDM / gist:5161184
Created March 14, 2013 13:12
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
<Window x:Class="OxyPlotDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:oxy="http://oxyplot.codeplex.com"
Title="MainWindow" Height="350" Width="525">
<Grid>
<oxy:Plot x:Name="Plot1" Title="A Graph" Model="{Binding PlotModel}" Margin="10" Grid.Row="1">
</oxy:Plot>
</Grid>
</Window>
@BartDM
BartDM / gist:5161219
Created March 14, 2013 13:16
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
using System.Windows;
namespace OxyPlotDemo
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private ViewModels.MainWindowModel viewModel;
@BartDM
BartDM / gist:5161269
Created March 14, 2013 13:25
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
private void SetUpModel()
{
PlotModel.LegendTitle = "Legend";
PlotModel.LegendOrientation = LegendOrientation.Horizontal;
PlotModel.LegendPlacement = LegendPlacement.Outside;
PlotModel.LegendPosition = LegendPosition.TopRight;
PlotModel.LegendBackground = OxyColor.FromAColor(200, OxyColors.White);
PlotModel.LegendBorder = OxyColors.Black;
var dateAxis = new DateTimeAxis(AxisPosition.Bottom, "Date", "dd/MM/yy HH:mm") { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot, IntervalLength = 80 };
@BartDM
BartDM / gist:5161613
Last active December 14, 2015 22:49
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
private void LoadData()
{
List<Measurement> measurements = Data.GetData();
var dataPerDetector = measurements.GroupBy(m => m.DetectorId).ToList();
foreach (var data in dataPerDetector)
{
var lineSerie = new LineSeries
{
@BartDM
BartDM / gist:5161897
Created March 14, 2013 14:43
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
public void UpdateModel()
{
List<Measurement> measurements = Data.GetUpdateData(lastUpdate);
var dataPerDetector = measurements.GroupBy(m => m.DetectorId).OrderBy(m => m.Key).ToList();
foreach (var data in dataPerDetector)
{
var lineSerie = PlotModel.Series[data.Key] as LineSeries;
if (lineSerie != null)
{
@BartDM
BartDM / gist:5162039
Created March 14, 2013 15:01
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
public MainWindow()
{
viewModel = new ViewModels.MainWindowModel();
DataContext = viewModel;
CompositionTarget.Rendering += CompositionTargetRendering;
InitializeComponent();
}
@BartDM
BartDM / gist:5162073
Created March 14, 2013 15:05
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
public MainWindow()
{
viewModel = new ViewModels.MainWindowModel();
DataContext = viewModel;
CompositionTarget.Rendering += CompositionTargetRendering;
stopwatch.Start();
InitializeComponent();
}
@BartDM
BartDM / gist:5204052
Created March 20, 2013 11:44
Source for blog post Creating a JIRA interface in 1-2-3 on http://blog.bartdemeyer.be
PM> Install-Package Atlassian.SDK -Version 2.3.0