Exemple #1
0
 private void TryParseArgs()
 {
     try
     {
         Args = null;
         if (!ArgsStr.HasContent())
         {
             return;
         }
         Args = Newtonsoft.Json.JsonConvert.DeserializeObject <PlotArguments>(ArgsStr);
     }
     catch (Exception ex)
     {
         LogInternally.That.SilentlyIgnoredError(ex);
     }
 }
        public static void SetPlottableProperties(
            ScottPlot.Plottable.ScatterPlot scatter,
            PlotArguments args)
        {
            // access
            if (scatter == null)
            {
                return;
            }

            // set
            if (true == args?.linewidth.HasValue)
            {
                scatter.LineWidth = args.linewidth.Value;
            }

            if (true == args?.markersize.HasValue)
            {
                scatter.MarkerSize = (float)args.markersize.Value;
            }
        }
        public static void SetOverallPlotProperties(
            IWpfPlotViewControl pvc,
            ScottPlot.WpfPlot wpfPlot,
            PlotArguments args,
            double defPlotHeight)
        {
            if (wpfPlot != null)
            {
                var pal = args?.GetScottPalette();
                if (pal != null)
                {
                    wpfPlot.Plot.Palette = pal;
                }
                var stl = args?.GetScottStyle();
                if (stl != null)
                {
                    wpfPlot.Plot.Style(stl);
                }

                var legend = wpfPlot.Plot.Legend(location: Alignment.UpperRight);
                legend.FontSize = 9.0f;
            }

            var cc = pvc?.ContentControl;

            if (cc != null)
            {
                var height = defPlotHeight;
                if (true == args?.height.HasValue)
                {
                    height = args.height.Value;
                }
                cc.MinHeight = height;
                cc.MaxHeight = height;
            }
        }
 public static void SetPlottableProperties(
     ScottPlot.Plottable.BarPlot bars,
     PlotArguments args)
 {
 }