Example #1
0
        private void ConfigureAnnotations()
        {
            m_RectangularCallout                  = new NRectangularCallout();
            m_RectangularCallout.ArrowLength      = new NLength(15, NRelativeUnit.ParentPercentage);
            m_RectangularCallout.FillStyle        = new NGradientFillStyle(Color.FromArgb(125, Color.White), Color.FromArgb(125, Color.CadetBlue));
            m_RectangularCallout.UseAutomaticSize = true;
            m_RectangularCallout.Orientation      = 225;
            m_RectangularCallout.Anchor           = new NDataPointAnchor(m_Bar, 2, ContentAlignment.MiddleCenter, StringAlignment.Center);
            m_RectangularCallout.Text             = GetTextForAnnotation(m_RectangularCallout);
            nChartControl1.Panels.Add(m_RectangularCallout);

            m_RoundedRectangularCallout                  = new NRoundedRectangularCallout();
            m_RoundedRectangularCallout.ArrowLength      = new NLength(15, NRelativeUnit.ParentPercentage);
            m_RoundedRectangularCallout.FillStyle        = new NGradientFillStyle(Color.FromArgb(125, Color.White), Color.FromArgb(125, Color.LightGreen));
            m_RoundedRectangularCallout.UseAutomaticSize = true;
            m_RoundedRectangularCallout.Orientation      = 135;
            m_RoundedRectangularCallout.Anchor           = new NModelPointAnchor(m_Chart, new NVector3DF(0, 0, 0));
            m_RoundedRectangularCallout.Text             = GetTextForAnnotation(m_RoundedRectangularCallout);
            nChartControl1.Panels.Add(m_RoundedRectangularCallout);

            m_CutEdgeRectangularCallout                  = new NCutEdgeRectangularCallout();
            m_CutEdgeRectangularCallout.FillStyle        = new NGradientFillStyle(Color.FromArgb(125, Color.White), Color.FromArgb(125, Color.LightBlue));
            m_CutEdgeRectangularCallout.ArrowLength      = new NLength(40, NRelativeUnit.ParentPercentage);
            m_CutEdgeRectangularCallout.UseAutomaticSize = true;
            m_CutEdgeRectangularCallout.Orientation      = 190;
            m_CutEdgeRectangularCallout.Anchor           = new NLegendDataItemAnchor(m_Legend, 1);
            m_CutEdgeRectangularCallout.Text             = GetTextForAnnotation(m_CutEdgeRectangularCallout);
            nChartControl1.Panels.Add(m_CutEdgeRectangularCallout);

            m_OvalCallout                  = new NOvalCallout();
            m_OvalCallout.FillStyle        = new NColorFillStyle(Color.FromArgb(200, Color.AliceBlue));
            m_OvalCallout.ArrowLength      = new NLength(15, NRelativeUnit.ParentPercentage);
            m_OvalCallout.UseAutomaticSize = true;
            m_OvalCallout.Orientation      = 315;
            m_OvalCallout.Anchor           = new NScalePointAnchor(m_Chart,
                                                                   (int)StandardAxis.PrimaryX,
                                                                   (int)StandardAxis.PrimaryY,
                                                                   (int)StandardAxis.Depth,
                                                                   AxisValueAnchorMode.Clip, new NVector3DD(7, 100, 0));

            m_OvalCallout.Text = GetTextForAnnotation(m_OvalCallout);
            nChartControl1.Panels.Add(m_OvalCallout);

            m_ArrowAnnotation = new NArrowAnnotation();
            m_ArrowAnnotation.UseAutomaticSize           = true;
            m_ArrowAnnotation.ArrowHeadWidthPercent      = 30;
            m_ArrowAnnotation.TextStyle.FontStyle.EmSize = new NLength(11, NGraphicsUnit.Point);
            m_ArrowAnnotation.TextStyle.FontStyle.Style |= FontStyle.Bold;
            m_ArrowAnnotation.Orientation = 45;
            m_ArrowAnnotation.FillStyle   = new NGradientFillStyle(GradientStyle.Vertical, GradientVariant.Variant1, Color.FromArgb(125, Color.White), Color.FromArgb(125, Color.Orange));
            m_ArrowAnnotation.Anchor      = new NDataPointAnchor(m_Bar, 4, ContentAlignment.MiddleCenter, StringAlignment.Center);
            m_ArrowAnnotation.Text        = GetTextForAnnotation(m_ArrowAnnotation);
            nChartControl1.Panels.Add(m_ArrowAnnotation);

            nChartControl1.Controller.Selection.Clear();
            nChartControl1.Controller.Selection.Add(m_Chart);

            nChartControl1.Controller.Tools.Add(new NTrackballTool());
        }
        private void ConfigureAnnotations()
        {
            if (rectPanelCheck.Checked)
            {
                nRectangularCallout                            = new NRectangularCallout();
                nRectangularCallout.ArrowLength                = new NLength(15, NRelativeUnit.ParentPercentage);
                nRectangularCallout.FillStyle                  = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.FromArgb(125, Color.White), Color.FromArgb(125, Color.CadetBlue));
                nRectangularCallout.UseAutomaticSize           = true;
                nRectangularCallout.Orientation                = 225;
                nRectangularCallout.Anchor                     = new NDataPointAnchor(nBar, 2, ContentAlignment.MiddleCenter, StringAlignment.Center);
                nRectangularCallout.Text                       = GetTextForAnnotation(nRectangularCallout);
                nRectangularCallout.TextStyle.FontStyle.EmSize = new NLength(8);
                nChartControl1.Panels.Add(nRectangularCallout);
            }

            if (roundRectCalloutCheck.Checked)
            {
                nRoundedRectangularCallout                            = new NRoundedRectangularCallout();
                nRoundedRectangularCallout.ArrowLength                = new NLength(15, NRelativeUnit.ParentPercentage);
                nRoundedRectangularCallout.FillStyle                  = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.FromArgb(125, Color.White), Color.FromArgb(125, Color.LightGreen));
                nRoundedRectangularCallout.UseAutomaticSize           = true;
                nRoundedRectangularCallout.Orientation                = 135;
                nRoundedRectangularCallout.Anchor                     = new NModelPointAnchor(nChart, new NVector3DF(0, 0, 0));
                nRoundedRectangularCallout.Text                       = GetTextForAnnotation(nRoundedRectangularCallout);
                nRoundedRectangularCallout.TextStyle.FontStyle.EmSize = new NLength(8);
                nChartControl1.Panels.Add(nRoundedRectangularCallout);
            }

            if (cutedgeRectPanelCheck.Checked)
            {
                nCutEdgeRectangularCallout                            = new NCutEdgeRectangularCallout();
                nCutEdgeRectangularCallout.FillStyle                  = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.FromArgb(125, Color.White), Color.FromArgb(125, Color.LightBlue));
                nCutEdgeRectangularCallout.ArrowLength                = new NLength(40, NRelativeUnit.ParentPercentage);
                nCutEdgeRectangularCallout.UseAutomaticSize           = true;
                nCutEdgeRectangularCallout.Orientation                = 190;
                nCutEdgeRectangularCallout.Anchor                     = new NLegendDataItemAnchor(nLegend, 1);
                nCutEdgeRectangularCallout.Text                       = GetTextForAnnotation(nCutEdgeRectangularCallout);
                nCutEdgeRectangularCallout.TextStyle.FontStyle.EmSize = new NLength(8);
                nChartControl1.Panels.Add(nCutEdgeRectangularCallout);
            }

            if (ovalPanelCheck.Checked)
            {
                nOvalCallout                  = new NOvalCallout();
                nOvalCallout.FillStyle        = new NColorFillStyle(Color.FromArgb(200, Color.AliceBlue));
                nOvalCallout.ArrowLength      = new NLength(15, NRelativeUnit.ParentPercentage);
                nOvalCallout.UseAutomaticSize = true;
                nOvalCallout.Orientation      = 315;
                nOvalCallout.Anchor           = new NScalePointAnchor(nChart,
                                                                      (int)StandardAxis.PrimaryX,
                                                                      (int)StandardAxis.PrimaryY,
                                                                      (int)StandardAxis.Depth,
                                                                      AxisValueAnchorMode.Clip,
                                                                      new NVector3DD(7, 100, 0));
                nOvalCallout.Text = GetTextForAnnotation(nOvalCallout);
                nOvalCallout.TextStyle.FontStyle.EmSize = new NLength(8);
                nChartControl1.Panels.Add(nOvalCallout);
            }

            if (arrowCheck.Checked)
            {
                nArrowAnnotation = new NArrowAnnotation();
                nArrowAnnotation.UseAutomaticSize           = true;
                nArrowAnnotation.ArrowHeadWidthPercent      = 30;
                nArrowAnnotation.TextStyle.FontStyle.EmSize = new NLength(11, NGraphicsUnit.Point);
                nArrowAnnotation.TextStyle.FontStyle.Style |= FontStyle.Bold;
                nArrowAnnotation.Orientation = 45;
                nArrowAnnotation.FillStyle   = new NGradientFillStyle(GradientStyle.Vertical, GradientVariant.Variant1, Color.FromArgb(125, Color.White), Color.FromArgb(125, Color.Orange));
                nArrowAnnotation.Anchor      = new NDataPointAnchor(nBar, 4, ContentAlignment.MiddleCenter, StringAlignment.Center);
                nArrowAnnotation.Text        = GetTextForAnnotation(nArrowAnnotation);
                nArrowAnnotation.TextStyle.FontStyle.EmSize = new NLength(8);
                nChartControl1.Panels.Add(nArrowAnnotation);
            }
        }