Пример #1
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Ternary Bubble Chart");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, System.Drawing.FontStyle.Italic);

            NLegend legend = new NLegend();

            nChartControl1.Panels.Add(legend);

            // setup chart
            NTernaryChart ternaryChart = new NTernaryChart();

            nChartControl1.Panels.Add(ternaryChart);
            ternaryChart.DisplayOnLegend = legend;

            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryA));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryB));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryC));

            // add a bubble series
            m_BubbleSeries = new NTernaryBubbleSeries();
            ternaryChart.Series.Add(m_BubbleSeries);
            m_BubbleSeries.DataLabelStyle.VertAlign = VertAlign.Center;
            m_BubbleSeries.DataLabelStyle.Visible   = false;
            m_BubbleSeries.Legend.Mode   = SeriesLegendMode.DataPoints;
            m_BubbleSeries.MinSize       = new NLength(2.0f, NGraphicsUnit.Point);
            m_BubbleSeries.MaxSize       = new NLength(20, NGraphicsUnit.Point);
            m_BubbleSeries.Legend.Mode   = SeriesLegendMode.DataPoints;
            m_BubbleSeries.Legend.Format = "<size>";

            Random rand = new Random();

            for (int i = 0; i < 20; i++)
            {
                // will be automatically normalized so that the sum of a, b, c value is 100
                double aValue = rand.Next(100);
                double bValue = rand.Next(100);
                double cValue = rand.Next(100);

                m_BubbleSeries.AValues.Add(aValue);
                m_BubbleSeries.BValues.Add(bValue);
                m_BubbleSeries.CValues.Add(cValue);
                m_BubbleSeries.Sizes.Add(10 + rand.Next(90));
            }

            // apply layout
            ConfigureStandardLayout(ternaryChart, title, nChartControl1.Legends[0]);

            // init form controls
            BubbleShapeCombo.FillFromEnum(typeof(PointShape));
            BubbleShapeCombo.SelectedIndex = 6;

            DifferentColors.Checked = true;
        }
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Ternary Point Chart");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, System.Drawing.FontStyle.Italic);

            NLegend legend = new NLegend();

            nChartControl1.Panels.Add(legend);

            // setup chart
            NTernaryChart ternaryChart = new NTernaryChart();

            nChartControl1.Panels.Add(ternaryChart);
            ternaryChart.DisplayOnLegend = legend;

            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryA));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryB));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryC));

            NTernaryPointSeries point = new NTernaryPointSeries();

            ternaryChart.Series.Add(point);

            // setup point series
            point.Name = "Ternary Point Series";

            Random rand = new Random();

            for (int i = 0; i < 20; i++)
            {
                // will be automatically normalized so that the sum of a, b, c value is 100
                double aValue = rand.Next(100);
                double bValue = rand.Next(100);
                double cValue = rand.Next(100);

                point.AValues.Add(aValue);
                point.BValues.Add(bValue);
                point.CValues.Add(cValue);
            }

            point.Legend.Mode = SeriesLegendMode.DataPoints;

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

            styleSheet.Apply(nChartControl1.Document);

            // apply layout
            ConfigureStandardLayout(ternaryChart, title, legend);
        }
Пример #3
0
        public override void Initialize()
        {
            base.Initialize();

            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Ternary Point Chart");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);

            NLegend legend = new NLegend();

            nChartControl1.Panels.Add(legend);

            // setup chart
            NTernaryChart ternaryChart = new NTernaryChart();

            nChartControl1.Panels.Add(ternaryChart);
            ternaryChart.DisplayOnLegend = legend;

            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryA));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryB));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryC));

            m_Point = new NTernaryPointSeries();
            ternaryChart.Series.Add(m_Point);

            // setup point series
            m_Point.Name = "Ternary Point Series";

            Random rand = new Random();

            for (int i = 0; i < 20; i++)
            {
                // will be automatically normalized so that the sum of a, b, c value is 100
                double aValue = rand.Next(100);
                double bValue = rand.Next(100);
                double cValue = rand.Next(100);

                m_Point.AValues.Add(aValue);
                m_Point.BValues.Add(bValue);
                m_Point.CValues.Add(cValue);
            }

            // apply layout
            ConfigureStandardLayout(ternaryChart, title, legend);

            // init form controls
            PointStyleCombo.FillFromEnum(typeof(PointShape));
            PointStyleCombo.SelectedIndex = 0;
            DifferentColorsCheck.Checked  = true;
            PointSizeScroll.Value         = 3;
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                WebExamplesUtilities.FillComboWithEnumNames(PointShapeDropDownList, typeof(PointShape));
                DifferentColorsCheckBox.Checked = true;
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Ternary Point Chart");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

            // setup chart
            NTernaryChart ternaryChart = new NTernaryChart();

            nChartControl1.Panels.Add(ternaryChart);

            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryA));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryB));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryC));

            NTernaryPointSeries point = new NTernaryPointSeries();

            ternaryChart.Series.Add(point);

            // setup point series
            point.Name  = "Ternary Point Series";
            point.Shape = (PointShape)PointShapeDropDownList.SelectedIndex;

            Random rand = new Random();

            for (int i = 0; i < 20; i++)
            {
                // will be automatically normalized so that the sum of a, b, c value is 100
                double aValue = rand.Next(100);
                double bValue = rand.Next(100);
                double cValue = rand.Next(100);

                point.AValues.Add(aValue);
                point.BValues.Add(bValue);
                point.CValues.Add(cValue);
            }

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, ternaryChart, title, null);

            if (DifferentColorsCheckBox.Checked)
            {
                // apply style sheet
                NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor);
                styleSheet.Apply(nChartControl1.Document);
            }
            else
            {
                // apply style sheet
                NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);
                styleSheet.Apply(nChartControl1.Document);
            }
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                WebExamplesUtilities.FillComboWithEnumNames(BubbleShapeDropDownList, typeof(PointShape));
                DifferentColorsCheckBox.Checked = true;
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Ternary Bubble Chart");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

            // setup chart
            NTernaryChart ternaryChart = new NTernaryChart();

            nChartControl1.Panels.Add(ternaryChart);

            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryA));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryB));
            ConfigureAxis(ternaryChart.Axis(StandardAxis.TernaryC));

            // add a bubble series
            NTernaryBubbleSeries bubbleSeries = new NTernaryBubbleSeries();

            ternaryChart.Series.Add(bubbleSeries);
            bubbleSeries.DataLabelStyle.VertAlign = VertAlign.Center;
            bubbleSeries.DataLabelStyle.Visible   = false;
            bubbleSeries.Legend.Mode   = SeriesLegendMode.DataPoints;
            bubbleSeries.MinSize       = new NLength(2.0f, NGraphicsUnit.Point);
            bubbleSeries.MaxSize       = new NLength(20, NGraphicsUnit.Point);
            bubbleSeries.Legend.Mode   = SeriesLegendMode.DataPoints;
            bubbleSeries.Legend.Format = "<size>";
            bubbleSeries.Shape         = (PointShape)BubbleShapeDropDownList.SelectedIndex;

            Random rand = new Random();

            for (int i = 0; i < 20; i++)
            {
                // will be automatically normalized so that the sum of a, b, c value is 100
                double aValue = rand.Next(100);
                double bValue = rand.Next(100);
                double cValue = rand.Next(100);

                bubbleSeries.AValues.Add(aValue);
                bubbleSeries.BValues.Add(bValue);
                bubbleSeries.CValues.Add(cValue);
                bubbleSeries.Sizes.Add(10 + rand.Next(90));
            }


            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, ternaryChart, title, null);

            if (DifferentColorsCheckBox.Checked)
            {
                // apply style sheet
                NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor);
                styleSheet.Apply(nChartControl1.Document);
            }
            else
            {
                // apply style sheet
                NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);
                styleSheet.Apply(nChartControl1.Document);
            }
        }