예제 #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);
        }
예제 #2
0
        private void InitChart()
        {
            m_Chart = nChartControl1.Charts[0];

            nChartControl1.Controller.Selection.Add(m_Chart);
            nChartControl1.Controller.Tools.Add(new NTrackballTool());

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

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

            // setup chart
            m_Chart.Width      = 90;
            m_Chart.BoundsMode = BoundsMode.Stretch;
            m_Chart.Location   = new NPointL(
                new NLength(15, NRelativeUnit.ParentPercentage),
                new NLength(15, NRelativeUnit.ParentPercentage));
            m_Chart.Size = new NSizeL(
                new NLength(70, NRelativeUnit.ParentPercentage),
                new NLength(70, NRelativeUnit.ParentPercentage));

            NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;

            NDateTimeScaleConfigurator dateTimeScale = new NDateTimeScaleConfigurator();

            m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = dateTimeScale;
            dateTimeScale.LabelValueFormatter = new NDateTimeValueFormatter(DateTimeValueFormat.Date);
            dateTimeScale.LabelGenerationMode = LabelGenerationMode.Stagger2;

            // 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;

            m_PrintManager = new NPrintManager(nChartControl1.Document);

            GenerateData();
        }
예제 #3
0
        private void showPrintPreviewButton_Click(object sender, System.EventArgs e)
        {
            NPrintManager printManager = new NPrintManager(document);

            printManager.ShowPrintPreview();
        }