private void listViewSeriesCheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            CheckBox   checkBox  = sender as CheckBox;
            IPlottable plottable = GetPlottableByCheckBox(checkBox);

            UpdatePlottableVisibility(plottable, false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Clear all plottables of the same type as the one that is given
        /// </summary>
        public void Clear(IPlottable examplePlottable)
        {
            settings.Plottables.RemoveAll(x => x.GetType() == examplePlottable.GetType());

            if (settings.Plottables.Count == 0)
                settings.ResetAxisLimits();
        }
Ejemplo n.º 3
0
 public PlotManager(IPlottable plot)
 {
     // Initialize
     this.plot = plot;
     plotData = new List<PlotData>();
     plotFont = new Font(Font.Default, plot.PlotColor, HorizontalAlignment.Left, VerticalAlignment.Top);
 }
 private void UpdatePlottableVisibility(IPlottable plottable, bool isVisible)
 {
     if (plottable != null)
     {
         plottable.IsVisible = isVisible;
         this.mainPlot.Render();
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Adds a IPlottable.
        /// </summary>
        /// <param name="plottable">the plottable to add</param>
        /// <returns>this instance for chaining</returns>
        public Area AddPlottable(IPlottable plottable)
        {
            ValidationUtil.RequireNonNull(plottable);

            plottables.Add(plottable);

            return(this);
        }
Ejemplo n.º 6
0
        private void GetLegendItemUnderMouse(System.Drawing.Point e)
        {
            // mouse hit logic must go here because Legend doesn't know about image stretching or display scaling
            double legendItemHeight = (double)PictureBoxLegend.Image.Height / Legend.Count;
            int    clickedindex     = (int)Math.Floor(e.Y / legendItemHeight);

            ClickedPlottable = Legend.GetItems()[clickedindex].Parent;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Remove a specific plottable
        /// </summary>
        public void Remove(IPlottable plottable)
        {
            settings.Plottables.Remove(plottable);

            if (settings.Plottables.Count == 0)
            {
                settings.ResetAxisLimits();
            }
        }
Ejemplo n.º 8
0
    void Awake()
    {
        obs = GetComponent <IPlottable>();
        availiableVariables = new string[obs.Data().Count];
        int i = 0;

        foreach (KeyValuePair <string, float> kvp in obs.Data())
        {
            availiableVariables[i] = kvp.Key;
            i++;
        }
    }
        private void ReadChart()
        {
            this.plottableList  = new List <IPlottable>();
            this.seriesViewList = new List <ChartSeriesListItem>();

            this.InitLegend();

            Chart chart = MemoryReader.Read <Chart>(new ChartSerialization());

            this.mainPlot.Plot.XAxis.TickLabelNotation(invertSign: chart.InvertAxisX);
            this.mainPlot.Plot.YAxis.TickLabelNotation(invertSign: chart.InvertAxisY);

            ChartSeries first = chart.SeriesCollection.First();

            double[] dataX = first.Points.Select(p => p.X).ToArray();

            int count = chart.SeriesCollection.Count();

            for (int k = 0; k < count; k++)
            {
                IPlottable  plottable = null;
                ChartSeries series    = chart.SeriesCollection[k];
                switch (series.Type)
                {
                case ChartSeriesType.Linear:
                {
                    plottable = this.AddLinearPlot(series, dataX);
                    break;
                }

                case ChartSeriesType.Bubble:
                {
                    plottable = this.AddBubblePlot(series);
                    break;
                }
                }

                this.plottableList.Add(plottable);
                this.seriesViewList.Add(new ChartSeriesListItem()
                {
                    Name      = series.Name,
                    IsVisible = true,
                    Plottable = plottable
                });
            }

            this.listViewSeries.ItemsSource = this.seriesViewList;
        }
        private IPlottable GetPlottableByCheckBox(CheckBox checkBox)
        {
            IPlottable plottable = null;

            if (checkBox != null)
            {
                ListViewItem item = checkBox.FindParent <ListViewItem>();
                if (item != null)
                {
                    ChartSeriesListItem chartSeriesListItem = item.Content as ChartSeriesListItem;
                    if (chartSeriesListItem != null)
                    {
                        plottable = chartSeriesListItem.Plottable;
                    }
                }
            }
            return(plottable);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Remove the given plottable from the plot
 /// </summary>
 public void Remove(IPlottable plottable) => settings.Plottables.Remove(plottable);
Ejemplo n.º 12
0
 public abstract void Plot(IPlottable <T, E> plottable);
Ejemplo n.º 13
0
 public Plotter(IPlottable <T, E> plottable)
 {
     Plotable = plottable;
 }
Ejemplo n.º 14
0
 public HTMLChart(IPlottable <T, E> chart) : base(chart)
 {
 }
Ejemplo n.º 15
0
 public override void Plot(IPlottable <T, E> plottable)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Add a custom plot to the graph to draw in it
 /// </summary>
 /// <param name="plot">A object that implements the IPlottable interface</param>
 public void AddPlotToGraph(IPlottable plot)
 {
     graph.AddPlotToGraph(plot);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Move a plottable to the front so it is rendered first and appears beneath all others.
 /// </summary>
 public void MoveFirst(IPlottable plottable)
 {
     settings.Plottables.Remove(plottable);
     settings.Plottables.Insert(0, plottable);
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Add a plottable to the plot
 /// </summary>
 public void Add(IPlottable plottable) => settings.Plottables.Add(plottable);
Ejemplo n.º 19
0
 /// <summary>
 /// Move a plottable to the end so it is rendered last and appears above all others.
 /// </summary>
 public void MoveLast(IPlottable plottable)
 {
     settings.Plottables.Remove(plottable);
     settings.Plottables.Add(plottable);
 }