chart numeric highlights staying on screen after switching tab

  1. #1

    chart numeric highlights staying on screen after switching tab

    Presently, I have a chart with three tabs, so when I go to the first tab, the numbers highlight the chart appropriately; however, when I go to the second tab, the numeric highlights from the first tab still show up. This is not acceptable for a production environment. Please see the attached images. Does anyone have any suggestions?

    Click image for larger version. 

Name:	NumberedHighlightsNotRefreshing1.jpg 
Views:	13 
Size:	86.8 KB 
ID:	7478Click image for larger version. 

Name:	NumberedHighlightsNotRefreshing2.jpg 
Views:	14 
Size:	88.2 KB 
ID:	7479

    Here is the aspx code:

                                                        <ext:Chart ID="Chart3" runat="server" Animate="true">
                                                            <Store>
                                                                <ext:Store ID="Store3" runat="server">
                                                                    <Model>
                                                                        <ext:Model ID="Model4" runat="server">
                                                                            <Fields>
                                                                                <ext:ModelField Name="Name" />
                                                                                <ext:ModelField Name="Normal" />
                                                                                <ext:ModelField Name="Optimistic" />
                                                                            </Fields>
                                                                        </ext:Model>
                                                                    </Model>
                                                                </ext:Store>
                                                            </Store>
                                                            <Axes>
                                                                <ext:CategoryAxis Position="Bottom" Fields="Name" Title="Year" />
                                                                <ext:NumericAxis Title="Data (blue)" Fields="Normal" Position="Left" Minimum="0">
                                                                    <LabelTitle Fill="#115fa6" />
                                                                    <Label Fill="#115fa6" />
                                                                </ext:NumericAxis>
                                                                <ext:NumericAxis Title="Data (green)" Fields="Optimistic" Position="Right" Minimum="0">
                                                                    <LabelTitle Fill="#94ae0a" />
                                                                    <Label Fill="#94ae0a" />
                                                                </ext:NumericAxis>
                                                            </Axes>
                                                            <Series>
                                                                <ext:LineSeries Titles="Blue Line" XField="Name" YField="Normal" Axis="Left" Smooth="3">
                                                                    <HighlightConfig Size="7" Radius="7" />
                                                                    <MarkerConfig Size="4" Radius="4" StrokeWidth="0" />
                                                                </ext:LineSeries>
                                                                <ext:LineSeries Titles="Green Line" XField="Name" YField="Optimistic" Axis="Right"
                                                                    Smooth="3">
                                                                    <HighlightConfig Size="7" Radius="7" />
                                                                    <MarkerConfig Size="4" Radius="4" StrokeWidth="0" />
                                                                </ext:LineSeries>
                                                            </Series>
                                                            <Plugins>
                                                                <ext:VerticalMarker ID="VerticalMarker1" runat="server">
                                                                    <XLabelRenderer Handler="return Ext.util.Format.date(value + 1, 'y');" />
                                                                </ext:VerticalMarker>
                                                            </Plugins>
                                                            <LegendConfig Position="Bottom" />
                                                        </ext:Chart>
    Here is the C# code that creates the chart and updates the labels:

            protected void ReloadData3(object sender, DirectEventArgs e)
            {
                Store store = this.Chart3.GetStore();
    
                store.DataSource = LineChartData.GenerateData(Convert.ToInt32(ddlTechnicalDriverCond.SelectedItem.Value), Convert.ToInt32(ddlFieldCond.SelectedItem.Value), Convert.ToInt32(ddlProjectCond.SelectedItem.Value));
                store.DataBind();
                this.ChangeChartLabel();
                this.Chart3.ReRender();
            }
    
                public static List<LineChartData> GenerateData(int _IdTechnicalDriver, int _IdField, int _IdProject)
                {
                    DataClass.clsTechnicalDriverData oTechnicalDriver1 = new DataClass.clsTechnicalDriverData();
                    DataTable dt = oTechnicalDriver1.LoadList("IdProject = '" + _IdProject + "' AND IdField = '" + _IdField + "' AND IdTechnicalDriver = '" + _IdTechnicalDriver + "'", "");
                    List<LineChartData> data = new List<LineChartData>(dt.Rows.Count);
                    Int32 intYear = DateTime.Now.Year;
    
                    foreach (DataRow objRow in dt.Rows)
                    {
                        string strDriver1Baseline = objRow["Normal"].ToString() != "" ? objRow["Normal"].ToString() : null;
                        string strDriver1Optimistic = objRow["Optimistic"].ToString() != "" ? objRow["Optimistic"].ToString() : null;
                        string strDriver1Pessimistic = objRow["Pessimistic"].ToString() != "" ? objRow["Pessimistic"].ToString() : null;
    
                        data.Add(new LineChartData
                        {
                            Name = Convert.ToString(intYear),
                            Normal = Convert.ToDouble(strDriver1Baseline),
                            Optimistic = Convert.ToDouble(strDriver1Optimistic),
                            Pessimistic = Convert.ToDouble(strDriver1Pessimistic)
                        });
                        intYear++;
                    }
    
                    return data;
                }
            }
    
            private void ChangeChartLabel()
            {
                // Other code...
    
                // Change Chart 3 (the middle chart) labels:
                this.Chart3.Axes.RemoveAt(1);
                this.Chart3.Axes.RemoveAt(1);
                this.Chart3.Axes.Add(axis1);
                this.Chart3.Axes.Add(axis2);
    
                var lineSeries1 = this.Chart3.Series[0];
                var lineSeries2 = this.Chart3.Series[1];
                lineSeries1.Titles[0] = strTechnicalDriver1Unit;
                lineSeries2.Titles[0] = strTechnicalDriver2Unit;
    
                this.Chart3.Series.RemoveAt(0);
                this.Chart3.Series.RemoveAt(0);
                this.Chart3.Series.Add(lineSeries1);
                this.Chart3.Series.Add(lineSeries2);
            }
    Last edited by rmoore; Jan 13, 2014 at 6:34 PM. Reason: added more info, code and images
  2. #2
    Do you have Buffer option in VerticalMarker plugin?
    If yes then remove it

    If you have no Buffer option then please provide runable sample reproduces the issue
  3. #3

    Removed Buffer

    Yes, that solved the problem. Thank you!

    Quote Originally Posted by Vladimir View Post
    Do you have Buffer option in VerticalMarker plugin?
    If yes then remove it

    If you have no Buffer option then please provide runable sample reproduces the issue

Similar Threads

  1. [CLOSED] Numeric grid Filter, numeric field Decimal Places
    By RCM in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 10, 2013, 8:37 PM
  2. Replies: 1
    Last Post: Sep 25, 2013, 11:13 AM
  3. Replies: 5
    Last Post: May 16, 2013, 5:39 PM
  4. Replies: 0
    Last Post: May 30, 2012, 8:44 PM
  5. Replies: 2
    Last Post: Mar 02, 2012, 1:07 PM

Tags for this Thread

Posting Permissions