private void listViewSeriesCheckBox_Unchecked(object sender, RoutedEventArgs e) { CheckBox checkBox = sender as CheckBox; IPlottable plottable = GetPlottableByCheckBox(checkBox); UpdatePlottableVisibility(plottable, false); }
/// <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(); }
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(); } }
/// <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); }
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; }
/// <summary> /// Remove a specific plottable /// </summary> public void Remove(IPlottable plottable) { settings.Plottables.Remove(plottable); if (settings.Plottables.Count == 0) { settings.ResetAxisLimits(); } }
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); }
/// <summary> /// Remove the given plottable from the plot /// </summary> public void Remove(IPlottable plottable) => settings.Plottables.Remove(plottable);
public abstract void Plot(IPlottable <T, E> plottable);
public Plotter(IPlottable <T, E> plottable) { Plotable = plottable; }
public HTMLChart(IPlottable <T, E> chart) : base(chart) { }
public override void Plot(IPlottable <T, E> plottable) { throw new NotImplementedException(); }
/// <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); }
/// <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); }
/// <summary> /// Add a plottable to the plot /// </summary> public void Add(IPlottable plottable) => settings.Plottables.Add(plottable);
/// <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); }