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

            UpdatePlottableVisibility(plottable, false);
        }
예제 #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();
        }
예제 #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();
     }
 }
예제 #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);
        }
예제 #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;
        }
예제 #7
0
        /// <summary>
        /// Remove a specific plottable
        /// </summary>
        public void Remove(IPlottable plottable)
        {
            settings.Plottables.Remove(plottable);

            if (settings.Plottables.Count == 0)
            {
                settings.ResetAxisLimits();
            }
        }
예제 #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);
        }
예제 #11
0
 /// <summary>
 /// Remove the given plottable from the plot
 /// </summary>
 public void Remove(IPlottable plottable) => settings.Plottables.Remove(plottable);
예제 #12
0
 public abstract void Plot(IPlottable <T, E> plottable);
예제 #13
0
 public Plotter(IPlottable <T, E> plottable)
 {
     Plotable = plottable;
 }
예제 #14
0
 public HTMLChart(IPlottable <T, E> chart) : base(chart)
 {
 }
예제 #15
0
 public override void Plot(IPlottable <T, E> plottable)
 {
     throw new NotImplementedException();
 }
예제 #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);
 }
예제 #17
0
파일: Plot.cs 프로젝트: whble/ScottPlot
 /// <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);
 }
예제 #18
0
 /// <summary>
 /// Add a plottable to the plot
 /// </summary>
 public void Add(IPlottable plottable) => settings.Plottables.Add(plottable);
예제 #19
0
파일: Plot.cs 프로젝트: whble/ScottPlot
 /// <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);
 }