Пример #1
0
        private void InitChart()
        {
            m_Chart = nChartControl1.Charts[0];

            nChartControl1.Controller.Selection.Add(m_Chart);

            nChartControl1.Controller.Tools.Add(new NDataPanTool());
            nChartControl1.Controller.Tools.Add(new NAxisScrollTool());

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Multi Page Printing");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.MiddleCenter;
            title.DockMargins         = new NMarginsL(5, 5, 5, 5);
            title.DockMode            = PanelDockMode.Top;

            nChartControl1.Legends[0].Mode = LegendMode.Disabled;

            // setup chart
            m_Chart.BoundsMode  = BoundsMode.Stretch;
            m_Chart.DockMode    = PanelDockMode.Fill;
            m_Chart.DockMargins = new NMarginsL(15, 20, 30, 20);

            m_Chart.Axis(StandardAxis.PrimaryY).ScrollBar.Visible             = true;
            m_Chart.Axis(StandardAxis.PrimaryY).ScrollBar.ResetButton.Visible = false;

            NDateTimeScaleConfigurator dateTimeScale = new NDateTimeScaleConfigurator();

            dateTimeScale.LabelGenerationMode = LabelGenerationMode.Stagger2;
            m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator             = dateTimeScale;
            m_Chart.Axis(StandardAxis.PrimaryX).ScrollBar.Visible             = true;
            m_Chart.Axis(StandardAxis.PrimaryX).ScrollBar.ResetButton.Visible = false;
            m_Chart.BringToFront();

            // create the float bar series
            m_FloatBar                        = (NFloatBarSeries)m_Chart.Series.Add(SeriesType.FloatBar);
            m_FloatBar.UseXValues             = true;
            m_FloatBar.UseZValues             = false;
            m_FloatBar.InflateMargins         = true;
            m_FloatBar.DataLabelStyle.Visible = false;

            // bar appearance
            m_FloatBar.BorderStyle.Color = Color.Bisque;
            m_FloatBar.FillStyle         = new NGradientFillStyle(Nevron.GraphicsCore.GradientStyle.Horizontal, GradientVariant.Variant1, Color.LightGray, Color.DarkBlue);
            m_FloatBar.ShadowStyle.Type  = ShadowType.Solid;
            m_FloatBar.ShadowStyle.Color = Color.FromArgb(30, 0, 0, 0);

            m_FloatBar.Values.ValueFormatter    = new NNumericValueFormatter("0.00");
            m_FloatBar.EndValues.ValueFormatter = new NNumericValueFormatter("0.00");

            // show the begin end values in the legend
            m_FloatBar.Legend.Format = "<begin> - <end>";
            m_FloatBar.Legend.Mode   = SeriesLegendMode.DataPoints;

            GenerateData();

            m_PrintManager = new NPrintManager(nChartControl1.Document);
        }