Page 1 of 1

Chart displays 2 series

Posted: Wed Aug 10, 2011 6:13 am
by 10054537
Support,

I'm currently using TeeChart WPF.

I've created a chart and set the following properties for the chart:

Code: Select all

            this.chart.Aspect.View3D = false;
            this.chart.Legend.CheckBoxes = true;
            this.chart.Legend.Alignment = LegendAlignments.Top;
            this.chart.Header.Visible = false;
Additionally, I have another method that adds the series for me:

Code: Select all

        public void AddSeries(double[] xValues, double[] yValues)
        {
            //var line = new Steema.TeeChart.WPF.Styles.Line();
            var line = new Steema.TeeChart.WPF.Styles.Points();
            line.Add(xValues, yValues);
            chart.Series.Add(line);
         }
I keep getting two series, one of them is correct i.e. as per added data. However, the other highlighted in the red box below is invalid. I just want the one series as per the added data. What am I doing wrong?

Image

Re: Chart displays 2 series

Posted: Wed Aug 10, 2011 3:44 pm
by 10050769
Hello seth,
I couldn't reproduce your problem using last version and next code:

Code: Select all

        public MainWindow()
        {
            InitializeComponent();
            InitializeChart();
        }
        double[] xValues, yValues;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            tChart1.Legend.CheckBoxes = true;
            tChart1.Legend.Alignment = LegendAlignments.Top;
            tChart1.Header.Visible = false;
            Random rnd = new Random();
            for (int i = 0; i < 2; i++)
            {
                xValues = new double[10];
                yValues = new double[10];
                for (int j = 0; j < 10; j++)
                {
                    xValues[j] = j;
                    yValues[j] = rnd.Next(100);

                }
                AddSeries(xValues,yValues);
            }
        }
        public void AddSeries(double[] xValues, double[] yValues)
        {
            var line = new Steema.TeeChart.WPF.Styles.Points();
            line.Add(xValues, yValues);
           tChart1.Series.Add(line);
        }
Please, check if previous code works fine for you. If works fine, could you try to modify it, so we can reproduce exactly your problem?

Thanks,

Re: Chart displays 2 series

Posted: Thu Aug 11, 2011 1:11 am
by 10054537
Hi Sandra,

Thanks for following up. I realise now, the problem is on my end, the data set in question actually contains only the 1 series and somewhere along the way some values are becoming zero. This does not happen at the teechart level. Thanks for you time.

Seth

Re: Chart displays 2 series

Posted: Thu Aug 11, 2011 8:19 am
by 10050769
Hello Seth,

I am glad that you can find a solution for our problem :)

Thanks,