/// <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);
        }
示例#2
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;
        }
示例#3
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);
            }
        }