static int ModifyMesh(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes <UnityEngine.Mesh>(L, 2)) { GradientEffect obj = (GradientEffect)ToLua.CheckObject <GradientEffect>(L, 1); UnityEngine.Mesh arg0 = (UnityEngine.Mesh)ToLua.ToObject(L, 2); obj.ModifyMesh(arg0); return(0); } else if (count == 2 && TypeChecker.CheckTypes <UnityEngine.UI.VertexHelper>(L, 2)) { GradientEffect obj = (GradientEffect)ToLua.CheckObject <GradientEffect>(L, 1); UnityEngine.UI.VertexHelper arg0 = (UnityEngine.UI.VertexHelper)ToLua.ToObject(L, 2); obj.ModifyMesh(arg0); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: GradientEffect.ModifyMesh")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void Init(IMapSelection mapSelection) { blur = CreateChild <BlurDisplay>("focus-blur", 0); { blur.Anchor = AnchorType.Fill; blur.Offset = Offset.Zero; } gradientSprite = CreateChild <UguiSprite>("gradient", 1); { gradientSprite.Anchor = AnchorType.Fill; gradientSprite.RawSize = Vector2.zero; gradientEffect = gradientSprite.AddEffect(new GradientEffect()); gradientEffect.Component.direction = UIGradient.Direction.Vertical; } quitButton = CreateChild <MenuButton>("quit-button", 2); { quitButton.Anchor = AnchorType.Bottom; quitButton.Y = 100; quitButton.Size = new Vector2(160f, 160f); quitButton.LabelText = "Quit"; quitButton.IconName = "icon-power"; quitButton.OnTriggered += OnQuitButton; } backButton = CreateChild <MenuButton>("back-button", 2); { backButton.X = -160f; backButton.Size = new Vector2(160f, 160f); backButton.LabelText = "Back"; backButton.IconName = "icon-arrow-left"; backButton.OnTriggered += OnBackButton; } playButton = CreateChild <MenuButton>("play-button", 2); { playButton.Size = new Vector2(160f, 160f); playButton.LabelText = "Play"; playButton.IconName = "icon-play"; playButton.OnTriggered += OnPlayButton; } downloadButton = CreateChild <MenuButton>("download-button", 2); { downloadButton.X = 160f; downloadButton.Size = new Vector2(160f, 160f); downloadButton.LabelText = "Download"; downloadButton.IconName = "icon-download"; downloadButton.OnTriggered += OnDownloadButton; } OnEnableInited(); }
static int get_bottomColor(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); GradientEffect obj = (GradientEffect)o; UnityEngine.Color ret = obj.bottomColor; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index bottomColor on a nil value")); } }
static int set_bottomColor(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); GradientEffect obj = (GradientEffect)o; UnityEngine.Color arg0 = ToLua.ToColor(L, 2); obj.bottomColor = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index bottomColor on a nil value")); } }
protected override void OnAttached() { GradientEffect gradientEffect = (GradientEffect)Element.Effects.First(e => e is GradientEffect); Android.Graphics.Color startColor = gradientEffect.StartColor.ToAndroid(); Android.Graphics.Color endColor = gradientEffect.EndColor.ToAndroid(); int[] colors = new int[] { startColor, endColor }; GradientDrawable.Orientation orientation = GradientDrawable.Orientation.TopBottom; switch (gradientEffect.Direction) { case GradientDirection.TopLeft_BottomRight: orientation = GradientDrawable.Orientation.TlBr; break; case GradientDirection.TopBottom: orientation = GradientDrawable.Orientation.TopBottom; break; case GradientDirection.TopRight_BottomLeft: orientation = GradientDrawable.Orientation.TrBl; break; case GradientDirection.LeftRight: orientation = GradientDrawable.Orientation.LeftRight; break; case GradientDirection.RightLeft: orientation = GradientDrawable.Orientation.RightLeft; break; case GradientDirection.BottomRight_TopLeft: orientation = GradientDrawable.Orientation.BrTl; break; case GradientDirection.BottomTop: orientation = GradientDrawable.Orientation.BottomTop; break; case GradientDirection.BottomLeft_TopRight: orientation = GradientDrawable.Orientation.BlTr; break; } GradientDrawable drawable = new GradientDrawable(orientation, colors); if (Control == null) { prevBackground = Container.Background; Container.Background = drawable; } else { prevBackground = Control.Background; Control.Background = drawable; } }
internal GradientUIView(CGRect frame, GradientEffect gradientEffect) : base(frame) { CGColor startColor = gradientEffect.StartColor.ToCGColor(); CGColor endColor = gradientEffect.EndColor.ToCGColor(); CGPoint startPoint; CGPoint endPoint; switch (gradientEffect.Direction) { case GradientDirection.LeftRight: startPoint = new CGPoint(0.0, 0.5); endPoint = new CGPoint(1.0, 0.5); break; case GradientDirection.TopLeft_BottomRight: startPoint = new CGPoint(0.0, 0.0); endPoint = new CGPoint(1.0, 1.0); break; case GradientDirection.TopRight_BottomLeft: startPoint = new CGPoint(1.0, 0.0); endPoint = new CGPoint(0.0, 1.0); break; case GradientDirection.RightLeft: endPoint = new CGPoint(0.0, 0.5); startPoint = new CGPoint(1.0, 0.5); break; case GradientDirection.BottomRight_TopLeft: endPoint = new CGPoint(0.0, 0.0); startPoint = new CGPoint(1.0, 1.0); break; case GradientDirection.BottomTop: endPoint = new CGPoint(0.5, 0.0); startPoint = new CGPoint(0.5, 1.0); break; case GradientDirection.BottomLeft_TopRight: endPoint = new CGPoint(1.0, 0.0); startPoint = new CGPoint(0.0, 1.0); break; case GradientDirection.TopBottom: default: startPoint = new CGPoint(0.5, 0.0); endPoint = new CGPoint(0.5, 1.0); break; } gradientLayer = new CAGradientLayer { Frame = frame, Colors = new[] { startColor, endColor }, StartPoint = startPoint, EndPoint = endPoint }; Layer.InsertSublayer(gradientLayer, 0); UserInteractionEnabled = false; }
private void InitializeComponent() { Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance(); PaintElement element = new PaintElement(); BarChartAppearance appearance2 = new BarChartAppearance(); ChartTextAppearance item = new ChartTextAppearance(); GradientEffect effect = new GradientEffect(); this.tableLayoutPanel1 = new TableLayoutPanel(); this.ultraButton1 = new UltraButton(); this.ultraChart1 = new UltraChart(); this.panel1 = new Panel(); this.pictureBox2 = new PictureBox(); this.pictureBox1 = new PictureBox(); this.backgroundWorker1 = new BackgroundWorker(); this.tableLayoutPanel1.SuspendLayout(); this.ultraChart1.BeginInit(); this.panel1.SuspendLayout(); ((ISupportInitialize)this.pictureBox2).BeginInit(); ((ISupportInitialize)this.pictureBox1).BeginInit(); base.SuspendLayout(); this.tableLayoutPanel1.BackColor = Color.Silver; this.tableLayoutPanel1.ColumnCount = 4; this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 5f)); this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 320f)); this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 6f)); this.tableLayoutPanel1.Controls.Add(this.ultraButton1, 2, 1); this.tableLayoutPanel1.Controls.Add(this.ultraChart1, 2, 2); this.tableLayoutPanel1.Controls.Add(this.panel1, 1, 1); this.tableLayoutPanel1.Dock = DockStyle.Fill; this.tableLayoutPanel1.Location = new Point(0, 0); this.tableLayoutPanel1.Margin = new Padding(0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 4; this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 5f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 50f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 5f)); this.tableLayoutPanel1.Size = new Size(0x45d, 270); this.tableLayoutPanel1.TabIndex = 0; appearance.BackColor = Color.FromArgb(0xc0, 0xc0, 0xff); appearance.BackColor2 = Color.White; appearance.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical; this.ultraButton1.Appearance = appearance; this.ultraButton1.Dock = DockStyle.Fill; this.ultraButton1.Font = new Font("Arial", 18f, FontStyle.Bold, GraphicsUnit.Point, 0); this.ultraButton1.Location = new Point(0x148, 8); this.ultraButton1.Name = "ultraButton1"; this.ultraButton1.Size = new Size(780, 0x2c); this.ultraButton1.TabIndex = 1; this.ultraButton1.Text = "NASLOV"; this.ultraButton1.UseOsThemes = DefaultableBoolean.False; this.ultraChart1.ChartType = ChartType.BarChart; this.ultraChart1.Axis.BackColor = Color.FromArgb(0xff, 0xf8, 220); element.ElementType = PaintElementType.None; element.Fill = Color.FromArgb(0xff, 0xf8, 220); this.ultraChart1.Axis.PE = element; this.ultraChart1.Axis.X.Extent = 20; this.ultraChart1.Axis.X.Labels.Font = new Font("Verdana", 12f, FontStyle.Bold, GraphicsUnit.Point, 0); this.ultraChart1.Axis.X.Labels.FontColor = Color.Red; this.ultraChart1.Axis.X.Labels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.X.Labels.ItemFormatString = "<DATA_VALUE:0>"; this.ultraChart1.Axis.X.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.X.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.X.Labels.SeriesLabels.Font = new Font("Verdana", 20.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.ultraChart1.Axis.X.Labels.SeriesLabels.FontColor = Color.DimGray; this.ultraChart1.Axis.X.Labels.SeriesLabels.FormatString = ""; this.ultraChart1.Axis.X.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.X.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.X.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.X.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.X.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.X.LineThickness = 1; this.ultraChart1.Axis.X.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.X.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.X.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.X.MajorGridLines.Visible = true; this.ultraChart1.Axis.X.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.X.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.X.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.X.MinorGridLines.Visible = false; this.ultraChart1.Axis.X.RangeMax = 100.0; this.ultraChart1.Axis.X.RangeType = AxisRangeType.Custom; this.ultraChart1.Axis.X.TickmarkInterval = 10.0; this.ultraChart1.Axis.X.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.X.Visible = true; this.ultraChart1.Axis.X2.Labels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.X2.Labels.FontColor = Color.Gray; this.ultraChart1.Axis.X2.Labels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.X2.Labels.ItemFormatString = "<DATA_VALUE:00.##>"; this.ultraChart1.Axis.X2.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.X2.Labels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.X2.Labels.SeriesLabels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.X2.Labels.SeriesLabels.FontColor = Color.Gray; this.ultraChart1.Axis.X2.Labels.SeriesLabels.FormatString = ""; this.ultraChart1.Axis.X2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.X2.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.X2.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.X2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.X2.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.X2.Labels.Visible = false; this.ultraChart1.Axis.X2.LineThickness = 1; this.ultraChart1.Axis.X2.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.X2.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.X2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.X2.MajorGridLines.Visible = true; this.ultraChart1.Axis.X2.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.X2.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.X2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.X2.MinorGridLines.Visible = false; this.ultraChart1.Axis.X2.TickmarkInterval = 40.0; this.ultraChart1.Axis.X2.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.X2.Visible = false; this.ultraChart1.Axis.Y.Extent = 400; this.ultraChart1.Axis.Y.Labels.Font = new Font("Verdana", 24f, FontStyle.Bold, GraphicsUnit.Point, 0); this.ultraChart1.Axis.Y.Labels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.Y.Labels.ItemFormatString = "<ITEM_LABEL>"; this.ultraChart1.Axis.Y.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Y.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Y.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Y.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.Y.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y.Labels.SeriesLabels.Visible = false; this.ultraChart1.Axis.Y.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y.LineThickness = 1; this.ultraChart1.Axis.Y.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Y.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.Y.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Y.MajorGridLines.Visible = true; this.ultraChart1.Axis.Y.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Y.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.Y.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Y.MinorGridLines.Visible = false; this.ultraChart1.Axis.Y.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.Y.Visible = true; this.ultraChart1.Axis.Y2.Labels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Y2.Labels.FontColor = Color.Gray; this.ultraChart1.Axis.Y2.Labels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Y2.Labels.ItemFormatString = "<ITEM_LABEL>"; this.ultraChart1.Axis.Y2.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Y2.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Y2.Labels.SeriesLabels.FontColor = Color.Gray; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y2.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y2.Labels.Visible = false; this.ultraChart1.Axis.Y2.LineThickness = 1; this.ultraChart1.Axis.Y2.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Y2.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.Y2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Y2.MajorGridLines.Visible = true; this.ultraChart1.Axis.Y2.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Y2.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.Y2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Y2.MinorGridLines.Visible = false; this.ultraChart1.Axis.Y2.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.Y2.Visible = false; this.ultraChart1.Axis.Z.Labels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Z.Labels.FontColor = Color.DimGray; this.ultraChart1.Axis.Z.Labels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Z.Labels.ItemFormatString = ""; this.ultraChart1.Axis.Z.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Z.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Z.Labels.SeriesLabels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Z.Labels.SeriesLabels.FontColor = Color.DimGray; this.ultraChart1.Axis.Z.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Z.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Z.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Z.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Z.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Z.Labels.Visible = false; this.ultraChart1.Axis.Z.LineThickness = 1; this.ultraChart1.Axis.Z.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Z.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.Z.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Z.MajorGridLines.Visible = true; this.ultraChart1.Axis.Z.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Z.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.Z.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Z.MinorGridLines.Visible = false; this.ultraChart1.Axis.Z.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.Z.Visible = false; this.ultraChart1.Axis.Z2.Labels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Z2.Labels.FontColor = Color.Gray; this.ultraChart1.Axis.Z2.Labels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Z2.Labels.ItemFormatString = ""; this.ultraChart1.Axis.Z2.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Z2.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Z2.Labels.SeriesLabels.FontColor = Color.Gray; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Z2.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Z2.Labels.Visible = false; this.ultraChart1.Axis.Z2.LineThickness = 1; this.ultraChart1.Axis.Z2.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Z2.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.Z2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Z2.MajorGridLines.Visible = true; this.ultraChart1.Axis.Z2.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Z2.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.Z2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Z2.MinorGridLines.Visible = false; this.ultraChart1.Axis.Z2.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.Z2.Visible = false; this.ultraChart1.BackgroundImageLayout = ImageLayout.Center; item.ChartTextFont = new Font("Arial", 20.25f, FontStyle.Regular, GraphicsUnit.Point, 0); item.Column = -2; item.HorizontalAlign = StringAlignment.Far; item.ItemFormatString = "<DATA_VALUE:0>"; item.Row = -2; item.Visible = true; appearance2.ChartText.Add(item); this.ultraChart1.BarChart = appearance2; this.ultraChart1.ColorModel.AlphaLevel = 150; this.ultraChart1.ColorModel.ColorBegin = Color.Pink; this.ultraChart1.ColorModel.ColorEnd = Color.DarkRed; this.ultraChart1.ColorModel.ModelStyle = ColorModels.CustomLinear; this.ultraChart1.Dock = DockStyle.Fill; this.ultraChart1.Effects.Effects.Add(effect); this.ultraChart1.EmptyChartText = "Učitavanje podataka..."; this.ultraChart1.Legend.Location = LegendLocation.Left; this.ultraChart1.Location = new Point(0x148, 0x3a); this.ultraChart1.Name = "ultraChart1"; this.ultraChart1.Size = new Size(780, 0xcc); this.ultraChart1.TabIndex = 2; this.ultraChart1.Tooltips.HighlightFillColor = Color.DimGray; this.ultraChart1.Tooltips.HighlightOutlineColor = Color.DarkGray; this.panel1.Controls.Add(this.pictureBox2); this.panel1.Controls.Add(this.pictureBox1); this.panel1.Dock = DockStyle.Fill; this.panel1.Location = new Point(5, 5); this.panel1.Margin = new Padding(0); this.panel1.Name = "panel1"; this.tableLayoutPanel1.SetRowSpan(this.panel1, 2); this.panel1.Size = new Size(320, 260); this.panel1.TabIndex = 3; this.pictureBox2.BackColor = Color.Sienna; this.pictureBox2.BackgroundImageLayout = ImageLayout.Stretch; this.pictureBox2.BorderStyle = BorderStyle.FixedSingle; this.pictureBox2.Location = new Point(0, 0); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new Size(100, 50); this.pictureBox2.TabIndex = 1; this.pictureBox2.TabStop = false; this.pictureBox1.BackColor = Color.Maroon; this.pictureBox1.BackgroundImageLayout = ImageLayout.Stretch; this.pictureBox1.BorderStyle = BorderStyle.Fixed3D; this.pictureBox1.Dock = DockStyle.Fill; this.pictureBox1.Location = new Point(0, 0); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new Size(320, 260); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.backgroundWorker1.DoWork += new DoWorkEventHandler(this.backgroundWorker1_DoWork); this.backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted); base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; base.Controls.Add(this.tableLayoutPanel1); base.Margin = new Padding(10, 15, 3, 0); base.Name = "UVSvest"; base.Size = new Size(0x45d, 270); this.tableLayoutPanel1.ResumeLayout(false); this.ultraChart1.EndInit(); this.panel1.ResumeLayout(false); ((ISupportInitialize)this.pictureBox2).EndInit(); ((ISupportInitialize)this.pictureBox1).EndInit(); base.ResumeLayout(false); }
//public static UltraChart GetChart2(UltraChart chart, object datasource, int width, int height) //{ // if ((chart == null)) // { // chart = new UltraChart(); // } // chart.FillSceneGraph += TemperaturChartFillSceneGraph; // var ultraChart = chart; // ultraChart.AccessKey = "A"; // //.ID = "ChartVergleichJahr" // ultraChart.ChartType = ChartType.LineChart; // ultraChart.ImagePipePageName = Constants.ImagePipePageName; ; // ultraChart.DeploymentScenario = deploymentScenario; // ultraChart.Width = width; // ultraChart.Height = height; // ultraChart.Border.Thickness = 0; // var colorModel = ultraChart.ColorModel; // colorModel.ModelStyle = ColorModels.CustomLinear; // //.AlphaLevel = 150 // colorModel.CustomPalette = Constants.ChartColors; // var gradientEffect = new GradientEffect // { // Coloring = GradientColoringStyle.Darken // }; // ultraChart.Effects.Add(gradientEffect); // //LineAppearance Start // var lineApp1 = new LineAppearance // { // Thickness = 2, // LineStyle = // { // DrawStyle = LineDrawStyle.Dash, // MidPointAnchors = false // }, // }; // lineApp1.IconAppearance.Icon = SymbolIcon.None; // var lineApp2 = new LineAppearance // { // LineStyle = // { // DrawStyle = LineDrawStyle.Solid, // MidPointAnchors = true, // EndStyle = LineCapStyle.DiamondAnchor // }, // Thickness = 2 // }; // //LineAppearance END // var lineChart = ultraChart.LineChart; // lineChart.LineAppearances.Add(lineApp2); // lineChart.LineAppearances.Add(lineApp2); // lineChart.LineAppearances.Add(lineApp1); // lineChart.NullHandling = NullHandling.InterpolateSimple; // lineChart.TreatDateTimeAsString = false; // lineChart.Thickness = 1; // //*** Line width **** // lineChart.MidPointAnchors = true; // var legend = ultraChart.Legend; // legend.Visible = true; // legend.Location = LegendLocation.Top; // legend.SpanPercentage = 6; // legend.BorderThickness = 0; // legend.AlphaLevel = 15; // legend.DataAssociation = ChartTypeData.DefaultData; // var marginsAppearance = legend.Margins; // marginsAppearance.Bottom = 1; // marginsAppearance.Top = 1; // marginsAppearance.Left = 50; // marginsAppearance.Right = 1; // var axis = ultraChart.Axis; // axis.PE.ElementType = PaintElementType.None; // axis.PE.Fill = Color.Cornsilk; // //'*** Implementierungs IRenderLabel für die Labels-Formatierung // { // Hashtable labelHash = new Hashtable(); // labelHash.Add("MY_MONTH_LABEL", new TempMonthLabelRenderer()); // chart.LabelHash = labelHash; // chart.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.Custom; // chart.Axis.X.Labels.ItemFormatString = "<MY_MONTH_LABEL>"; // } // //'*** END Implementierungs IRenderLabel-Interface für die Labels-Formatierung // var axisX = ultraChart.Axis.X; // axisX.Extent = 10; // axisX.LineColor = Color.LightGray; // axisX.LineThickness = 1; // axisX.TickmarkStyle = AxisTickStyle.DataInterval; // axisX.TickmarkInterval = 1; // axisX.TickmarkIntervalType = AxisIntervalType.Months; // //axisX.Labels.ItemFormatString = "<ITEM_LABEL:MMM>"; // axisX.Labels.Orientation = TextOrientation.Horizontal; // axisX.Labels.VerticalAlign = StringAlignment.Far; // axisX.Labels.HorizontalAlign = StringAlignment.Far; // axisX.Labels.Font = new Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point); // axisX.Labels.FontColor = Color.DimGray; // //axisX.Labels.SeriesLabels.Font = new Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point); // //axisX.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing; // //axisX.Labels.SeriesLabels.FontColor = Color.DimGray; // //axisX.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; // //axisX.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; // axisX.MajorGridLines.Visible = false; // axisX.MinorGridLines.Visible = false; // var axisY = ultraChart.Axis.Y; // axisY.Extent = 15; // axisY.LineThickness = 1; // axisY.TickmarkInterval = 10; // axisY.TickmarkStyle = AxisTickStyle.Smart; // axisY.Labels.Orientation = TextOrientation.Horizontal; // axisY.Labels.HorizontalAlign = StringAlignment.Far; // axisY.Labels.VerticalAlign = StringAlignment.Center; // axisY.Labels.ItemFormatString = "<DATA_VALUE:00.##>"; // axisY.Labels.Font = new Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point); // axisY.Labels.FontColor = Color.DimGray; // //.Labels.SeriesLabels.Font = New Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point) // //.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing // //.Labels.SeriesLabels.FontColor = Color.DimGray // //.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far // //.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center // axisY.MinorGridLines.Visible = false; // //With .MajorGridLines // // .Visible = True // // .AlphaLevel = 255 // // .Color = Color.LightGray // // .DrawStyle = LineDrawStyle.Solid // // .Thickness = 1 // //End With // var titleLeft = ultraChart.TitleLeft; // titleLeft.Visible = true; // titleLeft.Text = "Mittlere Außentemperatur [°C]"; // titleLeft.Extent = 15; // titleLeft.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point); // titleLeft.HorizontalAlign = StringAlignment.Center; // var titleLeftMarginswith10 = titleLeft.Margins; // titleLeftMarginswith10.Bottom = 1; // titleLeftMarginswith10.Top = 1; // titleLeftMarginswith10.Left = 1; // titleLeftMarginswith10.Right = 1; // var titleTop = ultraChart.TitleTop; // titleTop.Extent = 33; // titleTop.ClipText = false; // titleTop.Font = new Font("Arial", 8, FontStyle.Bold, GraphicsUnit.Point); // var titleTopMargins = titleTop.Margins; // titleTopMargins.Bottom = 10; // titleTopMargins.Top = 0; // titleTopMargins.Left = 15; // titleTopMargins.Right = 0; // var titleBottom = ultraChart.TitleBottom; // titleBottom.Visible = false; // //' ''*** Implementierungs IRenderLabel für die Labels-Formatierung // Hashtable labelHash2 = new Hashtable(); // labelHash2.Add("MY_TOOLTIP_LABEL", new TemperaturLabelRenderer()); // if (chart.LabelHash == null) // { // ultraChart.LabelHash = labelHash2; // } // else // { // ultraChart.LabelHash.Add("MY_TOOLTIP_LABEL", new TemperaturLabelRenderer()); // } // var tooltips = ultraChart.Tooltips; // tooltips.FormatString = "<MY_TOOLTIP_LABEL>"; // tooltips.Overflow = TooltipOverflow.ClientArea; // tooltips.BorderThickness = 0; // tooltips.EnableFadingEffect = true; // ultraChart.Drill.Enabled = true; // ultraChart.Drill.DrillElements = new DrillElement[] { new DrillElement() }; // ultraChart.Drill.DrillElements[0].DrillDown = new TemperaturDrillDown(chart); // var data = ultraChart.Data; // //.UseRowLabelsColumn = True // //.ZeroAligned = True // data.SwapRowsAndColumns = true; // data.EmptyStyle.EnableLineStyle = true; // data.EmptyStyle.EnablePoint = true; // data.EmptyStyle.EnablePE = true; // data.DataSource = datasource; // data.DataBind(); // return chart; //} public static UltraChart GetChart(UltraChart chart, object datasource, int width, int height, params string[] columnLabels) { if ((chart == null)) { chart = new UltraChart(); } if (columnLabels != null) { chart.Data.SetColumnLabels(columnLabels); } chart.FillSceneGraph += TemperaturChartFillSceneGraph; var ultraChart = chart; ultraChart.AccessKey = "A"; //.ID = "ChartVergleichJahr" ultraChart.ChartType = ChartType.LineChart; ultraChart.ImagePipePageName = Constants.ImagePipePageName; ultraChart.DeploymentScenario = deploymentScenario; ultraChart.Width = width; ultraChart.Height = height; ultraChart.Border.Thickness = 0; var colorModel = ultraChart.ColorModel; colorModel.ModelStyle = ColorModels.CustomLinear; //.AlphaLevel = 150 colorModel.CustomPalette = Constants.ChartColors; var gradientEffect = new GradientEffect { Coloring = GradientColoringStyle.Darken }; ultraChart.Effects.Add(gradientEffect); //LineAppearance Start var lineApp1 = new LineAppearance { Thickness = 2, LineStyle = { DrawStyle = LineDrawStyle.Dash, MidPointAnchors = false }, }; lineApp1.IconAppearance.Icon = SymbolIcon.None; lineApp1.IconAppearance.IconSize = SymbolIconSize.Small; var lineApp2 = new LineAppearance { LineStyle = { DrawStyle = LineDrawStyle.Solid, MidPointAnchors = true, EndStyle = LineCapStyle.DiamondAnchor }, Thickness = 2 }; lineApp2.IconAppearance.IconSize = SymbolIconSize.Small; //LineAppearance END var lineChart = ultraChart.LineChart; lineChart.LineAppearances.Add(lineApp2); lineChart.LineAppearances.Add(lineApp2); lineChart.LineAppearances.Add(lineApp1); lineChart.NullHandling = NullHandling.InterpolateSimple; lineChart.TreatDateTimeAsString = false; lineChart.Thickness = 1; //*** Line width **** lineChart.MidPointAnchors = true; var legend = ultraChart.Legend; legend.Visible = true; legend.Location = LegendLocation.Top; legend.SpanPercentage = 6; legend.BorderThickness = 0; legend.AlphaLevel = 15; legend.DataAssociation = ChartTypeData.DefaultData; var marginsAppearance = legend.Margins; marginsAppearance.Bottom = 1; marginsAppearance.Top = 1; marginsAppearance.Left = 50; marginsAppearance.Right = 1; var axis = ultraChart.Axis; axis.PE.ElementType = PaintElementType.None; axis.PE.Fill = Color.Cornsilk; //'*** Implementierungs IRenderLabel für die Labels-Formatierung { Hashtable labelHash = new Hashtable(); labelHash.Add("MY_MONTH_LABEL", new TempMonthLabelRenderer()); chart.LabelHash = labelHash; chart.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.Custom; chart.Axis.X.Labels.ItemFormatString = "<MY_MONTH_LABEL>"; } //'*** END Implementierungs IRenderLabel-Interface für die Labels-Formatierung var axisX = ultraChart.Axis.X; axisX.Extent = 15; axisX.LineColor = Color.LightGray; axisX.LineThickness = 1; axisX.TickmarkStyle = AxisTickStyle.DataInterval; axisX.TickmarkInterval = 1; axisX.TickmarkIntervalType = AxisIntervalType.Months; //axisX.Labels.ItemFormatString = "<ITEM_LABEL:MMM>"; axisX.Labels.Orientation = TextOrientation.Horizontal; axisX.Labels.VerticalAlign = StringAlignment.Far; axisX.Labels.HorizontalAlign = StringAlignment.Far; axisX.Labels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisX.Labels.FontColor = Color.Black; axisX.Labels.Layout.Padding = 15; //axisX.Labels.SeriesLabels.Font = new Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point); //axisX.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing; //axisX.Labels.SeriesLabels.FontColor = Color.DimGray; //axisX.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; //axisX.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; axisX.MajorGridLines.Visible = false; axisX.MinorGridLines.Visible = false; var axisY = ultraChart.Axis.Y; axisY.Extent = 30; axisY.LineThickness = 1; axisY.TickmarkInterval = 10; axisY.TickmarkStyle = AxisTickStyle.Smart; axisY.Labels.Orientation = TextOrientation.Horizontal; axisY.Labels.HorizontalAlign = StringAlignment.Far; //axisY.Labels.VerticalAlign = StringAlignment.Center; axisY.Labels.ItemFormatString = "<DATA_VALUE:00.######>"; axisY.Labels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisY.Labels.FontColor = Color.Black; //.Labels.SeriesLabels.Font = New Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point) //.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing //.Labels.SeriesLabels.FontColor = Color.DimGray //.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far //.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center axisY.MinorGridLines.Visible = false; //With .MajorGridLines // .Visible = True // .AlphaLevel = 255 // .Color = Color.LightGray // .DrawStyle = LineDrawStyle.Solid // .Thickness = 1 //End With var titleLeft = ultraChart.TitleLeft; titleLeft.Visible = true; titleLeft.Text = "Mittlere Außentemperatur [°C]"; titleLeft.Extent = 15; titleLeft.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point); titleLeft.HorizontalAlign = StringAlignment.Center; var titleLeftMarginswith10 = titleLeft.Margins; titleLeftMarginswith10.Bottom = 1; titleLeftMarginswith10.Top = 1; titleLeftMarginswith10.Left = 1; titleLeftMarginswith10.Right = 1; var titleTop = ultraChart.TitleTop; titleTop.Extent = 33; titleTop.ClipText = false; titleTop.Font = new Font("Arial", 8, FontStyle.Bold, GraphicsUnit.Point); var titleTopMargins = titleTop.Margins; titleTopMargins.Bottom = 10; titleTopMargins.Top = 0; titleTopMargins.Left = 15; titleTopMargins.Right = 0; var titleBottom = ultraChart.TitleBottom; titleBottom.Visible = false; //' ''*** Implementierungs IRenderLabel für die Labels-Formatierung Hashtable labelHash2= new Hashtable(); labelHash2.Add("MY_TOOLTIP_LABEL", new TemperaturLabelRenderer()); if (chart.LabelHash == null) { ultraChart.LabelHash = labelHash2; } else { ultraChart.LabelHash.Add("MY_TOOLTIP_LABEL", new TemperaturLabelRenderer()); } var tooltips = ultraChart.Tooltips; tooltips.FormatString = "<MY_TOOLTIP_LABEL>"; tooltips.Overflow = TooltipOverflow.ClientArea; tooltips.BorderThickness = 0; tooltips.EnableFadingEffect = true; ultraChart.Drill.Enabled = true; ultraChart.Drill.DrillElements = new DrillElement[] { new DrillElement() }; ultraChart.Drill.DrillElements[0].DrillDown = new TemperaturDrillDown(chart); var data = ultraChart.Data; //.UseRowLabelsColumn = True //.ZeroAligned = True data.SwapRowsAndColumns = true; data.EmptyStyle.EnableLineStyle = true; data.EmptyStyle.EnablePoint = true; data.EmptyStyle.EnablePE = true; data.DataSource = datasource; data.DataBind(); return chart; }
private void Init() { var bg = CreateChild <UguiSprite>("bg"); { bg.Anchor = AnchorType.Fill; bg.SpriteName = "circle-320"; bg.Color = ColorPreset.DarkBackground; bg.Offset = Offset.Zero; } meterSprite = CreateChild <UguiSprite>("meter"); { meterSprite.Anchor = AnchorType.Fill; meterSprite.Offset = Offset.Zero; meterSprite.SpriteName = "circle-320"; meterSprite.ImageType = Image.Type.Filled; meterSprite.SetRadial360Fill(Image.Origin360.Top); meterGradient = meterSprite.AddEffect(new GradientEffect()); meterGradient.Component.direction = UIGradient.Direction.Vertical; meterGradient.Component.color1 = Color.white; meterGradient.Component.color2 = HexColor.Create("A0A0A0"); meterGradient.Component.offset = 0.75f; } rangeDisplay = CreateChild <RankCircleRange>("ranges"); { rangeDisplay.Anchor = AnchorType.Fill; rangeDisplay.Offset = new Offset(18f); } var mask = CreateChild <UguiSprite>("mask"); { mask.Anchor = AnchorType.Fill; mask.Offset = new Offset(28f); mask.Color = ColorPreset.DarkBackground; mask.SpriteName = "circle-320"; mask.AddEffect(new MaskEffect()); mapThumb = mask.CreateChild <MapImageDisplay>("thumb"); { mapThumb.Anchor = AnchorType.Fill; mapThumb.Offset = Offset.Zero; mapThumb.Color = new Color(1f, 1f, 1f, 0.25f); } } rankGlowSprite = CreateChild <UguiSprite>("rank-glow"); { rankGlowSprite.Size = new Vector2(256f, 256f); rankGlowSprite.SpriteName = "glow-128"; rankGlowSprite.Alpha = 0.625f; } rankLabel = CreateChild <Label>("rank"); { rankLabel.IsBold = true; rankLabel.FontSize = 128; rankShadowEffect = rankLabel.AddEffect(new ShadowEffect()); rankShadowEffect.Component.style = ShadowStyle.Outline8; } var accBg = CreateChild <UguiSprite>("acc-bg"); { accBg.Position = new Vector3(0f, -84f); accBg.Size = new Vector2(280f, 64f); accBg.SpriteName = "glow-128"; accBg.Color = Color.black; } accuracyLabel = CreateChild <Label>("accuracy"); { accuracyLabel.Position = accBg.Position; accuracyLabel.FontSize = 22; } OnEnableInited(); }
public static UltraChart GetChart(object datasource, int width, int height, params string[] columnLabels) { var chart = new UltraChart(); chart.FillSceneGraph += ChartOnFillSceneGraph; //.ID = "ChartVergleichJahr" chart.DeploymentScenario = deploymentScenario; chart.Width = width; chart.Height = height; chart.Border.Thickness = 0; var colorModel = chart.ColorModel; colorModel.ModelStyle = ColorModels.CustomLinear; //.AlphaLevel = 150 colorModel.CustomPalette = Constants.ChartColors; var gradientEffect = new GradientEffect { Coloring = GradientColoringStyle.Darken }; chart.Effects.Add(gradientEffect); chart.ChartType = ChartType.ColumnChart; chart.ImagePipePageName = Constants.ImagePipePageName; var cta = new ChartTextAppearance(); cta.ItemFormatString = "<DATA_VALUE:#0.00>"; cta.Visible = false; cta.ChartTextFont = new Font("Arial", 5, FontStyle.Regular, GraphicsUnit.Point); cta.Column = -2; cta.Row = -2; cta.VerticalAlign = StringAlignment.Far; cta.HorizontalAlign = StringAlignment.Center; var columnChart = chart.ColumnChart; columnChart.ChartText.Add(cta); columnChart.ColumnSpacing = 0; columnChart.SeriesSpacing = 1; var legend = chart.Legend; legend.BackgroundColor = Color.Transparent; legend.Visible = true; legend.Location = LegendLocation.Top; legend.SpanPercentage = 10; legend.BorderThickness = 0; legend.DataAssociation = ChartTypeData.LineData; var margins = legend.Margins; margins.Bottom = 1; margins.Top = 1; margins.Left = 50; margins.Right = 1; //'*** Implementierungs IRenderLabel für die Labels-Formatierung Hashtable labelHash = new Hashtable(); labelHash.Add("MY_MONTH_LABEL", new MonthLabelRenderer()); chart.LabelHash = labelHash; chart.Axis.X.Labels.SeriesLabels.Format = AxisSeriesLabelFormat.Custom; chart.Axis.X.Labels.SeriesLabels.FormatString = "<MY_MONTH_LABEL>"; //'*** END Implementierungs IRenderLabel-Interface für die Labels-Formatierung var axisX = chart.Axis.X; axisX.Extent = 30; axisX.LineColor = Color.Green; axisX.LineThickness = 1; axisX.TickmarkStyle = AxisTickStyle.Smart; axisX.TickmarkInterval = 1; axisX.Labels.Visible = false; //.Labels.ItemFormatString = "<ITEM_LABEL>" axisX.Labels.Orientation = TextOrientation.VerticalLeftFacing; axisX.Labels.HorizontalAlign = StringAlignment.Near; axisX.Labels.VerticalAlign = StringAlignment.Center; axisX.Labels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisX.Labels.FontColor = Color.Black; axisX.Labels.Layout.Padding = 25; //.Labels.SeriesLabels.Format = Infragistics.UltraChart.Shared.Styles.AxisSeriesLabelFormat.Custom //.Labels.SeriesLabels.FormatString = "<MY_MONTH_LABEL>" axisX.Labels.SeriesLabels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisX.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; axisX.Labels.SeriesLabels.FontColor = Color.Black; axisX.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; axisX.Labels.SeriesLabels.VerticalAlign = StringAlignment.Near; axisX.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; axisX.Labels.SeriesLabels.Layout.Padding = 20; axisX.MajorGridLines.Visible = false; axisX.MinorGridLines.Visible = false; var axisY = chart.Axis.Y; axisY.Extent = 20; axisY.LineThickness = 1; axisY.TickmarkInterval = 1; axisY.TickmarkStyle = AxisTickStyle.Smart; //.RangeType = AxisRangeType.Custom //.RangeMin = -3 //.RangeMax = 2 //.Margin.Near.Value = 20 'New Infragistics.UltraChart.Resources.Appearance.AxisMargin( //.Margin.Far.Value = 20 axisY.Labels.Orientation = TextOrientation.Horizontal; axisY.Labels.HorizontalAlign = StringAlignment.Far; axisY.Labels.ItemFormatString = "<DATA_VALUE:0.##>"; axisY.Labels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisY.Labels.FontColor = Color.Black; axisY.Labels.SeriesLabels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisY.Labels.SeriesLabels.FontColor = Color.Black; axisY.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; axisY.Labels.SeriesLabels.FontColor = Color.Black; axisY.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; axisY.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; var titleLeft = chart.TitleLeft; titleLeft.Visible = true; titleLeft.Extent = 30; titleLeft.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point); titleLeft.HorizontalAlign = StringAlignment.Center; titleLeft.Text = "Monat war im Vergleich zum Langzeitmittel" + Environment.NewLine + " kälter / wärmer [%]"; var titleLeftmargins = titleLeft.Margins; titleLeftmargins.Bottom = 1; titleLeftmargins.Top = 1; titleLeftmargins.Left = 1; titleLeftmargins.Right = 1; var titleTop = chart.TitleTop; titleTop.Extent = 33; titleTop.Font = new Font("Arial", 8, FontStyle.Bold, GraphicsUnit.Point); var titleTopMargins = titleTop.Margins; titleTopMargins.Bottom = 10; titleTopMargins.Top = 0; titleTopMargins.Left = 15; titleTopMargins.Right = 0; var titleBottom = chart.TitleBottom; titleBottom.Text = ""; titleBottom.Extent = 33; titleBottom.Font = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Bold, GraphicsUnit.Point); titleBottom.HorizontalAlign = StringAlignment.Center; var titleBottomMargins = titleBottom.Margins; titleBottomMargins.Bottom = 1; titleBottomMargins.Top = 1; titleBottomMargins.Left = 1; titleBottomMargins.Right = 1; var tooltips = chart.Tooltips; tooltips.FormatString = "<DATA_VALUE:0.000000>"; var data = chart.Data; if (columnLabels != null) { data.SetColumnLabels(columnLabels); } //data.SetColumnLabels(new string[] { // "Vorjahr", // "Aktuelles Jahr", // "Langzeitmittel (Nulllinie)" //}); data.UseRowLabelsColumn = true; data.ZeroAligned = true; data.DataSource = datasource; data.DataBind(); try { data.IncludeColumn("Promille", false); data.IncludeColumn("Vorjahr gewichtet", false); data.IncludeColumn("Aktuelles Jahr gewichtet", false); } catch (Exception ex) { } return chart; }
public static UltraChart GetChart(MeteoGtzYear meteoGtzYear, int width, int height, bool pdf = false) { isPdf = pdf; var relativeDataForChart = meteoGtzYear.ToRelativeDataForChart(); var datasource = relativeDataForChart.ToDataTable(); var chart = new UltraChartEx(); chart.ExtraData = meteoGtzYear; AddAnnotation(chart, meteoGtzYear, pdf); chart.FillSceneGraph += ChartOnFillSceneGraph; //.ID = "ChartVergleichJahr" chart.DeploymentScenario = deploymentScenario; chart.Width = width; chart.Height = height; chart.Border.Thickness = 0; var colorModel = chart.ColorModel; colorModel.ModelStyle = ColorModels.CustomLinear; //.AlphaLevel = 150 colorModel.CustomPalette = Constants.YearsChartColors; var gradientEffect = new GradientEffect { Coloring = GradientColoringStyle.Darken }; chart.Effects.Add(gradientEffect); chart.ChartType = ChartType.ColumnChart; chart.ImagePipePageName = Constants.ImagePipePageName; var data = chart.Data; data.SetColumnLabels(new string[] { "Aktuelles Jahr", "Vorjahr", "Vorvorjahr" }); data.UseRowLabelsColumn = true; data.ZeroAligned = true; var cta = new ChartTextAppearance(); cta.ItemFormatString = "<DATA_VALUE:#0.00>"; cta.Visible = false; cta.ChartTextFont = new Font("Arial", 5, FontStyle.Regular, GraphicsUnit.Point); cta.Column = -2; cta.Row = -2; cta.VerticalAlign = StringAlignment.Far; cta.HorizontalAlign = StringAlignment.Center; var columnChart = chart.ColumnChart; columnChart.ChartText.Add(cta); columnChart.ColumnSpacing = 4; columnChart.SeriesSpacing = 1; var legend = chart.Legend; legend.Visible = false; var margins = legend.Margins; margins.Bottom = 1; margins.Top = 1; margins.Left = 50; margins.Right = 1; ////'*** Implementierungs IRenderLabel für die Labels-Formatierung //Hashtable labelHash = new Hashtable(); //labelHash.Add("MY_LABEL", new MyLabelRenderer()); //chart.LabelHash = labelHash; //chart.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.Custom; //chart.Axis.X.Labels.ItemFormatString = "<MY_LABEL>"; ////'*** END Implementierungs IRenderLabel-Interface für die Labels-Formatierung var axisX = chart.Axis.X; axisX.Extent = 15; //axisX.LineColor = Color.Green; axisX.LineThickness = 1; axisX.TickmarkStyle = AxisTickStyle.Smart; axisX.TickmarkInterval = 1; //axisX.Labels.Visible = false; axisX.Labels.ItemFormatString = "<ITEM_LABEL>"; axisX.Labels.Orientation = TextOrientation.Horizontal; axisX.Labels.HorizontalAlign = StringAlignment.Near; axisX.Labels.VerticalAlign = StringAlignment.Center; axisX.Labels.Font = new Font("Verdana", 8, FontStyle.Regular, GraphicsUnit.Point); axisX.Labels.FontColor = Color.Black; axisX.Labels.SeriesLabels.Visible = false; axisX.MajorGridLines.Visible = false; axisX.MinorGridLines.Visible = false; axisX.Margin.Near.Value = MarginX; axisX.Margin.Far.Value = MarginX; var axisY = chart.Axis.Y; axisY.Extent = 65; axisY.LineThickness = 1; axisY.TickmarkInterval =2; axisY.TickmarkStyle = AxisTickStyle.Percentage; axisY.Labels.Visible = false; axisY.MajorGridLines.Visible = false; axisY.MinorGridLines.Visible = false; axisY.LineEndCapStyle = LineCapStyle.ArrowAnchor; axisY.RangeType = AxisRangeType.Custom; axisY.RangeMax = 130; var titleLeft = chart.TitleLeft; titleLeft.Visible = true; titleLeft.Extent = 15; titleLeft.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point); titleLeft.HorizontalAlign = StringAlignment.Center; titleLeft.VerticalAlign = StringAlignment.Center; //titleLeft.Text = "Temperatur"; var titleLeftmargins = titleLeft.Margins; titleLeftmargins.Bottom = 1; titleLeftmargins.Top = 1; titleLeftmargins.Left = 1; titleLeftmargins.Right = 1; var titleTop = chart.TitleTop; titleTop.Extent = 25; titleTop.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); titleTop.Text = " "; var titleTopMargins = titleTop.Margins; titleTopMargins.Bottom = 15; titleTopMargins.Top = 0; titleTopMargins.Left = 25; titleTopMargins.Right = 0; var titleBottom = chart.TitleBottom; titleBottom.Text = ""; titleBottom.Extent = 33; titleBottom.Font = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Bold, GraphicsUnit.Point); titleBottom.HorizontalAlign = StringAlignment.Center; var titleBottomMargins = titleBottom.Margins; titleBottomMargins.Bottom = 1; titleBottomMargins.Top = 1; titleBottomMargins.Left = 1; titleBottomMargins.Right = 1; var tooltips = chart.Tooltips; tooltips.FormatString = "<DATA_VALUE:#0.00>%"; data.DataSource = datasource; data.DataBind(); try { data.IncludeColumn("LGTZ", false); } catch (Exception exception) { } return chart; }
protected override void OnAttached() { GradientEffect gradientEffect = (GradientEffect)Element.Effects.First(e => e is GradientEffect); Color startColor = XFColorToWinColor(gradientEffect.StartColor); Color endColor = XFColorToWinColor(gradientEffect.EndColor); GradientStopCollection stops = new GradientStopCollection() { new GradientStop { Color = startColor, Offset = 0.0 }, new GradientStop() { Color = endColor, Offset = 1.0 } }; double angle = 90.0; switch (gradientEffect.Direction) { case GradientDirection.LeftRight: angle = 0.0; break; case GradientDirection.TopLeft_BottomRight: angle = 45.0; break; case GradientDirection.TopBottom: angle = 90.0; break; case GradientDirection.TopRight_BottomLeft: angle = 135.0; break; case GradientDirection.RightLeft: angle = 180.0; break; case GradientDirection.BottomRight_TopLeft: angle = 225.0; break; case GradientDirection.BottomTop: angle = 270.0; break; case GradientDirection.BottomLeft_TopRight: angle = 315.0; break; } LinearGradientBrush gradientBrush = new LinearGradientBrush(stops, angle); if (Control != null) { Control cntrl = Control as Control; if (cntrl != null) { prevBrush = cntrl.Background; cntrl.Background = gradientBrush; } } else { LayoutRenderer lrenderer = Container as LayoutRenderer; if (lrenderer != null) { prevBrush = lrenderer.Background; lrenderer.Background = gradientBrush; } else { PageRenderer prenderer = Container as PageRenderer; if (prenderer != null) { prevBrush = prenderer.Background; prenderer.Background = gradientBrush; } } } }
public void AddComponents(int layerIndex, GameObject spriteObject, Sprite sprite, TextureImporterSettings settings) { var layerText = layer.LayerText; Color textColor = layerText.FillColor; if (PsdSetting.Instance.curGUIType == GUIType.UGUI) { Text text = spriteObject.AddComponent <Text>(); text.horizontalOverflow = HorizontalWrapMode.Overflow; text.verticalOverflow = VerticalWrapMode.Overflow; if (PsdSetting.Instance.DefaultFontPath.EndsWith(".ttf")) { text.font = AssetDatabase.LoadAssetAtPath <Font>(PsdSetting.Instance.DefaultFontPath); } text.fontStyle = GetFontStyle(layerText); text.fontSize = (int)layerText.FontSize; text.rectTransform.SetAsFirstSibling(); text.rectTransform.sizeDelta = new Vector2(layer.Rect.width, layer.Rect.height); text.text = layerText.Text.Replace("\r\n", "\n").Replace("\r", "\n"); text.color = textColor; } else if (PsdSetting.Instance.curGUIType == GUIType.NGUI) { #if NGUI UILabel text = spriteObject.AddComponent <UILabel>(); //竖屏 text.overflowMethod = layer.Rect.width < layer.Rect.height ? UILabel.Overflow.ResizeHeight : UILabel.Overflow.ResizeFreely; if (PsdSetting.Instance.DefaultFontPath.EndsWith(".ttf")) { text.trueTypeFont = AssetDatabase.LoadAssetAtPath <Font>(PsdSetting.Instance.DefaultFontPath); } else { text.trueTypeFont = Resources.GetBuiltinResource <Font>("Arial.ttf"); } NGUISettings.ambigiousFont = text.trueTypeFont; text.depth = layerIndex; text.fontStyle = layerText.Style; if (text.fontStyle == FontStyle.Bold) { text.spacingX = (int)layerText.FontSize / 4; } text.fontSize = layerText.FontBaseline != 0 ? (int)layerText.FontSize / 2 : (int)layerText.FontSize; text.transform.SetAsFirstSibling(); if (layer.BaseEffect != null) { GradientEffect gradient = layer.BaseEffect.Gradient; if (gradient != null) { text.applyGradient = true; textColor = Color.white; text.gradientTop = gradient.TopColor; text.gradientBottom = gradient.BottomColor; } } if (layer.Effects != null) { EffectsLayer effectLayer = layer.Effects; if (effectLayer.IsDropShadow) { text.effectStyle = UILabel.Effect.Shadow; text.effectDistance = new Vector2(2, 2); text.effectColor = effectLayer.DropShadow.Color; } if (effectLayer.IsOuterGlow) { text.effectStyle = UILabel.Effect.Outline; text.effectColor = effectLayer.OuterGlow.Color; } } if (layerText.Underline) { text.text = string.Format("[u]{0}[/u]", layerText.Text); } else if (layerText.Strikethrough) { text.text = string.Format("[s]{0}[/s]", layerText.Text); } else if (layerText.FontBaseline == 1) { text.text = string.Format("[sub]{0}[/sub]", layerText.Text); } else if (layerText.FontBaseline == 2) { text.text = string.Format("[sup]{0}[/sup]", layerText.Text); } else { text.text = layerText.Text; } text.color = textColor; int width = text.overflowMethod == UILabel.Overflow.ResizeHeight ? (int)Math.Max(text.fontSize, layer.Rect.width) : (int)layer.Rect.width; int height = text.overflowMethod == UILabel.Overflow.ResizeHeight ? (int)layer.Rect.height : (int)Math.Max(text.fontSize, layer.Rect.height); text.SetDimensions(width, (int)height); if (text.overflowMethod == UILabel.Overflow.ClampContent) { NGUIEditorTools.RegisterUndo("Snap Dimensions", text); NGUIEditorTools.RegisterUndo("Snap Dimensions", text.transform); text.MakePixelPerfect(); } #endif } }
public static void ProcessChart(UltraChart chart_) { if (_overrides == null) return; if (chart_.ChartType == ChartType.Composite) { foreach (ChartArea area in chart_.CompositeChart.ChartAreas) { if (_overrides.ChartBackColor.HasValue && _overrides.ChartBackColorStop.HasValue) { area.PE.ElementType = PaintElementType.Gradient; area.PE.FillGradientStyle = GradientStyle.Vertical; area.PE.Fill = _overrides.ChartBackColor.Value; area.PE.FillStopColor = _overrides.ChartBackColorStop.Value; } if (_overrides.LineFrom.HasValue || _overrides.LineTo.HasValue) { foreach (AxisItem axis in area.Axes) { if (axis.LineColor == _overrides.LineFrom.Value) axis.LineColor = _overrides.LineTo.Value; if (axis.Labels.FontColor == _overrides.LineFrom.Value || axis.Labels.FontColor.Name.Equals("0")) axis.Labels.FontColor = _overrides.LineTo.Value; if (axis.Labels.SeriesLabels != null && axis.Labels.SeriesLabels.FontColor == _overrides.LineFrom) axis.Labels.SeriesLabels.FontColor = _overrides.LineTo.Value; } foreach (Infragistics.UltraChart.Data.Series.SeriesBase sb in chart_.CompositeChart.Series) { for (int i = 0; i < sb.PEs.Count; ++i) { if (sb.PEs[i].Fill == _overrides.LineFrom.Value) { sb.PEs.RemoveAt(i); sb.PEs.Insert(0, new PaintElement(_overrides.LineTo.Value)); } } } } foreach (ChartLayerAppearance chart in chart_.CompositeChart.ChartLayers) { if (chart.ChartType == ChartType.LineChart) { LineChartAppearance app = (LineChartAppearance) chart.ChartTypeAppearance; if (app.Thickness == 1) app.Thickness = 2; } } } } else { if(_overrides.ChartBackColor.HasValue) chart_.BackColor = _overrides.ChartBackColor.Value; if (_overrides.LineTo.HasValue) { chart_.Axis.X.LineColor = _overrides.LineTo.Value; chart_.Axis.Y.LineColor = _overrides.LineTo.Value; chart_.Axis.X.Labels.FontColor = _overrides.LineTo.Value; chart_.Axis.Y.Labels.FontColor = _overrides.LineTo.Value; chart_.Axis.X.Labels.SeriesLabels.FontColor = _overrides.LineTo.Value; chart_.Axis.Y.Labels.SeriesLabels.FontColor = _overrides.LineTo.Value; } GradientEffect gd = new GradientEffect(); gd.Style = GradientStyle.ForwardDiagonal; gd.Coloring = GradientColoringStyle.Lighten; chart_.Effects.Add(gd); } }