public HMIBarLevel() { this.sfCenter = new StringFormat(); this.sfCenterTop = new StringFormat(); this.sfLeftCenter = new StringFormat(); this.sfRightCenter = new StringFormat(); this.m_FillStyle = BarStyle.Hatch; this.m_BorderPen = new Pen(Color.Wheat, 1.0F); this.m_FillDirection = FillDirectionEnum.Up; this.ForeColor = Color.WhiteSmoke; this.sfCenterTop = new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Near }; this.sfCenter = new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }; this.sfLeftCenter = new StringFormat() { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }; this.sfRightCenter = new StringFormat() { Alignment = StringAlignment.Far, LineAlignment = StringAlignment.Center }; this.m_BarContentColor = Color.Red; this.m_BarFillBrush = new HatchBrush(HatchStyle.DarkDownwardDiagonal, Color.Black, Color.Red); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.CreateStaticImage(); }
private void btnChangeBarStyle_Click(object sender, EventArgs e) { BarStyle bs = gv.GetPredefinedBarStyle(BarType.ManualTask); bs.BarColor = Color.LightCoral; gv.BarStyles.Add(bs); }
private void btnChangeBarStyle_Click(object sender, EventArgs e) { BarStyle bs = gv.GetPredefinedBarStyle(BarType.ManualTask); bs.BarColor = System.Windows.Media.Colors.LightCoral; gv.BarStyles.Insert(0, bs); }
/// <summary> /// Bar Chart Style object. /// </summary> /// <param name="BarColor">Fill color for bars.</param> /// <param name="BarHoverColor">Fill color when hovered over.</param> /// <param name="Address">Grid Coordinates.</param> /// <param name="Margins">Margins in pixels.</param> /// <param name="Width">Width of the entire chart in pixels.</param> /// <param name="Height">Height of the entire chart in pixels.</param> /// <param name="YAxisLabel">Text displayed in top-left corner of chart.</param> /// <param name="TickMarksX">Approximate number of tick mark values for X Axis.</param> /// <param name="xTextRotation">Indicates if labels along x-axis are rotated.</param> /// <returns name="Style">Bar Chart Style.</returns> /// <search>bar, chart, style</search> public static BarStyle Style( [DefaultArgument("DSCore.Color.ByARGB(1,50,130,190)")] DSCore.Color BarColor, [DefaultArgument("DSCore.Color.ByARGB(1,255,0,0)")] DSCore.Color BarHoverColor, [DefaultArgument("Charts.MiscNodes.GetNull()")] GridAddress Address, [DefaultArgument("Charts.MiscNodes.Margins(20,40,20,40)")] Margins Margins, int Width = 1000, int Height = 500, string YAxisLabel = "Label", int TickMarksX = 10, bool xTextRotation = false) { BarStyle style = new BarStyle(); style.BarColor = sColor.FromArgb(BarColor.Alpha, BarColor.Red, BarColor.Green, BarColor.Blue); style.BarHoverColor = sColor.FromArgb(BarHoverColor.Alpha, BarHoverColor.Red, BarHoverColor.Green, BarHoverColor.Blue); style.Width = Width; style.Height = Height; style.YAxisLabel = YAxisLabel; style.TickMarksX = TickMarksX; style.xTextRotation = xTextRotation; style.Margins = Margins; if (Address != null) { style.GridRow = Address.X; style.GridColumn = Address.Y; } else { style.GridRow = 1; style.GridColumn = 1; } return(style); }
void SetColor(Color color) { if (!BarStyle.IsSupported()) { return; } Activity.SetStatusBarColor(color.ToAndroid()); }
private void SetDefaults() { _selectedBarStyle = BarStyle.TimeBar; _selectedTimeFrame = 5; _selectedVolume = 1000; _selectedRange = 0.5; _chartType = ChartType.FastCandlestick; _calendar = new DefaultDiscontinuousDateTimeCalendar(); _selectedCalendar = "Extended"; }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName); //ExStart:CustomizeTextWithTaskBars //ExFor: SaveOptions.BarStyles //ExSummary: Shows how to customize task bars by using <see cref="T:Aspose.Tasks.Visualization.BarStyle" />s. Project project = new Project(); Task task1 = project.RootTask.Children.Add("Task 1"); Task task2 = project.RootTask.Children.Add("Task 2"); task1.Set(Tsk.Duration, project.GetDuration(1, TimeUnitType.Day)); task2.Set(Tsk.Duration, project.GetDuration(1, TimeUnitType.Day)); project.TaskLinks.Add(task1, task2, TaskLinkType.FinishToStart); Task task3 = project.RootTask.Children.Add("Task 3"); Resource rsc1 = project.Resources.Add("Resource 1"); Resource rsc2 = project.Resources.Add("Resource 2"); Resource rsc3 = project.Resources.Add("Resource 3"); project.ResourceAssignments.Add(task1, rsc1); project.ResourceAssignments.Add(task2, rsc2); project.ResourceAssignments.Add(task3, rsc3); SaveOptions options = new PdfSaveOptions(); options.Timescale = Timescale.ThirdsOfMonths; BarStyle style = new BarStyle { ItemType = BarItemType.CriticalTask, BarTextConverter = delegate(Task t) { return(string.Format("This task (ID = {0}) is on critical path", t.Get(Tsk.Id))); } }; BarStyle style2 = new BarStyle { BarColor = Color.DarkOrchid, ItemType = BarItemType.Task }; options.BarStyles = new List <BarStyle> { style, style2 }; project.Save(dataDir + "CustomizeTextWithTaskBars.pdf", options); //ExEnd:CustomizeTextWithTaskBars }
private void btnChangeTaskStyle_Click(object sender, EventArgs e) { Task task3 = gv.Tasks.Search("Task 3"); if (task3 != null) { BarStyle bs = gv.GetPredefinedBarStyle(BarType.ManualTask); bs.BarColor = Color.Green; bs.BarShape = BarShape.MiddleBar; bs.StartShape = 19; bs.EndShape = 19; task3.BarStyles.Add(bs); } }
public static HtmlString RenderPagerBar( this HtmlHelper html, int page, int total, BarStyle style, int show ) { if (total == 1) { return new HtmlString(string.Empty); } else { StringBuilder sb = new StringBuilder(); string _path = html.ViewContext.HttpContext.Request.Path; sb.Append("<div class=\""); sb.Append(style.ToString()); sb.Append("\" >"); string queryString = html.ViewContext.HttpContext.Request.QueryString.ToString(); if (queryString.IndexOf("page=") < 0) { queryString += "page=" + page; } Regex re = new Regex(@"page=\d+", RegexOptions.IgnoreCase); string result = re.Replace(queryString, "page={0}"); if (page != 1) { sb.AppendFormat("<span><a href=\"{0}\" title=\"第一页\">{1}</a></span>", _path + "?" + string.Format(result, 1), "<<"); sb.AppendFormat("<span><a href=\"{0}\" title=\"上一页\">{1}</a></span>", _path + "?" + string.Format(result, page - 1), "<"); } if (page > ( show + 1 )) { sb.AppendFormat("<span><a href=\"{0}\" title=\"前" + ( show + 1 ) + "页\">{1}</a></span>", _path + "?" + string.Format(result, page - ( show + 1 )), ".."); } for (int i = page - show; i <= page + show; i++) { if (i == page) { sb.AppendFormat("<span class=\"current\">{0}</span>", i); } else { if (i > 0 & i <= total) { sb.AppendFormat("<span><a href=\"{0}\">{1}</a></span>", _path + "?" + string.Format(result, i), i); } } } if (page < ( total - ( show ) )) { sb.AppendFormat("<span><a href=\"{0}\" title=\"后" + ( show + 1 ) + "页\">{1}</a></span>", _path + "?" + string.Format(result, page + ( show + 1 )), ".."); } if (page < total) { sb.AppendFormat("<span><a href=\"{0}\" title=\"下一页\">{1}</a></span>", _path + "?" + string.Format(result, page + 1), ">"); sb.AppendFormat("<span><a href=\"{0}\" title=\"最后一页\">{1}</a></span>", _path + "?" + string.Format(result, total), ">>"); } sb.AppendFormat("<span class=\"current\">共{1}页</span>", page, total); sb.Append("</div>"); return new HtmlString(sb.ToString()); } }
public void CustomizeTextWithTaskBars() { // ExStart:CustomizeTextWithTaskBars // ExFor: SaveOptions.BarStyles // ExFor: BarItemType // ExSummary: Shows how to customize task bars by using <see cref="Aspose.Tasks.Visualization.BarStyle" />s. var project = new Project(); var task1 = project.RootTask.Children.Add("Task 1"); var task2 = project.RootTask.Children.Add("Task 2"); task1.Set(Tsk.Duration, project.GetDuration(1, TimeUnitType.Day)); task2.Set(Tsk.Duration, project.GetDuration(1, TimeUnitType.Day)); project.TaskLinks.Add(task1, task2, TaskLinkType.FinishToStart); var task3 = project.RootTask.Children.Add("Task 3"); var rsc1 = project.Resources.Add("Resource 1"); var rsc2 = project.Resources.Add("Resource 2"); var rsc3 = project.Resources.Add("Resource 3"); project.ResourceAssignments.Add(task1, rsc1); project.ResourceAssignments.Add(task2, rsc2); project.ResourceAssignments.Add(task3, rsc3); SaveOptions options = new PdfSaveOptions { Timescale = Timescale.ThirdsOfMonths }; var style = new BarStyle { ItemType = BarItemType.CriticalTask, BarTextConverter = delegate(Task t) { return(string.Format("This task (ID = {0}) is on critical path", t.Get(Tsk.Id))); } }; var style2 = new BarStyle { BarColor = Color.DarkOrchid, ItemType = BarItemType.Task }; options.BarStyles = new List <BarStyle> { style, style2 }; project.Save(OutDir + "CustomizeTextWithTaskBars_out.pdf", options); // ExEnd:CustomizeTextWithTaskBars }
/// <summary> /// UI Style function /// </summary> /// <param name="style"></param> /// <param name="font"></param> public void SetStyle(BarStyle style, Font font) { background.sprite = style.backgroundImage; background.color = style.fillColor; fill.sprite = style.fillImage; fill.color = style.fillColor; Color inverted = Color.white - style.textColor; inverted.a = 1f; valueText.color = style.textColor; valueTextInverted.color = inverted; valueTextInverted.font = valueText.font = font; valueTextInverted.resizeTextMinSize = valueText.resizeTextMinSize = 10; valueTextInverted.resizeTextMaxSize = valueText.resizeTextMaxSize = style.fontMaxSize; valueTextInverted.resizeTextForBestFit = valueText.resizeTextForBestFit = true; }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { BarData data = null; BarStyle style = null; if (!DA.GetData <BarData>(0, ref data)) { return; } if (!DA.GetData <BarStyle>(1, ref style)) { return; } d3BarChart chart = new d3BarChart(data, style); DA.SetData(0, chart); }
void SetStyle(StatusBarStyle style) { if (!BarStyle.IsSupported()) { return; } switch (style) { case StatusBarStyle.DarkContent: BarStyle.AddBarAppearanceFlag(Activity, (StatusBarVisibility)SystemUiFlags.LightStatusBar); break; default: BarStyle.RemoveBarAppearanceFlag(Activity, (StatusBarVisibility)SystemUiFlags.LightStatusBar); break; } }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object can be used to retrieve data from input parameters and /// to store data in output parameters.</param> protected override void SolveInstance(IGH_DataAccess DA) { Color barColor = Color.FromArgb(50, 130, 190); Color hoverColor = Color.FromArgb(255, 0, 0); GridAddress address = new GridAddress(1, 1); int width = 1000; int height = 500; string yAxisLabel = "Label"; int tickMarks = 2; bool xRotation = false; Margins margins = new Margins(); DA.GetData <Color>(0, ref barColor); DA.GetData <Color>(1, ref hoverColor); DA.GetData <GridAddress>(2, ref address); DA.GetData <Margins>(3, ref margins); DA.GetData <int>(4, ref width); DA.GetData <int>(5, ref height); DA.GetData <string>(6, ref yAxisLabel); DA.GetData <int>(7, ref tickMarks); DA.GetData <bool>(8, ref xRotation); // create style BarStyle style = new BarStyle(); style.BarColor = ChartsUtilities.ColorToHexString(barColor); style.BarHoverColor = ChartsUtilities.ColorToHexString(hoverColor); style.GridRow = address.X; style.GridColumn = address.Y; style.Width = width; style.Height = height; style.YAxisLabel = yAxisLabel; style.TickMarksX = tickMarks; style.xTextRotation = xRotation; style.Margins = margins; style.SizeX = (int)Math.Ceiling(width / 100d); style.SizeY = (int)Math.Ceiling(height / 100d); DA.SetData(0, style); }
private void UpdateChartData(BarStyle barStyle) { PriceSeries priceData = null; switch (barStyle) { case BarStyle.TimeBar: priceData = TicksAggregator.GetPriceDataByTimeFrame(_ticks, _selectedTimeFrame, _calendar, out _min, out _max); break; case BarStyle.VolumeBar: priceData = TicksAggregator.GetPriceDataByVolume(_ticks, _selectedVolume, _calendar, _barTimeFrame, out _min, out _max); break; case BarStyle.RangeBar: priceData = TicksAggregator.GetPriceDataByRange(_ticks, _selectedRange, _calendar, _barTimeFrame, out _min, out _max); break; } UpdatePriceChart(priceData); _priceSeries.InvalidateParentSurface(RangeMode.ZoomToFit); }
public static HtmlString RenderPagerBar( this HtmlHelper html, int page, int total, BarStyle style ) { return RenderPagerBar(html, page, total, style, total); }
/// <summary> /// 获取属性值 /// </summary> /// <param name="name">属性名称</param> /// <param name="value">返回属性值</param> /// <param name="type">返回属性类型</param> public override void getProperty(String name, ref String value, ref String type) { if (name == "colorfield") { type = "int"; value = FCStr.convertIntToStr(ColorField); } else if (name == "downcolor") { type = "color"; value = FCStr.convertColorToStr(DownColor); } else if (name == "fieldname") { type = "int"; value = FCStr.convertIntToStr(FieldName); } else if (name == "fieldname2") { type = "int"; value = FCStr.convertIntToStr(FieldName2); } else if (name == "fieldtext") { type = "String"; value = FieldText; } else if (name == "fieldtext2") { type = "String"; value = FieldText2; } else if (name == "linewidth") { type = "float"; value = FCStr.convertFloatToStr(LineWidth); } else if (name == "style") { type = "enum:BarStyle"; BarStyle style = Style; if (style == BarStyle.Line) { value = "Line"; } else { value = "Rect"; } } else if (name == "stylefield") { type = "int"; value = FCStr.convertIntToStr(StyleField); } else if (name == "upcolor") { type = "double"; value = FCStr.convertColorToStr(UpColor); } else { base.getProperty(name, ref value, ref type); } }
public static string RenderPagerBar(this HtmlHelper html, int page, int total, BarStyle style, int show) { if (total == 1) { return(""); } else { StringBuilder sb = new StringBuilder(); string _path = html.ViewContext.HttpContext.Request.Path; sb.Append("<div class=\""); sb.Append(style.ToString()); sb.Append("\" >"); string queryString = html.ViewContext.HttpContext.Request.QueryString.ToString(); if (queryString.IndexOf("page=") < 0) { queryString += "&page=" + page; } Regex re = new Regex(@"page=\d+", RegexOptions.IgnoreCase); string result = re.Replace(queryString, "page={0}"); if (page != 1) { sb.AppendFormat("<span><a href=\"{0}\" title=\"第一页\">{1}</a></span>", _path + "?" + string.Format(result, 1), "<<"); sb.AppendFormat("<span><a href=\"{0}\" title=\"上一页\">{1}</a></span>", _path + "?" + string.Format(result, page - 1), "<"); } if (page > (show + 1)) { sb.AppendFormat("<span><a href=\"{0}\" title=\"前" + (show + 1) + "页\">{1}</a></span>", _path + "?" + string.Format(result, page - (show + 1)), ".."); } for (int i = page - show; i <= page + show; i++) { if (i == page) { sb.AppendFormat("<span class=\"current\">{0}</span>", i); } else { if (i > 0 & i <= total) { sb.AppendFormat("<span><a href=\"{0}\">{1}</a></span>", _path + "?" + string.Format(result, i), i); } } } if (page < (total - (show))) { sb.AppendFormat("<span><a href=\"{0}\" title=\"后" + (show + 1) + "页\">{1}</a></span>", _path + "?" + string.Format(result, page + (show + 1)), ".."); } if (page < total) { sb.AppendFormat("<span><a href=\"{0}\" title=\"下一页\">{1}</a></span>", _path + "?" + string.Format(result, page + 1), ">"); sb.AppendFormat("<span><a href=\"{0}\" title=\"最后一页\">{1}</a></span>", _path + "?" + string.Format(result, total), ">>"); } sb.AppendFormat("<span class=\"current\">共{1}页</span>", page, total); sb.Append("</div>"); return(sb.ToString()); } }
public static string RenderPagerBar(this HtmlHelper html, int page, int total, BarStyle style) { return(RenderPagerBar(html, page, total, style, total)); }
// unfortunately there is no easy way to do it with generics // http ://journal.stuffwithstuff.com/2008/03/05/checking-flags-in-c-enums/ public static bool FlagIsSet(BarStyle style, BarStyle flag) { return((style & flag) == flag); }
public void WorkWithBarStyle() { // ExStart // ExFor: BarStyle // ExFor: BarStyle.#ctor // ExFor: BarStyle.ItemType // ExFor: BarStyle.BarColor // ExFor: BarStyle.BarShape // ExFor: BarStyle.StartShape // ExFor: BarStyle.StartShapeColor // ExFor: BarStyle.EndShape // ExFor: BarStyle.EndShapeColor // ExFor: BarStyle.TextStyle // ExFor: BarStyle.BarTextConverter // ExFor: BarStyle.TaskToBarTextConverter // ExFor: BarShape // ExFor: Shape // ExSummary: Shows how to use custom bar styles. var project = new Project(DataDir + "Project2.mpp"); SaveOptions options = new PdfSaveOptions { BarStyles = new List <BarStyle>() }; // add a bar style for milestone tasks var style = new BarStyle(); // set <see cref="T:Aspose.Tasks.Visualization.BarItemType" /> of the bar style style.ItemType = BarItemType.Milestone; // set <see cref="T:System.Drawing.Color" /> of the bar style. style.BarColor = Color.Green; // set <see cref="P:Aspose.Tasks.Visualization.BarStyle.BarShape" /> of the bar style style.BarShape = BarShape.HalfHeight; // set <see cref="T:Aspose.Tasks.Visualization.Shape" /> at the beginning of the bar style.StartShape = Shape.LeftBracket; // set <see cref="T:System.Drawing.Color" /> of the shape at the beginning of the bar style.StartShapeColor = Color.Aqua; // set <see cref="T:Aspose.Tasks.Visualization.Shape" /> at the end of the bar style.EndShape = Shape.RightBracket; // set <see cref="T:System.Drawing.Color" /> of the shape at the end of the bar style.EndShapeColor = Color.Aquamarine; // set of the text to render on the right of the bar. style.TextStyle = new TextStyle(); style.TextStyle.BackgroundColor = Color.Black; // there is exists a feature that allow to convert a text of the bar // lets set converter to get text for the bar to render. style.BarTextConverter = task => { if (!task.Get(Tsk.Name).StartsWith("T")) { task.Set(Tsk.Name, "T" + task.Get(Tsk.Name)); } return(task.Get(Tsk.Name)); }; options.BarStyles.Add(style); // save the project project.Save(OutDir + "WorkWithBarStyle_out.mpp", options); // ExEnd }
/// <summary> /// New Bar Chart object. /// </summary> /// <param name="Data">Bar Chart Data.</param> /// <param name="Style">Bar Chart Style.</param> /// <returns name="Chart">Generated Bar Chart.</returns> /// <search>bar, chart</search> public static d3BarChart Chart(BarData Data, BarStyle Style) { d3BarChart chart = new d3BarChart(Data, Style); return(chart); }
public void LoadGreenContent(string text) { LoadContent("ButtonGreen", game.utilities.ui_screen_medium, text, game.utilities.BarTextColor, game.utilities.BarHighColor, game.utilities.BarImageColor); Style = Bar.BarStyle.TWOSIDES; }
/// <summary> /// New Bar Chart object. /// </summary> /// <param name="Data">Bar Chart Data.</param> /// <param name="Style">Bar Chart Style.</param> /// <returns name="Chart">Generated Bar Chart.</returns> /// <search>bar, chart</search> public static D3jsLib.BarChart.BarChart Chart(BarData Data, BarStyle Style) { D3jsLib.BarChart.BarChart chart = new D3jsLib.BarChart.BarChart(Data, Style); return(chart); }
public BarChartMulti(ChartFormat fmt) : base(fmt) { this.BarStyle = BarStyle.Vertical; }
public BarStyleColor(BarStyle value) { this.Value = value; }
public BarStyleColor(BarStyle value, string color) { this.Value = value; this.Color = color; }
// Other custom members you desire for your bad chart implementation public BarChart(BarData data, BarStyle style) { BarChartData = data; BarChartStyle = style; }
public BarChartMulti(ChartFormat fmt) : base(fmt) { this.BarStyle = BarStyle.Vertical; }