private void chartControl1_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
        {
            AxisBase axis = e.Item.Axis;

            if (axis is AxisY || axis is AxisY3D || axis is RadarAxisY)
            {
                double axisValue = (double)e.Item.AxisValue;
                if (axisValue < 0)
                {
                    // Customize the axis label's color.
                    e.Item.TextColor = Color.Red;
                }
                else if (axisValue > 0)
                {
                    // Customize the axis label's text and color.
                    e.Item.Text      = "+" + e.Item.Text;
                    e.Item.TextColor = Color.Green;
                }
                else if (axisValue == 0)
                {
                    // Hide the axis labels.
                    e.Item.Text = "";
                }
            }
        }
Exemple #2
0
        private void DoCustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
        {
            if (AxesX.Count == 0)
            {
                return;
            }
            if (AxesY.Count == 0)
            {
                return;
            }

            if (e.Item.Axis == ((SwiftPlotDiagram)Diagram).AxisX)
            {
                double value    = (double)e.Item.AxisValue;
                long   secTicks = (long)value % 60000;
                long   minTick  = (long)value - secTicks;
                long   msec     = secTicks % 1000;
                long   sec      = secTicks / 1000;
                long   min      = minTick / 60000;

                e.Item.Text = $"{min}:{sec:d2}";
                if (msec > 0)
                {
                    e.Item.Text += $".{msec:d3}";
                }
            }
        }
Exemple #3
0
 protected void ChartControl_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     if (e.Item.Axis is AxisX && (DateTime)e.Item.AxisValue == EarliestDateTime)
     {
         e.Item.Text = "";
     }
 }
Exemple #4
0
 protected void ChartControl_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     if (e.Item.Axis is AxisY)
     {
         e.Item.Text = ScaleHelper.GetCurrencyAbbreviationMask(e.Item.Text, AbbreviationType);
     }
 }
 public static void CustomDrawAxisYLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     if (e.Item.Axis is AxisY)
     {
         double value = ((double)e.Item.AxisValue);
         e.Item.Text = DoubleToShortString(value);
     }
 }
Exemple #6
0
 private void chtMrIssues_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     if (e.Item.Axis is AxisX)
     {
         string[] str = e.Item.Text.Split('_');
         if (str.Length >= 2)
         {
             e.Item.Text = str[0];
         }
     }
 }
 private void chartSlabtest_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     try
     {
         if (e.Item.Axis is AxisX)
         {
             e.Item.Text = e.Item.Text.Replace("_", "\n");
         }
     }
     catch
     {}
 }
Exemple #8
0
 private void chartUPS1_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     try
     {
         AxisBase axis = e.Item.Axis;
         if (axis is AxisX)
         {
             e.Item.Text               = e.Item.Text.Replace("_", "\n");
             e.Item.TextColor          = Color.Green;
             e.Item.EnableAntialiasing = DefaultBoolean.True;
         }
     }
     catch { }
 }
Exemple #9
0
 protected void VerticalChartControl_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     if (e.Item.Axis is AxisY)
     {
         if (IsCurrency)
         {
             e.Item.Text = ScaleHelper.GetCurrencyAbbreviationMask(e.Item.Text, AbbreviationType.Thousands);
         }
         else
         {
             e.Item.Text = ScaleHelper.GetAbbreviationMask(e.Item.Text, AbbreviationType.Thousands);
         }
     }
 }
Exemple #10
0
 private void mPopChart_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     if (e.Item.Axis is AxisY)
     {
         if (type == 1)
         {
             e.Item.Text = string.Format("{0}mm", e.Item.AxisValue);
         }
         if (type == 2)
         {
             e.Item.Text = string.Format("{0}m/d", e.Item.AxisValue);
         }
     }
 }
Exemple #11
0
 private void chartControl2_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     if (e.Item.Axis is AxisX)
     {
         int value = (int)double.Parse(e.Item.AxisValue.ToString());
         if (mAxisDic.ContainsKey(value))
         {
             e.Item.Text = mAxisDic[value];
         }
         else
         {
             e.Item.Text = "";
         }
     }
 }
Exemple #12
0
        public static void CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
        {
            if (e.Item.Axis is AxisY)
            {
                double value = ((double)e.Item.AxisValue);
                e.Item.Text = DoubleToShortString(value);
            }
            ChartControl chart = sender as ChartControl;

            if (chart == null)
            {
                return;
            }
            if (chart.LookAndFeel.ActiveSkinName == "Office 2016 Dark")
            {
                e.Item.TextColor = Color.White;
            }
        }
Exemple #13
0
        private void chartControl1_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
        {
            if (e.Item.Axis.Equals(((XYDiagram)chartControl1.Diagram).AxisX))
            {
            }
            else
            {
                //TextAnnotation ann = chartControl1.Annotations.AddTextAnnotation();
                //ann.Text = e.Item.Text;
                //PaneAnchorPoint spa = new PaneAnchorPoint();
                //spa.AxisXCoordinate.Axis = ((XYDiagram)chartControl1.Diagram).AxisX;
                //spa.AxisYCoordinate.Axis = ((XYDiagram)chartControl1.Diagram).AxisY;
                //spa.AxisXCoordinate.AxisValue = 0;
                //spa.AxisYCoordinate.AxisValue = e.Item.AxisValue;
                //RelativePosition pos = new RelativePosition();
                //pos.Angle = 0;
                //pos.ConnectorLength = 20;
                //ann.ShapePosition = pos;
                //ann.AnchorPoint = spa;

                e.Item.Text = null;



                // ((XYDiagram)chartControl1.Diagram).AxisY.Label.
                //foreach (SeriesPoint sp in chart.Diagram.Series[0].Points)
                //{
                //    Annotation ann = new Annotation();
                //    ann.Content = string.Format("{0:N0}", sp.Value);
                //    PaneAnchorPoint spa = new PaneAnchorPoint();
                //    spa.AxisXCoordinate = new AxisXCoordinate() { AxisValue = sp.Argument };
                //    spa.AxisYCoordinate = new AxisYCoordinate() { AxisValue = 0 };
                //    RelativePosition pos = new RelativePosition();
                //    pos.Angle = 0;
                //    pos.ConnectorLength = 20;
                //    ann.ShapePosition = pos;
                //    ann.AnchorPoint = spa;
                //    chart.Annotations.Add(ann);
                //}
            }
        }
Exemple #14
0
        private void mPopChart_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
        {
            if (e.Item.Axis is AxisY)
            {
                if (type == 1)
                {
                    e.Item.Text = string.Format("{0}mm", e.Item.AxisValue);
                }
                if (type == 2)
                {
                    e.Item.Text = string.Format("{0}m/d", e.Item.AxisValue);
                }

            }
        }
Exemple #15
0
 public static void CustomDrawAxisYLabel(object sender, CustomDrawAxisLabelEventArgs e) {
     if (e.Item.Axis is AxisY) {
         double value = ((double)e.Item.AxisValue);
         e.Item.Text = DoubleToShortString(value);
     }
 }
Exemple #16
0
 private void chartControl2_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     if (e.Item.Axis is AxisX)
     {
         int value = (int)double.Parse(e.Item.AxisValue.ToString());
         if (mAxisDic.ContainsKey(value))
         {
             e.Item.Text = mAxisDic[value];
         }
         else
         {
             e.Item.Text = "";
         }
     }
 }
Exemple #17
0
 private void ChartControl1_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     ((XYDiagram)chartControl1.Diagram).AxisY.Label.TextPattern = "{A:HH:mm}";
 }
Exemple #18
0
        private void chartControl1_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
        {
            AxisBase axis = e.Item.Axis;

            if (axis.Tag == null)
            {
                return;
            }

            var tag = axis.Tag.ToString();

            switch (tag)
            {
            case "x":
                string valueX = e.Item.AxisValue.ToString().Trim();
                if (!_visibleAxisXLableText.Contains(valueX))
                {
                    e.Item.Text = string.Empty;
                }
                break;

            case "y":
                double valueY = CommonHelper.StringToDouble(e.Item.AxisValue.ToString());
                e.Item.Text = valueY.ToString("F2");
                if (valueY == _preClose)
                {
                    e.Item.TextColor = Color.White;
                }
                else if (valueY < _preClose)
                {
                    e.Item.TextColor = Color.Green;
                }
                else if (valueY > _preClose)
                {
                    e.Item.TextColor = Color.FromArgb(204, 51, 0);
                }
                break;

            case "y1":
                double valueY1 = CommonHelper.StringToDouble(e.Item.AxisValue.ToString());
                e.Item.Text = valueY1.ToString("P2");
                if (valueY1 == 0)
                {
                    e.Item.TextColor = Color.White;
                }
                else if (valueY1 < 0)
                {
                    e.Item.Text      = e.Item.Text.Substring(1, e.Item.Text.Length - 1);
                    e.Item.TextColor = Color.Green;
                }
                else if (valueY1 > 0)
                {
                    e.Item.TextColor = Color.FromArgb(204, 51, 0);
                }
                break;

            case "y2":
            default:
                break;
            }
        }
Exemple #19
0
 void IChartEventsProvider.OnCustomDrawAxisLabel(CustomDrawAxisLabelEventArgs e)
 {
 }
Exemple #20
0
 private void chartControl1_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
 {
     //if (e.Item.Axis is AxisX)
     //    e.Item.Text = "Tháng " + Convert.ToDateTime(e.Item.Text).ToString("MM-yyyy");
 }