GetPointerStyle Issue of multiple styles

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Bhausaheb
Newbie
Newbie
Posts: 1
Joined: Wed Dec 29, 2010 12:00 am

GetPointerStyle Issue of multiple styles

Post by Bhausaheb » Mon Jul 18, 2011 7:28 pm

Hello,

I was trying to display data in the form of point series with each point having its own color and pointer style. I created new class derived from CustomPoint. I used GetPointerStyle event of this class to set Color and Style of each point. However graph is not displaying all data points. some of the points are not visible.

Following is the code example which has same issue.

Code: Select all

    public partial class MainFrm : Form
    {
        TChart tchart = new TChart();
        public MainFrm()
        {
            tchart.Dock = DockStyle.Fill;
            tchart.Aspect.View3D = false;
            this.Controls.Add(tchart);
        }

        protected override void OnLoad(EventArgs e)
        {
            ValuePoints point = new ValuePoints(tchart.Chart, "TestData");
            point.GetPointerStyle += point_GetPointerStyle;
        }       

        void point_GetPointerStyle(CustomPoint series, GetPointerStyleEventArgs e)
        {
            ValuePoints ser = series as ValuePoints;
            if (ser != null && e.ValueIndex >= 0)
            {
                e.Color = ser.SeriesColors[e.ValueIndex];
                e.Style = ser.Styles[e.ValueIndex];
            }
        }
    }

    public class ValuePoints : CustomPoint
    {
        public List<Color> SeriesColors;
        public List<PointerStyles> Styles;
        public ValuePoints(Chart c, string title)
            : base(c)
        {
            this.Title = title;
            this.FillSampleValues(6);
            SeriesColors = new List<Color>(new[] { Color.Red, Color.Green, Color.Yellow, Color.Magenta, Color.Yellow, Color.Purple });
            Styles = new List<PointerStyles>(new[] { PointerStyles.Sphere, PointerStyles.Cross, PointerStyles.Star, PointerStyles.Triangle, PointerStyles.Rectangle, PointerStyles.DownTriangle });
            this.Pointer.HorizSize = this.Pointer.VertSize = 3;
        }

        public override void DrawValue(int valueIndex)
        {
            base.DrawValue(valueIndex);
        }
    }
Also I tried using Points series as

Code: Select all

        protected override void OnLoad(EventArgs e)
        {
            Points point = new Points(tchart.Chart);
            point.FillSampleValues(6);
            point.GetPointerStyle += point_GetPointerStyle;
        } 
        void point_GetPointerStyle(CustomPoint series, GetPointerStyleEventArgs e)
        {
            if (e.ValueIndex >= 0)
            {
                var SeriesColors = new List<Color>(new[] { Color.Red, Color.Green, Color.Yellow, Color.Magenta, Color.Yellow, Color.Purple });
                var Styles = new List<PointerStyles>(new[] { PointerStyles.Sphere, PointerStyles.Cross, PointerStyles.Star, PointerStyles.Triangle, PointerStyles.Rectangle, PointerStyles.DownTriangle });
                e.Color = SeriesColors[e.ValueIndex];
                e.Style = Styles[e.ValueIndex];
            }
        }
 
With these examples, my second and third points appears to be invisible on graph.

Please help me with this problem.

Thanks,
Bhausaheb

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: GetPointerStyle Issue of multiple styles

Post by Sandra » Tue Jul 19, 2011 10:09 am

Hello Bhausaheb

I can reproduce your problem and I have attached it in bug list report with number [TF02015667] we will try to fix it to next maintenance releases.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply