Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Plotter
- {
- private PlotModel model;
- private DateTime startDate = DateTime.Now.AddDays(-10);
- private DateTime endDate = DateTime.Now;
- private readonly List<OxyColor> colors = new List<OxyColor>
- {
- OxyColors.Green,
- OxyColors.IndianRed,
- OxyColors.Coral,
- OxyColors.Chartreuse,
- OxyColors.Azure
- };
- private readonly List<MarkerType> markerTypes = new List<MarkerType>
- {
- MarkerType.Plus,
- MarkerType.Star,
- MarkerType.Diamond,
- MarkerType.Triangle,
- MarkerType.Cross
- };
- public Plotter()
- {
- model = new PlotModel { Title = "DateTimeAxis" };
- }
- public PlotModel PrintChart()
- {
- var minValue = DateTimeAxis.ToDouble(startDate);
- var maxValue = DateTimeAxis.ToDouble(endDate);
- model.Axes.Add(new DateTimeAxis { Position = AxisPosition.Bottom, Minimum = minValue, Maximum = maxValue, StringFormat = "HH:mm" });
- return model;
- }
- public void PrintChart()
- {
- Plotter pt = new Plotter();
- frGraph.Model = pt.PrintChart();
- }
- private void startDrawing_Click(object sender, EventArgs e)
- {
- PrintChart();
- }
- private void InitializeTimerForChart()
- {
- tickCount.Interval = References.TIMER_INTERVAL; // (1000 ΠΌΡ)
- this.tickCount.Tick += new System.EventHandler(this.tickCount_Tick);
- tickCount.Enabled = true;
- }
- private void tickCount_Tick(object sender, EventArgs e)
- {
- if (InvokeRequired)
- {
- Invoke((MethodInvoker)delegate ()
- {
- frGraph.Invalidate();//PrintChart();
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement