コード例 #1
0
        private void CreateCustomLegend3(NDockPanel container)
        {
            NLegend markShapesBackground = CreateLegend(container, "Mark Shapes (Margins, Background)");

            Array         markShapes = Enum.GetValues(typeof(LegendMarkShape));
            NChartPalette palette    = new NChartPalette(ChartPredefinedPalette.Fresh);

            for (int i = 0; i < markShapes.Length; i++)
            {
                NLegendItemCellData licd      = new NLegendItemCellData();
                LegendMarkShape     markShape = (LegendMarkShape)markShapes.GetValue(i);

                licd.Text = markShape.ToString();
                licd.TextStyle.FillStyle        = new NColorFillStyle(Color.White);
                licd.TextStyle.FontStyle.EmSize = new NLength(10 + i);
                licd.MarkShape             = markShape;
                licd.MarkFillStyle         = new NColorFillStyle(Color.White);
                licd.MarkBorderStyle.Width = new NLength(0);
                licd.MarkLineStyle.Width   = new NLength(0);
                licd.BackgroundFillStyle   = new NColorFillStyle(palette.SeriesColors[i % palette.SeriesColors.Count]);

                markShapesBackground.Data.Items.Add(licd);
            }

            // increase teh margins around each cell
            markShapesBackground.Data.CellMargins = new NMarginsL(10, 10, 10, 10);
        }
コード例 #2
0
        private void ConfigureLegend()
        {
            NLegend legend = new NLegend();

            legend.Mode             = LegendMode.Manual;
            legend.DockMode         = PanelDockMode.Fill;
            legend.BoundsMode       = BoundsMode.Fit;
            legend.ContentAlignment = ContentAlignment.MiddleCenter;
            legend.Data.ExpandMode  = LegendExpandMode.ColsOnly;

            // add custom legend items
            legend.Data.Items.Add(CreateLegendItem("Charting", colors[0]));
            legend.Data.Items.Add(CreateLegendItem("Diagramming", colors[1]));
            legend.Data.Items.Add(CreateLegendItem("User Interface", colors[2]));
            legend.Data.Items.Add(CreateLegendItem("Help Authoring", colors[3]));

            NDockPanel legendHostPanel = new NDockPanel();

            legendHostPanel.DockMode = PanelDockMode.Bottom;
            legendHostPanel.Size     = new NSizeL(
                new NLength(100, NRelativeUnit.ParentPercentage),
                new NLength(5, NRelativeUnit.ParentPercentage));
            legendHostPanel.ChildPanels.Add(legend);

            nChartControl1.Panels.Add(legendHostPanel);
        }
コード例 #3
0
        public override void Initialize()
        {
            base.Initialize();

            // confgigure chart
            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel header = new NLabel("Legend Custom Items");

            header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            header.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);
            header.DockMode            = PanelDockMode.Top;
            header.Margins             = new NMarginsL(0, 10, 0, 10);
            nChartControl1.Panels.Add(header);

            NDockPanel container = new NDockPanel();

            container.DockMode = PanelDockMode.Fill;
            container.Margins  = new NMarginsL(10, 10, 10, 10);
            container.PositionChildPanelsInContentBounds = true;
            nChartControl1.Panels.Add(container);

            // configure the legend
            CreateCustomLegend1(container);
            CreateCustomLegend2(container);
            CreateCustomLegend3(container);

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);
        }
コード例 #4
0
        private NWidget CreateCustomRequestWidget()
        {
            NGroupBox groupBox = new NGroupBox("Custom Request");

            NDockPanel dock = new NDockPanel();

            groupBox.Content = dock;

            NLabel label = new NLabel("URI:");

            label.VerticalPlacement = ENVerticalPlacement.Center;
            NDockLayout.SetDockArea(label, ENDockArea.Left);
            dock.Add(label);

            m_CustomURITextBox         = new NTextBox();
            m_CustomURITextBox.Text    = "http://www.nevron.com/gallery/FullGalleries/chart/pie/images/3D-pie-cut-edge-ring.png";
            m_CustomURITextBox.Padding = new NMargins(0, 3, 0, 3);
            NDockLayout.SetDockArea(m_CustomURITextBox, ENDockArea.Center);
            dock.Add(m_CustomURITextBox);

            NButton submitButton = new NButton("Submit");

            NDockLayout.SetDockArea(submitButton, ENDockArea.Right);
            submitButton.Click += new Function <NEventArgs>(OnSumbitCustomRequestClick);
            dock.Add(submitButton);

            return(groupBox);
        }
コード例 #5
0
        private NListBoxItem CreateDetailedListBoxItem(int index)
        {
            NDockPanel dock = new NDockPanel();

            dock.HorizontalSpacing = 3;
            dock.Padding           = new NMargins(0, 2, 0, 2);

            // Add the image
            string imageName = ImageNames[index % ImageNames.Length];
            NImage icon      = new NImage(new NEmbeddedResourceRef(NResources.Instance, "RIMG__24x24_" + imageName + "_png"));

            NImageBox imageBox = new NImageBox(icon);

            imageBox.HorizontalPlacement = ENHorizontalPlacement.Center;
            imageBox.VerticalPlacement   = ENVerticalPlacement.Center;
            NDockLayout.SetDockArea(imageBox, ENDockArea.Left);

            dock.Add(imageBox);

            // Add the title
            NLabel titleLabel = new NLabel("Item " + index.ToString());

            titleLabel.Font = new NFont(NFontDescriptor.DefaultSansFamilyName, 10, ENFontStyle.Bold);
            NDockLayout.SetDockArea(titleLabel, ENDockArea.Top);
            dock.AddChild(titleLabel);

            // Add the description
            NLabel descriptionLabel = new NLabel("This is item " + index.ToString() + "'s description.");

            NDockLayout.SetDockArea(descriptionLabel, ENDockArea.Center);
            dock.AddChild(descriptionLabel);

            return(new NListBoxItem(dock));
        }
コード例 #6
0
        protected override NWidget CreateExampleContent()
        {
            // Create a dock panel with red border
            m_DockPanel                 = new NDockPanel();
            m_DockPanel.Border          = NBorder.CreateFilledBorder(NColor.Red);
            m_DockPanel.BorderThickness = new NMargins(1);

            // Create and dock several widgets
            NWidget widget = CreateDockedWidget(ENDockArea.Left);

            widget.PreferredSize = new NSize(100, 100);
            m_DockPanel.Add(widget);

            widget = CreateDockedWidget(ENDockArea.Top);
            widget.PreferredSize = new NSize(100, 100);
            m_DockPanel.Add(widget);

            widget = CreateDockedWidget(ENDockArea.Right);
            widget.PreferredSize = new NSize(100, 100);
            m_DockPanel.Add(widget);

            widget = CreateDockedWidget(ENDockArea.Bottom);
            widget.PreferredSize = new NSize(100, 100);
            m_DockPanel.Add(widget);

            widget = CreateDockedWidget(ENDockArea.Center);
            widget.PreferredSize = new NSize(300, 300);
            m_DockPanel.Add(widget);

            return(m_DockPanel);
        }
コード例 #7
0
        public override void Initialize()
        {
            base.Initialize();

            // configure device and interactivity
            nChartControl1.Panels.Clear();
            nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
            nChartControl1.Controller.Tools.Add(new NTrackballTool());

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Style Sheet Configurators");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.FitAlignment        = ContentAlignment.MiddleLeft;
            title.Margins             = new NMarginsL(10, 10, 0, 0);
            title.DockMode            = PanelDockMode.Top;

            NDockPanel dockPanel = new NDockPanel();

            dockPanel.DockMode    = PanelDockMode.Fill;
            dockPanel.DockMargins = new NMarginsL(20, 5, 15, 10);
            dockPanel.PositionChildPanelsInContentBounds = true;
            nChartControl1.Panels.Add(dockPanel);

            NChart chart = CreateBarChart();

            chart.Enable3D   = true;
            chart.BoundsMode = BoundsMode.Fit;
            chart.Location   = new NPointL(5, 0);
            chart.Size       = new NSizeL(new NLength(60, NRelativeUnit.ParentPercentage), new NLength(100, NRelativeUnit.ParentPercentage));

            dockPanel.ChildPanels.Add(chart);
            NRadialGaugePanel gauge = CreateRadialGauge();

            dockPanel.ChildPanels.Add(gauge);
            gauge.Location = new NPointL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(10, NRelativeUnit.ParentPercentage));
            gauge.Size     = new NSizeL(new NLength(30, NRelativeUnit.ParentPercentage), new NLength(40, NRelativeUnit.ParentPercentage));

            gauge = CreateRadialGauge();
            dockPanel.ChildPanels.Add(gauge);
            gauge.Location = new NPointL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
            gauge.Size     = new NSizeL(new NLength(30, NRelativeUnit.ParentPercentage), new NLength(40, NRelativeUnit.ParentPercentage));

            // init form controls
            PaletteComboBox.FillFromEnum(typeof(ChartPredefinedPalette));
            PaletteComboBox.SelectedIndex = 0;

            // init form controls
            PopulateFillTemplateCombo(BackgroundFillTemplateComboBox);
            PopulateFillTemplateCombo(LabelsFillTemplateComboBox);
            PopulateFillTemplateCombo(WallsFillTemplateComboBox);
            PopulateFillTemplateCombo(SeriesFillTemplateComboBox);
            PopulateFillTemplateCombo(IndicatorsFillTemplateComboBox);

            PopulateStrokeTemplateCombo(LabelsStrokeTemplateComboBox, 0);
            PopulateStrokeTemplateCombo(IndicatorsStrokeTemplateComboBox);
            PopulateStrokeTemplateCombo(RulerStrokeTemplateComboBox);
            PopulateStrokeTemplateCombo(SeriesStrokeTemplateComboBox);
        }
コード例 #8
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            m_ChartView = new NChartView();

            NDockPanel dockPanel = new NDockPanel();

            m_ChartView.Surface.Content = dockPanel;

            NLabel label = new NLabel();

            label.Margins       = new NMargins(10);
            label.Font          = new NFont(NFontDescriptor.DefaultSansFamilyName, 12);
            label.TextFill      = new NColorFill(NColor.Black);
            label.TextAlignment = ENContentAlignment.MiddleCenter;
            label.Text          = "Multiple Legends";
            NDockLayout.SetDockArea(label, ENDockArea.Top);
            dockPanel.AddChild(label);

            // stack panel holding content
            NStackPanel stackPanel = new NStackPanel();

            stackPanel.UniformHeights = ENUniformSize.Max;
            stackPanel.FillMode       = ENStackFillMode.Equal;
            stackPanel.FitMode        = ENStackFitMode.Equal;
            NDockLayout.SetDockArea(stackPanel, ENDockArea.Center);
            dockPanel.AddChild(stackPanel);

            // first group of pie + legend
            NDockPanel firstGroupPanel = new NDockPanel();

            stackPanel.AddChild(firstGroupPanel);

            m_PieChart1 = CreatePieChart();
            m_Legend1   = CreateLegend();

            m_PieChart1.Legend = m_Legend1;

            firstGroupPanel.AddChild(m_Legend1);
            firstGroupPanel.AddChild(m_PieChart1);

            // second group of pie + legend
            NDockPanel secondGroupPanel = new NDockPanel();

            stackPanel.AddChild(secondGroupPanel);

            // setup the volume chart
            m_PieChart2 = CreatePieChart();
            m_Legend2   = CreateLegend();

            m_PieChart2.Legend = m_Legend2;

            secondGroupPanel.AddChild(m_Legend2);
            secondGroupPanel.AddChild(m_PieChart2);

            m_ChartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            return(m_ChartView);
        }
コード例 #9
0
        public override void Initialize()
        {
            base.Initialize();


            nChartControl1.Panels.Clear();

            // set a chart title
            m_Header = nChartControl1.Labels.AddHeader("Volume Indicators<br/><font size = '10pt'>Demonstrates how to align panels</font>");
            m_Header.TextStyle.TextFormat = TextFormat.XML;
            m_Header.TextStyle.FontStyle  = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            m_Header.ContentAlignment     = ContentAlignment.BottomCenter;
            m_Header.Margins  = new NMarginsL(10, 10, 10, 10);
            m_Header.DockMode = PanelDockMode.Top;

            NDockPanel containerPanel = new NDockPanel();

            containerPanel.DockMode = PanelDockMode.Fill;
            containerPanel.Margins  = new NMarginsL(10, 0, 10, 10);
            nChartControl1.Panels.Add(containerPanel);

            m_StockChart = new NCartesianChart();
            m_StockChart.Axis(StandardAxis.PrimaryX).Visible = false;
            m_StockChart.DockMode   = PanelDockMode.Top;
            m_StockChart.BoundsMode = BoundsMode.Stretch;
            m_StockChart.Size       = new NSizeL(new NLength(0), new NLength(33, NRelativeUnit.ParentPercentage));
            m_StockChart.Margins    = new NMarginsL(10, 0, 10, 10);
            containerPanel.ChildPanels.Add(m_StockChart);

            m_VolumeChart = new NCartesianChart();
            m_VolumeChart.Axis(StandardAxis.PrimaryX).Visible = false;
            m_VolumeChart.DockMode   = PanelDockMode.Top;
            m_VolumeChart.BoundsMode = BoundsMode.Stretch;
            m_VolumeChart.Size       = new NSizeL(new NLength(0), new NLength(33, NRelativeUnit.ParentPercentage));
            m_VolumeChart.Margins    = new NMarginsL(10, 0, 10, 10);
            containerPanel.ChildPanels.Add(m_VolumeChart);

            m_IndicatorChart            = new NCartesianChart();
            m_IndicatorChart.DockMode   = PanelDockMode.Top;
            m_IndicatorChart.BoundsMode = BoundsMode.Stretch;
            m_IndicatorChart.Size       = new NSizeL(new NLength(0), new NLength(33, NRelativeUnit.ParentPercentage));
            m_IndicatorChart.Margins    = new NMarginsL(10, 0, 10, 10);
            containerPanel.ChildPanels.Add(m_IndicatorChart);

            // setup charts
            SetupTimeScale(m_IndicatorChart.Axis(StandardAxis.PrimaryX));
            SetupStockChart(m_StockChart);
            SetupVolumeChart(m_VolumeChart);
            SetupIndicatorChart(m_IndicatorChart);

            // generate data
            UpdateExpression();
            GenerateData();
            CalculateFunction();

            AlignLeftSidesCheckBox.Checked  = true;
            AlignRightSidesCheckBox.Checked = true;
        }
コード例 #10
0
        public override void Create()
        {
            nChartControl1.Panels.Clear();
            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Financial Dashboard");

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

            // setup Stock chart
            NCartesianChart stockChart = new NCartesianChart();

            SetupStockChart(stockChart);

            stockChart.Size     = new NSizeL(new NLength(96, NRelativeUnit.ParentPercentage), new NLength(55, NRelativeUnit.ParentPercentage));
            stockChart.Location = new NPointL(new NLength(2, NRelativeUnit.ParentPercentage), new NLength(10, NRelativeUnit.ParentPercentage));
            nChartControl1.Panels.Add(stockChart);

            // create London clock
            NDockPanel londonPanel = new NDockPanel();

            londonPanel.Size     = new NSizeL(new NLength(30, NRelativeUnit.ParentPercentage), new NLength(30, NRelativeUnit.ParentPercentage));
            londonPanel.Location = new NPointL(new NLength(2, NRelativeUnit.ParentPercentage), new NLength(66, NRelativeUnit.ParentPercentage));

            m_LondonClock = CreateClockPanel(1);
            londonPanel.ChildPanels.Add(CreateClockLabel("London"));
            londonPanel.ChildPanels.Add(m_LondonClock);
            nChartControl1.Panels.Add(londonPanel);

            // create Tokyo clock
            NDockPanel tokyoPanel = new NDockPanel();

            tokyoPanel.Size     = new NSizeL(new NLength(30, NRelativeUnit.ParentPercentage), new NLength(30, NRelativeUnit.ParentPercentage));
            tokyoPanel.Location = new NPointL(new NLength(35, NRelativeUnit.ParentPercentage), new NLength(66, NRelativeUnit.ParentPercentage));
            m_TokyoClock        = CreateClockPanel(10);
            tokyoPanel.ChildPanels.Add(CreateClockLabel("Tokyo"));
            tokyoPanel.ChildPanels.Add(m_TokyoClock);
            nChartControl1.Panels.Add(tokyoPanel);

            // create New York clock
            NDockPanel newYorkPanel = new NDockPanel();

            newYorkPanel.Size     = new NSizeL(new NLength(30, NRelativeUnit.ParentPercentage), new NLength(30, NRelativeUnit.ParentPercentage));
            newYorkPanel.Location = new NPointL(new NLength(68, NRelativeUnit.ParentPercentage), new NLength(66, NRelativeUnit.ParentPercentage));
            m_NewYorkClock        = CreateClockPanel(-4);
            newYorkPanel.ChildPanels.Add(CreateClockLabel("New York"));
            newYorkPanel.ChildPanels.Add(m_NewYorkClock);
            nChartControl1.Panels.Add(newYorkPanel);

            GenerateOHLCData(m_Stock, 100, 200, new NRange1DD(50, 350));
            nChartControl1.Refresh();
            m_Timer          = new Timer();
            m_Timer.Elapsed += m_Timer_Elapsed;
            m_Timer.Interval = 4000;
            m_Timer.Start();
        }
コード例 #11
0
ファイル: NExampleUC.cs プロジェクト: Nevron-Software/Vision
        protected void ApplyLayoutTemplate(int template, INChartControl control, NDockPanel chart, NLabel title, NLegend legend)
        {
            control.Panels.Clear();

            if (title != null)
            {
                control.Panels.Add(title);

                title.DockMode = PanelDockMode.Top;
                title.Padding  = new NMarginsL(4, 6, 4, 6);
            }

            if (legend != null)
            {
                control.Panels.Add(legend);

                legend.DockMode = PanelDockMode.Right;
                legend.Padding  = new NMarginsL(1, 1, 3, 3);
            }

            if (chart != null)
            {
                control.Panels.Add(chart);

                float topPad   = (title == null) ? 3 : 3;
                float rightPad = (legend == null) ? 3 : 3;

                if (chart.BoundsMode == BoundsMode.None)
                {
                    if (((chart is NChart) && (((NChart)chart).Enable3D)) || !(chart is NCartesianChart))
                    {
                        chart.BoundsMode = BoundsMode.Fit;
                    }
                    else
                    {
                        chart.BoundsMode = BoundsMode.Stretch;
                    }
                }

                chart.DockMode = PanelDockMode.Fill;

                // fit axes if chart is Cartesian 3D
                NCartesianChart cartesianChart = chart as NCartesianChart;
                if (cartesianChart != null)
                {
                    cartesianChart.Fit3DAxisContent = true;
                }

                chart.Padding = new NMarginsL(
                    new NLength(3, NRelativeUnit.ParentPercentage),
                    new NLength(topPad, NRelativeUnit.ParentPercentage),
                    new NLength(rightPad, NRelativeUnit.ParentPercentage),
                    new NLength(3, NRelativeUnit.ParentPercentage));
            }
        }
コード例 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // confgigure chart
            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel title = new NLabel("Legend Custom Items");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
            title.DockMode = PanelDockMode.Top;
            title.Margins  = new NMarginsL(0, 10, 0, 10);
            nChartControl1.Panels.Add(title);

            NDockPanel container = new NDockPanel();

            container.DockMode = PanelDockMode.Fill;
            container.Margins  = new NMarginsL(5, 5, 5, 5);
            container.PositionChildPanelsInContentBounds = true;
            nChartControl1.Panels.Add(container);

            {
                NLegend markShapesNoStroke = CreateLegend(container, "Mark Shapes, Margins, Background");

                Array         markShapes = Enum.GetValues(typeof(LegendMarkShape));
                NChartPalette palette    = new NChartPalette(ChartPredefinedPalette.Nevron);

                for (int i = 0; i < markShapes.Length; i++)
                {
                    NLegendItemCellData licd      = new NLegendItemCellData();
                    LegendMarkShape     markShape = (LegendMarkShape)markShapes.GetValue(i);

                    licd.Text = markShape.ToString();
                    licd.TextStyle.FillStyle        = new NColorFillStyle(Color.White);
                    licd.TextStyle.FontStyle.EmSize = new NLength(8);
                    licd.MarkShape             = markShape;
                    licd.MarkFillStyle         = new NColorFillStyle(Color.White);
                    licd.MarkBorderStyle.Width = new NLength(0);
                    licd.MarkLineStyle.Width   = new NLength(0);
                    licd.BackgroundFillStyle   = new NColorFillStyle(palette.SeriesColors[i % palette.SeriesColors.Count]);

                    markShapesNoStroke.Data.Items.Add(licd);
                }

                // increase teh margins around each cell
                markShapesNoStroke.Data.CellMargins = new NMarginsL(5, 5, 5, 5);
            }

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);
        }
コード例 #13
0
        private NDockPanel CreateConceptCarReviewPanel()
        {
            NDockPanel dockPanel = new NDockPanel();

            dockPanel.DockMode = PanelDockMode.Fill;

            m_ReviewLabel          = new NLabel("Select concept car to review");
            m_ReviewLabel.DockMode = PanelDockMode.Top;
            m_ReviewLabel.TextStyle.ShadowStyle.Type = ShadowType.Solid;
            m_ReviewLabel.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 20, FontStyle.Italic);
            m_ReviewLabel.TextStyle.FillStyle        = new NGradientFillStyle(Nevron.GraphicsCore.GradientStyle.Horizontal, GradientVariant.Variant1, Color.DarkKhaki, Color.White);
            m_ReviewLabel.BoundsMode       = BoundsMode.None;
            m_ReviewLabel.ContentAlignment = ContentAlignment.MiddleCenter;
            m_ReviewLabel.UseAutomaticSize = false;
            m_ReviewLabel.Size             = new NSizeL(
                new NLength(100, NRelativeUnit.ParentPercentage),
                new NLength(10, NRelativeUnit.ParentPercentage));
            dockPanel.ChildPanels.Add(m_ReviewLabel);

            // setup chart
            NChart chart = new NCartesianChart();

            chart.Enable3D   = true;
            chart.DockMode   = PanelDockMode.Fill;
            chart.BoundsMode = BoundsMode.Fit;
            chart.Padding    = new NMarginsL(20, 20, 20, 20);
            chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.MetallicLustre);
            chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);

            chart.Axis(StandardAxis.Depth).Visible = false;

            NOrdinalScaleConfigurator scaleX = (NOrdinalScaleConfigurator)chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator;

            scaleX.AutoLabels = false;
            scaleX.Labels.Add("Design");
            scaleX.Labels.Add("Functionality");
            scaleX.Labels.Add("Price");
            scaleX.Labels.Add("Speed");

            NBarSeries bar = new NBarSeries();

            chart.Series.Add(bar);
            bar.BarShape = BarShape.SmoothEdgeBar;
            bar.DataLabelStyle.Format = "<value>";
            bar.Values.AddRange(new double[] { 0, 0, 0, 0 });

            // apply predefined style sheet to the pie
            NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.CoolMultiColor).Apply(bar);

            dockPanel.ChildPanels.Add(chart);

            return(dockPanel);
        }
コード例 #14
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public NExamplesHomePage()
        {
            // Apply a Windows 8 theme
            Document.InheritStyleSheets = false;
            NUITheme theme = new NWindows8Theme();

            Document.StyleSheets.ApplyTheme(theme);
            m_ExamplesMap = null;

            // Add some custom styles
            Document.StyleSheets.Add(CreateCustomStyleSheet(theme));

            // Load the metafile images
            Stream emfStream = NResources.Instance.GetResourceStream("RBIN_HomePageEmfs_zip");

            m_EmfDecompressor = new NEmfDecompressor();
            NCompression.DecompressZip(emfStream, m_EmfDecompressor);

            // Create the main dock panel
            m_MainPanel = new NDockPanel();
            m_MainPanel.HorizontalSpacing   = GroupHorizontalSpacing;
            m_MainPanel.VerticalSpacing     = GroupVerticalSpacing;
            m_MainPanel.Padding             = new NMargins(GroupHorizontalSpacing, GroupVerticalSpacing);
            m_MainPanel.HorizontalPlacement = ENHorizontalPlacement.Center;
            m_MainPanel.VerticalPlacement   = ENVerticalPlacement.Center;

            // Create the contacts and the header labels
            m_MainPanel.Add(CreateSearchAndContacts(), ENDockArea.Top);
            m_HeaderLabel = CreateHeader();
            m_MainPanel.Add(m_HeaderLabel, ENDockArea.Top);

            // Create the page panel
            m_PagePanel = new NSingleVisiblePanel();
            m_PagePanel.Add(CreateWelcomePanel());
            m_MainPanel.Add(m_PagePanel, ENDockArea.Center);

            // Place the main panel in a scroll content
            NScrollContent scrollContent = new NScrollContent(m_MainPanel);

            scrollContent.WindowBackgroundFill = new NColorFill(BackgroundColor);
            scrollContent.NoScrollHAlign       = ENNoScrollHAlign.Center;
            scrollContent.NoScrollVAlign       = ENNoScrollVAlign.Center;
            scrollContent.HorizontalPlacement  = ENHorizontalPlacement.Fit;
            scrollContent.VerticalPlacement    = ENVerticalPlacement.Fit;
            scrollContent.Border          = null;
            scrollContent.BorderThickness = NMargins.Zero;

            // Place the scroll content in a document box surface to prevent theme style inheritance
            NDocumentBoxSurface surface = new NDocumentBoxSurface(scrollContent);

            surface.TextFill = new NColorFill(TextColor);
            Document.Content = surface;
        }
コード例 #15
0
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = new NStackPanel();

            stack.VerticalSpacing = 10;

            // Create the predefined tests list box
            NListBox testListBox = new NListBox();

            testListBox.Items.Add(CreateTestListBoxItem(new NRichTextBorders()));
            testListBox.Items.Add(CreateTestListBoxItem(new NRichTextLists()));
            testListBox.Items.Add(CreateTestListBoxItem(new NRichTextTables()));
            testListBox.Items.Add(CreateTestListBoxItem(new NRichTextTextStyles()));
            testListBox.Items.Add(CreateTestListBoxItem(new NRichTextElementPositioning()));
            testListBox.Selection.Selected += OnTestListBoxItemSelected;

            // Add the list box in a group box
            stack.Add(new NGroupBox("Predefined text documents", testListBox));

            // Create the Load from file group box
            NDockPanel dockPanel = new NDockPanel();

            dockPanel.HorizontalSpacing = 3;
            dockPanel.VerticalSpacing   = 3;

            NButton loadButton = new NButton("Load");

            loadButton.Click += OnLoadButtonClick;
            NDockLayout.SetDockArea(loadButton, ENDockArea.Bottom);
            dockPanel.Add(loadButton);

            m_FileNameTextBox = new NTextBox();
            m_FileNameTextBox.VerticalPlacement = ENVerticalPlacement.Center;
            NDockLayout.SetDockArea(m_FileNameTextBox, ENDockArea.Center);
            dockPanel.Add(m_FileNameTextBox);

            NButton browseButton = new NButton("...");

            browseButton.Click += OnBrowseButtonClick;
            NDockLayout.SetDockArea(browseButton, ENDockArea.Right);
            dockPanel.Add(browseButton);

            stack.Add(new NGroupBox("Load from file", dockPanel));

            m_ElapsedTimeLabel = new NLabel();
            stack.Add(m_ElapsedTimeLabel);

            // Select the initial test
            testListBox.Selection.SingleSelect(testListBox.Items[0]);

            return(stack);
        }
コード例 #16
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            nChartControl1.Panels.Clear();
            nChartControl1.BackgroundStyle.FillStyle = new NGradientFillStyle(Color.White, Color.Black);

            // set a chart title
            NLabel header = nChartControl1.Labels.AddFooter("Financial Dashboard");

            header.BackgroundFillStyle         = new NColorFillStyle(Color.FromArgb(125, Color.White));
            header.DockMode                    = PanelDockMode.Top;
            header.TextStyle.ShadowStyle.Type  = ShadowType.Solid;
            header.TextStyle.ShadowStyle.Color = Color.White;
            header.TextStyle.FontStyle         = new NFontStyle("Times New Roman", 13, FontStyle.Italic);
            header.TextStyle.FillStyle         = new NColorFillStyle(Color.MidnightBlue);
            header.DockMargins                 = new NMarginsL(5, 5, 5, 0);

            // setup Stock chart
            nChartControl1.Panels.Add(CreateStockChart());

            NDockPanel gaugeContainerPanel = new NDockPanel();

            gaugeContainerPanel.DockMode = PanelDockMode.Fill;
            gaugeContainerPanel.Margins  = new NMarginsL(5, 0, 5, 5);
            gaugeContainerPanel.PositionChildPanelsInContentBounds = true;
            nChartControl1.Panels.Add(gaugeContainerPanel);

            m_MinRadialGauge          = CreateGaugePanel("Minimum");
            m_MinRadialGauge.Location = new NPointL(new NLength(0, NRelativeUnit.ParentPercentage), new NLength(0, NRelativeUnit.ParentPercentage));
            m_MinIndicator            = CreateIndicator();

            DecorateGaugeAxis(m_MinRadialGauge, new NRange1DD(0, 100), Color.Blue, Color.DarkBlue);
            m_MinRadialGauge.Indicators.Add(m_MinIndicator);
            gaugeContainerPanel.ChildPanels.Add(m_MinRadialGauge);

            m_MaxRadialGauge          = CreateGaugePanel("Maximum");
            m_MaxRadialGauge.Location = new NPointL(new NLength(34, NRelativeUnit.ParentPercentage), new NLength(0, NRelativeUnit.ParentPercentage));
            DecorateGaugeAxis(m_MaxRadialGauge, new NRange1DD(300, 400), Color.Red, Color.DarkRed);
            m_MaxIndicator = CreateIndicator();
            m_MaxRadialGauge.Indicators.Add(m_MaxIndicator);
            gaugeContainerPanel.ChildPanels.Add(m_MaxRadialGauge);

            m_AvgRadialGauge          = CreateGaugePanel("Average");
            m_AvgRadialGauge.Location = new NPointL(new NLength(68, NRelativeUnit.ParentPercentage), new NLength(0, NRelativeUnit.ParentPercentage));
            DecorateGaugeAxis(m_AvgRadialGauge, new NRange1DD(100, 300), Color.Green, Color.DarkGreen);
            m_AvgIndicator = CreateIndicator();
            m_AvgRadialGauge.Indicators.Add(m_AvgIndicator);
            gaugeContainerPanel.ChildPanels.Add(m_AvgRadialGauge);

            // generate some data
            GenerateData();
        }
コード例 #17
0
        private NLegend CreateLegend(NDockPanel container, string title)
        {
            // configure the legend
            NLegend legend = new NLegend();

            legend.Header.Text     = title;
            legend.Mode            = LegendMode.Manual;
            legend.Data.ExpandMode = LegendExpandMode.HorzWrap;
            legend.DockMode        = PanelDockMode.Top;
            legend.Margins         = new NMarginsL(20, 20, 20, 20);
            container.ChildPanels.Add(legend);

            return(legend);
        }
コード例 #18
0
        public override void Initialize()
        {
            nChartControl1.Panels.Clear();
            nChartControl1.BackgroundStyle.FillStyle = new NGradientFillStyle(Color.White, Color.Black);

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

            title.BackgroundFillStyle = new NColorFillStyle(Color.FromArgb(125, Color.White));
            title.DockMode            = PanelDockMode.Top;
            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(Color.MidnightBlue);
            title.DockMargins         = new NMarginsL(10, 10, 10, 0);

            // setup Stock chart
            nChartControl1.Panels.Add(CreateStockChart());

            NDockPanel gaugeContainerPanel = new NDockPanel();

            gaugeContainerPanel.DockMode = PanelDockMode.Fill;
            gaugeContainerPanel.Margins  = new NMarginsL(10, 0, 10, 10);
            gaugeContainerPanel.PositionChildPanelsInContentBounds = true;
            nChartControl1.Panels.Add(gaugeContainerPanel);

            m_MinRadialGauge          = CreateGaugePanel("Minimum");
            m_MinRadialGauge.Location = new NPointL(new NLength(0, NRelativeUnit.ParentPercentage), new NLength(0, NRelativeUnit.ParentPercentage));
            m_MinIndicator            = CreateIndicator();

            DecorateGaugeAxis(m_MinRadialGauge, new NRange1DD(0, 100), Color.Blue, Color.DarkBlue);
            m_MinRadialGauge.Indicators.Add(m_MinIndicator);
            gaugeContainerPanel.ChildPanels.Add(m_MinRadialGauge);

            m_MaxRadialGauge          = CreateGaugePanel("Maximum");
            m_MaxRadialGauge.Location = new NPointL(new NLength(34, NRelativeUnit.ParentPercentage), new NLength(0, NRelativeUnit.ParentPercentage));
            DecorateGaugeAxis(m_MaxRadialGauge, new NRange1DD(300, 400), Color.Red, Color.DarkRed);
            m_MaxIndicator = CreateIndicator();
            m_MaxRadialGauge.Indicators.Add(m_MaxIndicator);
            gaugeContainerPanel.ChildPanels.Add(m_MaxRadialGauge);

            m_AvgRadialGauge          = CreateGaugePanel("Average");
            m_AvgRadialGauge.Location = new NPointL(new NLength(68, NRelativeUnit.ParentPercentage), new NLength(0, NRelativeUnit.ParentPercentage));
            DecorateGaugeAxis(m_AvgRadialGauge, new NRange1DD(100, 300), Color.Green, Color.DarkGreen);
            m_AvgIndicator = CreateIndicator();
            m_AvgRadialGauge.Indicators.Add(m_AvgIndicator);
            gaugeContainerPanel.ChildPanels.Add(m_AvgRadialGauge);

            // generate some data
            NewDataButton_Click(null, null);
        }
コード例 #19
0
        public override void Initialize()
        {
            base.Initialize();

            // confgigure chart
            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel header = new NLabel("Legend Custom Items");

            header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            header.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);
            header.DockMode            = PanelDockMode.Top;
            header.Margins             = new NMarginsL(0, 10, 0, 10);
            nChartControl1.Panels.Add(header);

            NDockPanel container = new NDockPanel();

            container.DockMode = PanelDockMode.Fill;
            container.Margins  = new NMarginsL(10, 10, 10, 10);
            container.PositionChildPanelsInContentBounds = true;
            nChartControl1.Panels.Add(container);

            // configure the legend
            NLegend legend = CreateLegend(container, "Legend Palette Item");

            NPalette palette = new NPalette();

            palette.Mode = PaletteMode.AutoFixedEntryCount;
            //palette.SmoothPalette = true;

            m_PaletteCellData = new NLegendPaletteCellData(palette, new NRange1DD(0, 100));

            legend.Data.Items.Add(m_PaletteCellData);

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            OrientationComboBox.Items.Add("Horizontal");
            OrientationComboBox.Items.Add("Vertical");
            OrientationComboBox.SelectedIndex = 0;

            ScalePositionComboBox.Items.Add("Left");
            ScalePositionComboBox.Items.Add("Right");
            ScalePositionComboBox.SelectedIndex = 0;
        }
コード例 #20
0
        private NBackgroundDecoratorPanel CreateStatusMeterPanel(string labelText, NPointL location, NRangeIndicator rangeIndicator)
        {
            NBackgroundDecoratorPanel backgroundPanel = new NBackgroundDecoratorPanel();

            backgroundPanel.Location = location;
            backgroundPanel.Size     = new NSizeL(new NLength(80, NRelativeUnit.ParentPercentage),
                                                  new NLength(20, NRelativeUnit.ParentPercentage));

            NImageFrameStyle imageFrameStyle = new NImageFrameStyle(PredefinedImageFrame.Embed);

            imageFrameStyle.BackgroundColor            = Color.Transparent;
            imageFrameStyle.ShadowStyle.Type           = ShadowType.None;
            imageFrameStyle.FillStyle                  = new NColorFillStyle(Color.Transparent);
            backgroundPanel.BackgroundStyle.FillStyle  = new NColorFillStyle(Color.White);
            backgroundPanel.BackgroundStyle.FrameStyle = imageFrameStyle;

            NDockPanel contentPanel = new NDockPanel();

            contentPanel.DockMargins = new NMarginsL(new NLength(15), new NLength(3), new NLength(15), new NLength(3));
            contentPanel.DockMode    = PanelDockMode.Fill;
            backgroundPanel.ChildPanels.Add(contentPanel);

            NLabel label = new NLabel();

            label.DockMode         = PanelDockMode.Bottom;
            label.Text             = labelText;
            label.ContentAlignment = ContentAlignment.MiddleLeft;
            label.DockMargins      = new NMarginsL(new NLength(0), new NLength(0), new NLength(0), new NLength(0));
            label.BoundsMode       = BoundsMode.Fit;
            contentPanel.ChildPanels.Add(label);

            NLinearGaugePanel linearGauge = new NLinearGaugePanel();

            linearGauge.Indicators.Add(rangeIndicator);
            linearGauge.DockMode    = PanelDockMode.Fill;
            linearGauge.DockMargins = new NMarginsL(new NLength(15), new NLength(0), new NLength(15), new NLength(0));

            NGaugeAxis axis = (NGaugeAxis)linearGauge.Axes[0];

            axis.Anchor = new NModelGaugeAxisAnchor();
            NStandardScaleConfigurator configurator = (NStandardScaleConfigurator)axis.ScaleConfigurator;

            configurator.SetPredefinedScaleStyle(PredefinedScaleStyle.Scientific);
            contentPanel.ChildPanels.Add(linearGauge);

            return(backgroundPanel);
        }
コード例 #21
0
        public override void Initialize()
        {
            base.Initialize();

            // configure device and interactivity
            nChartControl1.Panels.Clear();
            nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
            nChartControl1.Controller.Tools.Add(new NTrackballTool());

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Predefined Style Sheets");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);
            title.FitAlignment        = ContentAlignment.MiddleLeft;
            title.Margins             = new NMarginsL(10, 10, 0, 0);
            title.DockMode            = PanelDockMode.Top;

            NDockPanel dockPanel = new NDockPanel();

            dockPanel.DockMode    = PanelDockMode.Fill;
            dockPanel.DockMargins = new NMarginsL(20, 5, 15, 10);
            dockPanel.PositionChildPanelsInContentBounds = true;
            nChartControl1.Panels.Add(dockPanel);

            NChart chart = CreateBarChart();

            chart.Enable3D   = true;
            chart.Location   = new NPointL(5, 0);
            chart.Size       = new NSizeL(new NLength(60, NRelativeUnit.ParentPercentage), new NLength(100, NRelativeUnit.ParentPercentage));
            chart.BoundsMode = BoundsMode.Fit;

            dockPanel.ChildPanels.Add(chart);
            NRadialGaugePanel gauge = CreateRadialGauge();

            dockPanel.ChildPanels.Add(gauge);
            gauge.Location = new NPointL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(10, NRelativeUnit.ParentPercentage));
            gauge.Size     = new NSizeL(new NLength(30, NRelativeUnit.ParentPercentage), new NLength(40, NRelativeUnit.ParentPercentage));

            gauge = CreateRadialGauge();
            dockPanel.ChildPanels.Add(gauge);
            gauge.Location = new NPointL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
            gauge.Size     = new NSizeL(new NLength(30, NRelativeUnit.ParentPercentage), new NLength(40, NRelativeUnit.ParentPercentage));

            PredefinedStyleSheetComboBox.FillFromEnum(typeof(PredefinedStyleSheet));
        }
コード例 #22
0
        private void AddWatermark(NDockPanel containerPanel, String sFileName)
        {
            NWatermark watermark = new NWatermark();

            watermark.StandardFrameStyle.InnerBorderWidth = new NLength(0, NGraphicsUnit.Pixel);
            watermark.StandardFrameStyle.OuterBorderWidth = new NLength(0, NGraphicsUnit.Pixel);
            watermark.FillStyle = new NImageFillStyle(this.MapPathSecure(this.TemplateSourceDirectory + "\\" + sFileName));

            watermark.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage),
                                             new NLength(55, NRelativeUnit.ParentPercentage));

            watermark.ContentAlignment = ContentAlignment.MiddleCenter;
            watermark.UseAutomaticSize = false;
            watermark.Size             = new NSizeL(new NLength(100, NGraphicsUnit.Pixel), new NLength(100, NGraphicsUnit.Pixel));

            containerPanel.ChildPanels.Add(watermark);
        }
コード例 #23
0
        public override void Initialize()
        {
            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel header = new NLabel("Numeric Display Panel");

            header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            header.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);
            header.Location            = new NPointL(
                new NLength(2, NRelativeUnit.ParentPercentage),
                new NLength(2, NRelativeUnit.ParentPercentage));
            nChartControl1.Panels.Add(header);

            NDockPanel dockPanel = new NDockPanel();

            dockPanel.Location         = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
            dockPanel.Size             = new NSizeL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(80, NRelativeUnit.ParentPercentage));
            dockPanel.ContentAlignment = ContentAlignment.MiddleCenter;

            nChartControl1.Panels.Add(dockPanel);

            m_NumericDisplay1 = CreateDisplayPanel();
            m_NumericDisplay2 = CreateDisplayPanel();
            m_NumericDisplay3 = CreateDisplayPanel();

            dockPanel.ChildPanels.Add(m_NumericDisplay1);
            dockPanel.ChildPanels.Add(m_NumericDisplay2);
            dockPanel.ChildPanels.Add(m_NumericDisplay3);

            nChartControl1.Refresh();

            // init form controls
            CellSizeComboBox.Items.Add("Small");
            CellSizeComboBox.Items.Add("Normal");
            CellSizeComboBox.Items.Add("Large");
            CellSizeComboBox.SelectedIndex = 1;
            DisplayStyleComboBox.FillFromEnum(typeof(DisplayStyle));
            DisplayStyleComboBox.SelectedIndex = (int)DisplayStyle.SevenSegmentRounded;

            SignModeComboBox.FillFromEnum(typeof(DisplaySignMode));
            SignModeComboBox.SelectedIndex = (int)DisplaySignMode.Never;

            DataFeedTimer.Start();
        }
コード例 #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!NThinChartControl1.Initialized)
            {
                // get the default chart 
                NThinChartControl1.Panels.Clear();
                NThinChartControl1.BackgroundStyle.FrameStyle.Visible = false;
                NThinChartControl1.Settings.EnableJittering = true;

                // set a chart title
                NLabel title = NThinChartControl1.Labels.AddHeader("Panel Selector Tool");
                title.TextStyle.TextFormat = GraphicsCore.TextFormat.XML;
                title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
                title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
                title.DockMode = PanelDockMode.Top;

                NDockPanel contentPanel = new NDockPanel();
                contentPanel.DockMode = PanelDockMode.Fill;

                // create the first pie chart
                NPieChart pieChart1 = CreatePieChart();
                pieChart1.Location = new NPointL(0, 0);
                pieChart1.Size = new NSizeL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(100, NRelativeUnit.ParentPercentage));
                contentPanel.ChildPanels.Add(pieChart1);

                // create the second pie chart
                NPieChart pieChart2 = CreatePieChart();
                pieChart2.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(0));
                pieChart2.Size = new NSizeL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(100, NRelativeUnit.ParentPercentage));
                contentPanel.ChildPanels.Add(pieChart2);

                NThinChartControl1.Panels.Add(contentPanel);

                // apply style sheet
                NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.BrightMultiColor);
                styleSheet.Apply(NThinChartControl1.Document);

                // add panel selector and trackball tools
                NPanelSelectorTool panelSelector = new NPanelSelectorTool();
                panelSelector.ActivatePanelCallback = new ActivatePanelCallback();
                NThinChartControl1.Controller.Tools.Add(panelSelector);

                NThinChartControl1.Controller.Tools.Add(new NTrackballTool());
            }
        }
コード例 #25
0
        public override void Initialize()
        {
            base.Initialize();

            // confgigure chart
            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel header = new NLabel("Legend Item Text Fit Mode");

            header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            header.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);
            header.DockMode            = PanelDockMode.Top;
            header.Margins             = new NMarginsL(0, 10, 0, 10);
            nChartControl1.Panels.Add(header);

            NDockPanel container = new NDockPanel();

            container.DockMode = PanelDockMode.Fill;
            container.Margins  = new NMarginsL(10, 10, 10, 10);
            container.PositionChildPanelsInContentBounds = true;
            nChartControl1.Panels.Add(container);

            // configure the legend
            // configure the legend
            NLegend legend = new NLegend();

            legend.Header.Text     = "Maximum Legend Item Text Size";
            legend.Mode            = LegendMode.Manual;
            legend.Data.ExpandMode = LegendExpandMode.HorzWrap;
            legend.DockMode        = PanelDockMode.Top;
            legend.Margins         = new NMarginsL(20, 20, 20, 20);
            container.ChildPanels.Add(legend);

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            // init controls
            TextFitModeComboBox.FillFromEnum(typeof(LegendTextFitMode));
            TextFitModeComboBox.SelectedIndex    = (int)LegendTextFitMode.None;
            MaximumLegendItemWidthUpDown.Enabled = false;
        }
コード例 #26
0
        private void CreateCustomLegend1(NDockPanel container)
        {
            NLegend markShapesLegend = CreateLegend(container, "Mark Shapes");

            Array         markShapes = Enum.GetValues(typeof(LegendMarkShape));
            NChartPalette palette    = new NChartPalette(ChartPredefinedPalette.Fresh);

            for (int i = 0; i < markShapes.Length; i++)
            {
                NLegendItemCellData licd      = new NLegendItemCellData();
                LegendMarkShape     markShape = (LegendMarkShape)markShapes.GetValue(i);

                licd.Text          = markShape.ToString();
                licd.MarkShape     = markShape;
                licd.MarkFillStyle = new NColorFillStyle(palette.SeriesColors[i % palette.SeriesColors.Count]);

                markShapesLegend.Data.Items.Add(licd);
            }
        }
コード例 #27
0
        private void ConfigurePieCharts()
        {
            NDockPanel contentPanel = new NDockPanel();

            contentPanel.DockMode = PanelDockMode.Fill;
            nChartControl1.Panels.Add(contentPanel);

            // configure four pie 1
            NDockPanel dockPanelLeftTop = new NDockPanel();

            dockPanelLeftTop.Size     = new NSizeL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
            dockPanelLeftTop.Location = new NPointL(new NLength(0, NRelativeUnit.ParentPercentage), new NLength(0, NRelativeUnit.ParentPercentage));
            dockPanelLeftTop.ChildPanels.Add(ConfigureLabel("2002", 90, new NLength(12, NGraphicsUnit.Point), ContentAlignment.TopLeft, PanelDockMode.Left));
            dockPanelLeftTop.ChildPanels.Add(ConfigurePieChart());
            contentPanel.ChildPanels.Add(dockPanelLeftTop);

            // configure four pie 2
            NDockPanel dockPanelRightTop = new NDockPanel();

            dockPanelRightTop.Size     = new NSizeL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
            dockPanelRightTop.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(0, NRelativeUnit.ParentPercentage));
            dockPanelRightTop.ChildPanels.Add(ConfigureLabel("2003", 90, new NLength(12, NGraphicsUnit.Point), ContentAlignment.TopLeft, PanelDockMode.Left));
            dockPanelRightTop.ChildPanels.Add(ConfigurePieChart());
            contentPanel.ChildPanels.Add(dockPanelRightTop);

            // configure four pie 3
            NDockPanel dockPanelLeftBottom = new NDockPanel();

            dockPanelLeftBottom.Size     = new NSizeL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
            dockPanelLeftBottom.Location = new NPointL(new NLength(0, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
            dockPanelLeftBottom.ChildPanels.Add(ConfigureLabel("2004", 90, new NLength(12, NGraphicsUnit.Point), ContentAlignment.TopLeft, PanelDockMode.Left));
            dockPanelLeftBottom.ChildPanels.Add(ConfigurePieChart());
            contentPanel.ChildPanels.Add(dockPanelLeftBottom);

            // configure four pie 4
            NDockPanel dockPanelRightBottom = new NDockPanel();

            dockPanelRightBottom.Size     = new NSizeL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
            dockPanelRightBottom.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
            dockPanelRightBottom.ChildPanels.Add(ConfigureLabel("2005", 90, new NLength(12, NGraphicsUnit.Point), ContentAlignment.TopLeft, PanelDockMode.Left));
            dockPanelRightBottom.ChildPanels.Add(ConfigurePieChart());
            contentPanel.ChildPanels.Add(dockPanelRightBottom);
        }
コード例 #28
0
        private void ConfigureHeaderLabel()
        {
            NLabel label = new NLabel("Product Revenue Percents 2002 - 2005");

            label.TextStyle.BackplaneStyle.Visible = false;
            label.TextStyle.FontStyle.EmSize       = new NLength(17, NGraphicsUnit.Point);
            label.ContentAlignment = ContentAlignment.MiddleCenter;
            label.DockMode         = PanelDockMode.Fill;
            label.BoundsMode       = BoundsMode.Fit;
            label.TextStyle.StringFormatStyle.VertAlign = VertAlign.Center;

            NDockPanel labelHostPanel = new NDockPanel();

            labelHostPanel.DockMode = PanelDockMode.Top;
            labelHostPanel.Size     = new NSizeL(new NLength(10, NRelativeUnit.ParentPercentage), new NLength(10, NRelativeUnit.ParentPercentage));
            labelHostPanel.ChildPanels.Add(label);

            nChartControl1.Panels.Add(labelHostPanel);
        }
コード例 #29
0
        void OnDockInsideChartPlotCheckBoxCheckedChanged(NValueChangeEventArgs arg)
        {
            NLegend         legend = m_ChartView.Surface.Legends[0];
            NCartesianChart chart  = (NCartesianChart)m_ChartView.Surface.Charts[0];

            legend.ParentNode.RemoveChild(legend);

            if (((NCheckBox)arg.TargetNode).Checked)
            {
                // dock the legend inside the chart
                NDockPanel dockPanel = new NDockPanel();
                chart.Content = dockPanel;
                dockPanel.Add(legend);
            }
            else
            {
                // dock the legend inside the chart
                NDockPanel content = m_ChartView.Surface.Content as NDockPanel;
                content.Add(legend);
            }
        }
コード例 #30
0
        private NDockPanel CreateConceptCarPreviewPanel()
        {
            NDockPanel conceptCarPreviewPanel = new NDockPanel();

            conceptCarPreviewPanel.DockMode = PanelDockMode.Left;
            conceptCarPreviewPanel.Size     = new NSizeL(new NLength(30, NRelativeUnit.ParentPercentage), new NLength(100, NRelativeUnit.ParentPercentage));

            CarData[] cars = new CarData[]
            {
                new CarData("ConceptCar1.png", "Sebastian Calamari", new double[] { 60, 42, 76, 41 }),
                new CarData("ConceptCar2.png", "Oliver Dang", new double[] { 40, 52, 46, 81 }),
                new CarData("ConceptCar3.png", "Zoran Sirotic", new double[] { 76, 66, 24, 65 })
            };

            for (int i = 0; i < cars.Length; i++)
            {
                CreateConceptCarPanels(conceptCarPreviewPanel, cars[i]);
            }

            return(conceptCarPreviewPanel);
        }