Skip to content

Instantly share code, notes, and snippets.

@benhysell
Created October 23, 2014 12:56
Show Gist options
  • Save benhysell/e377f0e57897e474bf69 to your computer and use it in GitHub Desktop.
Save benhysell/e377f0e57897e474bf69 to your computer and use it in GitHub Desktop.
oxplot data point mapping
Func<object, DataPoint> dataPointMapping;
if (weightRepository.Units == WeightRepository.LBS)
dataPointMapping = item => new DataPoint (DateTimeAxis.ToDouble (((WeightEntry)item).Date), ((WeightEntry)item).WeightLbs);
else
dataPointMapping = item => new DataPoint (DateTimeAxis.ToDouble (((WeightEntry)item).Date), ((WeightEntry)item).WeightKg);
weightLinePlot.Mapping = dataPointMapping;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment