public IBarChart SetDirection(BarChartDirection direction) { BarDirection barDirection = this.barChart.GetFirstChild <BarDirection>() ?? this.barChart.AppendChild(new BarDirection()); barDirection.Val = (BarDirectionValues)direction; return(this); }
//-------------------------------------------------------------- // *** CINEMATIC BARS *** public void StartAnimation(BarDirection direction, float rate) { // Set fading rate & direction _AnimationSpeed = rate; _BarDirection = direction; // Begin animation _AnimationComplete = false; }
public UIBarController(RectTransform bar, int maxValue, BarDirection scaleDirection) { this.barElement = bar; position = bar.localPosition; maxHeight = bar.localScale.y; this.maxValue = maxValue; maxWidth = bar.localScale.x; fraction = maxHeight / maxValue; this.scaleDirection = scaleDirection; }
public UIBarController(RectTransform bar, int maxValue, BarDirection scaleDirection, int startValue) { this.barElement = bar; //position = bar.localPosition; maxHeight = bar.localScale.y; this.maxValue = maxValue; maxWidth = bar.localScale.x; fraction = maxHeight / maxValue; this.scaleDirection = scaleDirection; position = new Vector3(barElement.localPosition.x, barElement.localPosition.y - (fraction * maxValue / 2), barElement.localPosition.z); ChangeValue(startValue); }
/// <summary> /// Constructs a data bar object with the specified row index, column index, color, scale, and data bar or data bar and data. /// </summary> /// <param name="rowIndex">The row index.</param> /// <param name="columnIndex">The column index.</param> /// <param name="fillColor">The fill color of the data bar object.</param> /// <param name="borderColor">The border color of the data bar object.</param> /// <param name="showBorder">Whether to show the border of the data bar object.</param> /// <param name="axisColor">The axis color of the data bar object.</param> /// <param name="isGradient">The fill type of the data bar object.</param> /// <param name="direction">The direction the data bar object</param> /// <param name="axisLocation">The axis location the data bar object</param> /// <param name="scale">The scale of the data bar object.</param> /// <param name="showBarOnly"> /// <c>true</c>Show bar only; otherwise, <c>false</c>. /// </param> public DataBarDrawingObject(int rowIndex, int columnIndex, Windows.UI.Color fillColor, Windows.UI.Color borderColor, bool showBorder, Windows.UI.Color axisColor, bool isGradient, BarDirection direction, double axisLocation, double scale, bool showBarOnly) : base(rowIndex, columnIndex) { this.fillColor = fillColor; this.borderColor = borderColor; this.showBorder = showBorder; this.axisColor = axisColor; this.isGradient = isGradient; this.direction = direction; this.axisLocation = axisLocation; this.scale = scale; this.showBarOnly = showBarOnly; }
public ElementBar(char character) { // match the direction to the character if (character == '=') { this.direction = BarDirection.Horizontal; } else if (character == '|') { this.direction = BarDirection.Vertical; } else { throw new NotImplementedException(); } }
void Init(Windows.UI.Color color) { this.minScale = 0.0; this.maxScale = 1.0; this.gradient = true; this.color = color; this.showBorder = false; this.borderColor = Colors.Black; this.direction = BarDirection.LeftToRight; this.negativeFillColor = Colors.Red; this.useNegativeFillColor = true; this.negativeBorderColor = Colors.Black; this.useNegativeBorderColor = false; this.axisPosition = DataBarAxisPosition.Automatic; this.axisColor = Colors.Black; this.showBarOnly = false; }
public RenkoBox(DateTime timestamp, BarDirection barDirection, OHLC ohlc) { Timestamp = timestamp; Direction = barDirection; BoxInfo = ohlc; }
public static void DrawProgressBar(Rect Area, float val, float minVal, float maxVal, BarDirection Type, GUIStyle BackgroundStyle, GUIStyle BarStyle) { if (BarStyle != null) { Rect position = Area; float num = Mathf.Clamp((val - minVal) / (maxVal - minVal), 0f, 1f); if (BackgroundStyle != null) { Color color = GUI.color; GUI.color = Color.white; GUI.Box(position, string.Empty, BackgroundStyle); GUI.color = color; } switch (Type) { case BarDirection.Left: { float num3 = Area.width - Area.width * num; Area.x += num3; Area.width -= num3; GUI.BeginGroup(Area); GUI.Box(new Rect(0f - num3, 0f, position.width, position.height), GUIContent.none, BarStyle); GUI.EndGroup(); break; } case BarDirection.Right: Area.width *= num; GUI.BeginGroup(Area); GUI.Box(new Rect(0f, 0f, position.width, position.height), GUIContent.none, BarStyle); GUI.EndGroup(); break; case BarDirection.Up: { float num2 = Area.height - Area.height * num; Area.y += num2; Area.height -= num2; GUI.BeginGroup(Area); GUI.Box(new Rect(0f, 0f - num2, position.width, position.height), GUIContent.none, BarStyle); GUI.EndGroup(); break; } case BarDirection.Down: Area.height *= num; GUI.BeginGroup(Area); GUI.Box(new Rect(0f, 0f, position.width, position.height), GUIContent.none, BarStyle); GUI.EndGroup(); break; } } }
/// <summary> /// Generates the rule from its XML representation. /// </summary> /// <param name="reader">The XML reader.</param> protected override void OnReadXml(XmlReader reader) { base.OnReadXml(reader); switch (reader.Name) { case "Type0": base.scales[0] = new ScaleValue((ScaleValueType)Serializer.DeserializeObj(typeof(ScaleValueType), reader), base.scales[0].Value); return; case "Type2": base.scales[2] = new ScaleValue((ScaleValueType)Serializer.DeserializeObj(typeof(ScaleValueType), reader), base.scales[2].Value); return; case "Value0": base.scales[0] = new ScaleValue(base.scales[0].Type, Serializer.DeserializeObj(null, reader)); return; case "Value2": base.scales[2] = new ScaleValue(base.scales[2].Type, Serializer.DeserializeObj(null, reader)); return; case "MaxScale": this.maxScale = (double)((double)Serializer.DeserializeObj(typeof(double), reader)); return; case "MinScale": this.minScale = (double)((double)Serializer.DeserializeObj(typeof(double), reader)); return; case "Gradient": this.gradient = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); return; case "Color": this.color = (Windows.UI.Color)Serializer.DeserializeObj(typeof(Windows.UI.Color), reader); return; case "ShowBorder": this.showBorder = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); return; case "BorderColor": this.borderColor = (Windows.UI.Color)Serializer.DeserializeObj(typeof(Windows.UI.Color), reader); return; case "BarDirection": this.direction = (BarDirection)Serializer.DeserializeObj(typeof(BarDirection), reader); return; case "NegativeFillColor": this.negativeFillColor = (Windows.UI.Color)Serializer.DeserializeObj(typeof(Windows.UI.Color), reader); return; case "UseNegativeFillColor": this.useNegativeFillColor = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); return; case "NegativeBorderColor": this.negativeBorderColor = (Windows.UI.Color)Serializer.DeserializeObj(typeof(Windows.UI.Color), reader); return; case "UseNegativeBorderColor": this.useNegativeBorderColor = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); return; case "AxisPosition": this.axisPosition = (DataBarAxisPosition)Serializer.DeserializeObj(typeof(DataBarAxisPosition), reader); return; case "AxisColor": this.axisColor = (Windows.UI.Color)Serializer.DeserializeObj(typeof(Windows.UI.Color), reader); return; case "ShowBarOnly": this.showBarOnly = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); return; } }