Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Problems for StackedColumn XamChart which seriese num exceeds 91
posted

My Env: Visual Studio 2008  SP1  with .NetFramework3.5SP1

And Infragistics3.Wpf.Chart.v8.1

OS: Win 2003 EE SP2

 Problem: the tooltip is not shown correctly.  Please check. 

Note that only the first statck on the left is correctly shown the tooltip and the later  tooltips are the same one

which showing the  last series' datapoint's tooltip.

XAML:

<Window x:Class="WpfApplication12.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:igChart="http://infragistics.com/Chart"
    Title="Window1" Height="600" Width="600">
    <Grid>
       
        <igChart:XamChart Name="chart">
            <igChart:XamChart.Series>
                <igChart:Series ChartType="StackedColumn"></igChart:Series>
            </igChart:XamChart.Series>
        </igChart:XamChart>
       
    </Grid>
</Window>

Code behind:

public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
            loadData();

        }

        private void loadData()
        {
            TestData[] td = new TestData[91];

            for (int i = 0; i < td.Length; i++)
            {
                List<TestInnerData> list = new List<TestInnerData>();

                for (int j = 10; j >= 0; j--)
                {
                    list.Add(new TestInnerData() { Date = DateTime.Now.AddDays(-j), Amount = 100000 });

                }

                td[i] = new TestData() { Host = "myhost-w2k3s-" + i, DataForHost = list };
            }

            chart.Series.Clear();

            for (int i = 0; i < td.Length; i++)
            {
                string branchServerName = td[i].Host;

                Series mySeries = new Series()
                {
                    ChartType = ChartType.StackedColumn,                  
                    Label = branchServerName
                };

                foreach (TestInnerData data in td[i].DataForHost)
                {
                    DataPoint dp = new DataPoint()
                    {
                        Label =data.Date.ToString("MMM dd"),
                        Value = data.Amount,
                        ToolTip = null
                    };

                    dp.ToolTip = string.Format(branchServerName + ":{0}", dp.Value);

                    mySeries.DataPoints.Add(dp);
                }

                chart.Series.Add(mySeries);
            }
       
        }

        public class TestData
        {
            public String Host
            {
                get;
                set;
            }

            public List<TestInnerData> DataForHost
            {
                get;
                set;
            }       
         
        }

        public class TestInnerData
        {

            public DateTime Date
            {
                get;
                set;
            }

            public double Amount
            {
                get;
                set;
            }
        }
    }

 

 

 

  • 28496
    Suggested Answer
    Offline posted

    it looks like "fast rendering mode" has been enabled and the labels are repeating due to an optimization gone awry.  you can use this code to work around the problem:

    <igChart:XamChart Name="chart">
                <igChart:XamChart.Series>
                    <igChart:Series ChartType="StackedColumn"></igChart:Series>
                </igChart:XamChart.Series>
                <igChart:XamChart.Scene>
                    <igChart:Scene>
                        <igChart:Scene.GridArea>
                            <igChart:GridArea>
                                <igChart:GridArea.RenderingOptions>
                                    <igChart:GridAreaRenderingOptions RenderingMode="Full" />
                                </igChart:GridArea.RenderingOptions>
                            </igChart:GridArea>
                        </igChart:Scene.GridArea>
                    </igChart:Scene>
                </igChart:XamChart.Scene>
            </igChart:XamChart>