Page 1 of 1

Stack bar bug?

Posted: Thu Mar 21, 2013 2:49 pm
by 15663950
Hello,

In gallery panel, when you change bar series sub-type to stack then strange things happen. Looks like extra series is added, number of points in each series is changed, values are set to 0 and 1, and chart is broken.

You can check this in code when you apply sub-type:

series.SetSubGallery(6), provided that series is of Bar style.

Or you can even see this in your demo project: All features\Welcome\Gallery\Chart Gallery Panel - select Bar style, then change to Stack sub-style.

regards, Adam

Re: Stack bar bug?

Posted: Fri Mar 22, 2013 4:22 pm
by 10050769
Hello Adam,

You are right. I have added your request in bug list report with number [TF02016545]. We will try to fix it to upcoming version of TeeChartFor.Net.

Thanks,

Re: Stack bar bug?

Posted: Tue Mar 26, 2013 9:55 am
by 15663950
Hello Sandra.

'Side' and 'Side All' sub-types are also wrong. New series is added when trying to apply these sub-types to a chart.

regards, Adam

Re: Stack bar bug?

Posted: Tue Mar 26, 2013 4:10 pm
by 10050769
Hello Adam,

Thanks for information, you are right. I have completed the bug number(TF02016545) with it. We will try to fix it to upcoming versions of TeeChartFor.Net

Thanks,

Re: Stack bar bug?

Posted: Fri Apr 05, 2013 2:57 pm
by 10050769
Hello Adam,

I inform you that after doing some tests, we consider that bug number [TF02016545] isn't a bug, because it is not a defect, is a behavior by design. On the other hand, we appreciate your information and we have decided introduce a discussion about this behavior to consider if TeeChart Gallery panel sub-types stack, side-to-side need a redesign or not.

Thank you,

Re: Stack bar bug?

Posted: Tue Apr 09, 2013 5:39 pm
by 15663950
I don't realy know what you mean by saing that adding a new extra series to a chart is by design and this is not a bug.
I have a single series bar chart, then I try to change it to a stack bar sub-type and as the result I get new unneded series, all series values (including original one) are cleared and this is by design?

Could you please clarify this a bit for me? What was your idea to implement such behaviour by default?

regards, Adam

Re: Stack bar bug?

Posted: Tue Apr 09, 2013 5:48 pm
by 15663950
One more question. If this behavior is by design then please give me a sample source code of creating a valid stack-bar style chart.

regards, Adam

Re: Stack bar bug?

Posted: Wed Apr 10, 2013 10:39 am
by 10050769
Hello Adam,
I don't realy know what you mean by saing that adding a new extra series to a chart is by design and this is not a bug.
Gallery panel currently have a determinate behaviour and we must consider its change, it doesn't mean we won't treat the problem, because we have already started the discussion about functionality of Gallery panel, we have changed the tipology the problem, from bug to Enhancement(TF02016545), so we able be considered the changes in correct way.
I have a single series bar chart, then I try to change it to a stack bar sub-type and as the result I get new unneded series, all series values (including original one) are cleared and this is by design? Could you please clarify this a bit for me? What was your idea to implement such behaviour by default?
Thanks your information, we have realized isn't logical Gallery panel allow do stack or side-to-side when you have only one series, because you need minimum two series to these styles works in logical way. In this point, we have checked if gallery panel works correctly if you have two series, result, Gallery panel works in our end, if we add the two series initially. You can check it using next code:

Code: Select all

         public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.GalleryPanel galleryPanel1;
        Steema.TeeChart.Styles.Bar Series1,Series2;
        private void InitializeChart()
        {
            tChart1.Series.Add(Series1 = new Steema.TeeChart.Styles.Bar());
            tChart1.Series.Add(Series2 = new Steema.TeeChart.Styles.Bar());
            Series1.FillSampleValues(10);
            Series2.FillSampleValues(2);
            Series1.MultiBar = MultiBars.None;
            Series2.MultiBar = MultiBars.None;

            galleryPanel1 = new Steema.TeeChart.GalleryPanel();
            this.Controls.Add(galleryPanel1);
            galleryPanel1.Left = tChart1.Left - 200;
            galleryPanel1.Top = tChart1.Top;
            galleryPanel1.Width = 200;
            galleryPanel1.Height = tChart1.Height;
            galleryPanel1.NumRows = 3;
            galleryPanel1.NumCols = 2;
            galleryPanel1.CreateGallerySeries(typeof(Steema.TeeChart.Styles.Line));
            galleryPanel1.CreateGallerySeries(typeof(Steema.TeeChart.Styles.Bar));
            galleryPanel1.CreateGallerySeries(typeof(Steema.TeeChart.Styles.Points));
            galleryPanel1.CreateGallerySeries(typeof(Steema.TeeChart.Styles.Area));
            galleryPanel1.OnChangeChart += new EventHandler(galleryPanel1_OnChangeChart);
            galleryPanel1.OnSubSelected += new EventHandler(galleryPanel1_OnSubSelected);

            SetDefaultSelect();
            tChart1.Draw();

        }
        private void SetDefaultSelect()
        {
            galleryPanel1.SelectedChart = galleryPanel1.Charts[1];
            galleryPanel1.SelectedChart.Aspect.View3D = true;
            galleryPanel1.SelectedChart.Panel.Gradient.Visible = true;
            galleryPanel1.SelectedChart.Panel.Gradient.Direction = LinearGradientMode.Vertical;
            galleryPanel1.SelectedChart.Panel.Gradient.StartColor = Color.Silver;

            galleryPanel1.SelectedChart.Aspect.Rotation = 345;
            galleryPanel1.SelectedChart.Header.Font.Bold = true;
            galleryPanel1.SelectedChart.Header.Font.Color = Color.Black;
            galleryPanel1.SelectedChart.Header.Font.Size = 9;
            galleryPanel1.SelectedChart.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.Raised;

        }

        private void galleryPanel1_OnChangeChart(object sender, System.EventArgs e)
        {
            Steema.TeeChart.Styles.Series s = tChart1[0]; 
            Steema.TeeChart.Styles.Series.ChangeType(ref s, galleryPanel1.SelectedChart[0].GetType());
        }
       
        private void galleryPanel1_OnSubSelected(object sender, System.EventArgs e)
        {
            galleryPanel1.SetSubSelected(tChart1[0], (int)galleryPanel1.SelectedChart.Tag);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            tChart1.ShowEditor();

        }
One more question. If this behavior is by design then please give me a sample source code of creating a valid stack-bar style chart.
You can use similar code of my previous example to create a valid stack-bar style using two series.

If you have any questions please let me know.

Thanks,

Re: Stack bar bug?

Posted: Thu Apr 11, 2013 9:27 am
by 15663950
Hello Sandra,

Thanks for explanation of your idea of stack bar series, it helped me to implement some workarounds in my code so the chart looks good now.

But I still think that your implementation of stack bar is a bug. And it's not only a problem of the gallery panel. There is also a series method SetSubGallery(subTypeIndex) which I use for changing series sub-type and this gives the same effect.

You said that stack or side-to-side bars are not logical for single series chart. I agree. But, even though it is not logical, the chart should still look exactly the same as a standard bar chart (stack bar chart with one series is still a bar chart but with only one element of the stack, so you won't see any changes). This shouldn't be a reason for adding extra series to my chart to make it look 'more logical', but with damaged data!
I checked also area stack charts and it works fine there, no extra series is added and chart looks the same as standard area bar (for one series chart)...
Disabling stack bars for single series chart would be much better than 'improving' the logic of my chart.

But thanks anyway, I also found the solution to my problems with multi series stack bars. I have to change series sub-type after all series are already created (and I was changing sub-type each time I added new series, so the first series was always causing troubles).

regards, Adam

Re: Stack bar bug?

Posted: Mon Apr 15, 2013 3:19 pm
by 10050769
Hello Adam,

Thanks for information, I am glad that you can find a solution that allow you work in correct way :D.
But I still think that your implementation of stack bar is a bug. And it's not only a problem of the gallery panel. There is also a series method SetSubGallery(subTypeIndex) which I use for changing series sub-type and this gives the same effect.
I understand you, but we consider it is a enhancement of gallery panel component in our internal classification and as I have told you, It doesn't mean we don't solve this problem. We will try to consider its inclusion to upcoming versions of TeeChartFor.Net and we

Thanks,