Ejemplo n.º 1
0
        internal static FrameworkConfiguration GetTuioConfig(FrameworkElement uiParent)
        {
            AppConfig.LoadAppConfig();

            ProjectionConfig proj = ProjectionConfig.Load(AppConfig.TrackingPath);

            if (proj == null)
            {
                proj = ProjectionConfig.LoadDefaults();
            }

            AlignConfig align = new AlignConfig()
            {
                FlipX = AppConfig.FlipX,
                FlipY = AppConfig.FlipY
            };

            TuioConfiguration conf = new TuioConfiguration
            {
                Owner             = uiParent,
                UIManagedThreadId = Thread.CurrentThread.ManagedThreadId,
                CorrectProjection = AppConfig.CorrectProjection,
                Alignment         = align,
                Projection        = proj,
                Port = AppConfig.Port,
            };

            return(conf);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the legend configuration.
 /// </summary>
 /// <param name="font">The font.</param>
 /// <param name="size">The size.</param>
 /// <param name="backColor">The backcolor.</param>
 public void SetLegend(Font font, Size size, Color backColor)
 {
     try
     {
         ShowLegend               = true;
         Legend.Font              = font;
         Legend.ItemsSize         = size;
         Legend.VisibleCheckBox   = true;
         Legend.BackInterior      = new BrushInfo(backColor);
         Legend.ItemsAlignment    = AlignConfig.GetStringAlignment(StringAlignment.Center);
         Legend.ItemsTextAligment = VerticalAlignment.Center;
         Legend.Orientation       = ChartOrientation.Vertical;
         Legend.FloatingAutoSize  = true;
         Legend.ShowSymbol        = true;
         Legend.ShowItemsShadow   = true;
         Legend.ShowBorder        = false;
         Legend.Visible           = true;
     }
     catch (Exception ex)
     {
         Fail(ex);
     }
 }
Ejemplo n.º 3
0
        // Sets Starting Properties
        /// <summary>
        /// Initializes a new instance of the <see cref="ChartPanel"/> class.
        /// </summary>
        public ChartPanel()
        {
            //Basic Control Properties
            Size                   = SizeConfig.GetSize(600, 400);
            Location               = ControlConfig.GetLocation(1, 1);
            ShowLegend             = false;
            ShowToolbar            = false;
            ShowScrollBars         = false;
            EnableMouseRotation    = true;
            Padding                = ControlConfig.Padding;
            Margin                 = ControlConfig.Margin;
            Anchor                 = ControlConfig.GetAnchorStyle();
            AllowGapForEmptyPoints = true;
            AllowGradientPalette   = true;
            AllowUserEditStyles    = true;
            PrintColorMode         = ChartPrintColorMode.CheckPrinter;
            BackInterior           = new BrushInfo(ColorConfig.FormBackColorDark);
            BackColor              = ColorConfig.FormBackColorDark;

            ChartInterior = new BrushInfo(GradientStyle.PathRectangle, Color.LightGray,
                                          ColorConfig.FormBackColorDark);

            CalcRegions = true;

            //ChartArea Properties
            ChartArea.AdjustPlotAreaMargins = ChartSetMode.AutoSet;
            ChartArea.AutoScale             = true;
            ChartArea.BackInterior          = new BrushInfo(ColorConfig.FormBackColorDark);
            ChartArea.BorderWidth           = BorderConfig.Thin;
            ChartArea.BorderColor           = ColorConfig.ColorTransparent;
            ChartArea.BorderStyle           = BorderStyle.FixedSingle;
            ChartAreaMargins = new ChartMargins(3, 3, 3, 3);

            //ChartSeries Properties
            DropSeriesPoints     = false;
            AddRandomSeries      = true;
            Series3D             = true;
            SeriesHighlight      = true;
            SeriesHighlightIndex = -1;
            ShadowWidth          = 5;

            ShadowColor = new BrushInfo(GradientStyle.PathRectangle, ColorConfig.FormBackColorDark,
                                        Color.Silver);

            Depth            = 250;
            ElementsSpacing  = 10;
            ColumnDrawMode   = ChartColumnDrawMode.InDepthMode;
            ColumnFixedWidth = 20;

            //Chart Appearance Settings
            Palette              = ChartColorPalette.Metro;
            Skins                = Skins.None;
            RealMode3D           = true;
            Rotation             = 0.1f;
            SmoothingMode        = SmoothingMode.AntiAlias;
            Spacing              = 5;
            AutoHighlight        = true;
            SpacingBetweenPoints = 5;
            SpacingBetweenSeries = 10;
            Style3D              = true;
            TextAlignment        = AlignConfig.GetStringAlignment(StringAlignment.Center);
            TextPosition         = ChartTextPosition.Top;
            Tilt            = 5;
            ScrollPrecision = 100;
            RadarStyle      = ChartRadarAxisStyle.Polygon;

            //Chart Legend Settings;
            ShowLegend               = true;
            Legend.Font              = FontConfig.FontSizeSmall;
            Legend.ItemsSize         = SizeConfig.ImageSizeSmall;
            Legend.VisibleCheckBox   = true;
            Legend.BackInterior      = new BrushInfo(ColorConfig.FormBackColorDark);
            Legend.ItemsAlignment    = AlignConfig.GetStringAlignment(StringAlignment.Center);
            Legend.ItemsTextAligment = VerticalAlignment.Center;
            Legend.Orientation       = ChartOrientation.Vertical;
            Legend.FloatingAutoSize  = true;
            Legend.ShowSymbol        = true;
            Legend.ShowItemsShadow   = true;
            Legend.ShowBorder        = false;
            Legend.Visible           = true;
        }