How to refesh chart once 'chart area' is draged?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

How to refesh chart once 'chart area' is draged?

Post by Neelam » Mon May 28, 2012 10:20 am

Hi,

How to refresh chart once 'chart area' is draged?

I am plotting a report chart based on some filteration,chart is plotting correctly but when i dragged on chart area toward right side my chart cruves(Line series) and axes data (y primary and y secondary) is changed(which is fine) but when i change my filteration its seems my chart is not refeshing properlly.(may be its saving somewhere in cache the previous draged status...not know).

I am using TeeChart.Silverlight(4.1.2012.1033)

I have tried with - 1:tChart.AutoRepaint = false;,tChart.AutoRepaint = true;
2 tChart.Invalidate() 3: TeeChart.DataContext = null;
but its not wroked for me.

Regards
Satyendra

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

Re: How to refesh chart once 'chart area' is draged?

Post by Sandra » Mon May 28, 2012 2:37 pm

Hello Neelam,

As I told you in this thread you can use to redraw the chart, the property of MainPage Visibiblity and set it to Visible as do in next lines of code:

Code: Select all

 //Add it to redraw
            this.Visibility = System.Windows.Visibility.Visible;
So, I think you can use this property every time you need to redraw the chart. Can you confirm us if it solve your problem?

I hope will helps.

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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Re: How to refesh chart once 'chart area' is draged?

Post by Neelam » Tue May 29, 2012 6:24 am

Hi
Thanks for yr reply.
Its seems you have not understand the actual issue.i am attaching a file pls refer for more brief on issue.
I dont want to redraw the chart.

Regards
Satyendra
Attachments
ChartDraggedIssue.rar
Chart dragged issue brief
(224.26 KiB) Downloaded 675 times

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

Re: How to refesh chart once 'chart area' is draged?

Post by Sandra » Wed May 30, 2012 10:08 am

Hello Neelam,

Thanks for extra information. I have made a simple code where I am initializing the chart every time I am changing the scenario and I think you can use to achieve as you want.

Code: Select all

 Steema.TeeChart.Silverlight.Styles.Line Series1, Series2;
        public MainPage()
        {
            InitializeComponent();
            //Series
            //comboBox
            this.comboBox1.Items.Add("Scenario A");
            this.comboBox1.Items.Add("Scenario B");
            this.comboBox1.SelectedIndex = 0;
            this.comboBox1.SelectedItem = 0;
            comboBox1.SelectionChanged +=new SelectionChangedEventHandler(comboBox1_SelectionChanged);
           // comboBox1
            InitializeChart();
            Scrolling();
        }

        void comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch(comboBox1.SelectedIndex)
            {
                case 0:
                    tChart1.Clear();
                    InitializeChart();
                    Scrolling();
                    break;
                case 1:
                    tChart1.Clear();
                    tChart1.Aspect.View3D = false;                    
                    Series1 = new Steema.TeeChart.Silverlight.Styles.Line(tChart1.Chart);
                    Series1.FillSampleValues();
                    Scrolling();
                    break;
            }
        }
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Series1 = new Steema.TeeChart.Silverlight.Styles.Line(tChart1.Chart);
            Series2 = new Steema.TeeChart.Silverlight.Styles.Line(tChart1.Chart);
            Series1.Add(0, 0.05);
            Series1.Add(1, 0.1);
            Series1.Add(2, 0.15);
            Series1.Add(3, 0.2);
            Series1.Add(4, 0.25);
            Series1.Add(5, 0.30);
            Series1.VertAxis = VerticalAxis.Left;
            Series2.Add(0, 35);
            Series2.Add(1, 20);
            Series2.Add(2, 150);
            Series2.Add(3, 98);
            Series2.Add(4, 75);
            Series2.Add(5, 120);
            Series1.VertAxis = Steema.TeeChart.Silverlight.Styles.VerticalAxis.Left;
            tChart1.Axes.Right.Visible = true;
            Series2.VertAxis = Steema.TeeChart.Silverlight.Styles.VerticalAxis.Right;
            this.Visibility = System.Windows.Visibility.Visible;
        }
        private void Scrolling()
        {
            tChart1.Zoom.Allow = false;
            tChart1.Panning.Allow = Steema.TeeChart.Silverlight.ScrollModes.Horizontal;
            tChart1.Panning.MouseButton = System.Windows.Browser.MouseButtons.Left;
        }
Can you tell if it works as you expect?

I hope will helps.

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