Esempio n. 1
0
        public void OnAfterDeserialize()
        {
            mDataSource = new ChartSparseDataSource();
            mDataSource.SuspendEvents = true;
            mDataSource.Clear();
            if (mCategories == null)
            {
                mCategories = new CategoryData[0];
            }
            if (mGroups == null)
            {
                mGroups = new string[0];
            }
            if (mData == null)
            {
                mData = new DataEntry[0];
            }

            for (int i = 0; i < mCategories.Length; i++)
            {
                AddCategory(mCategories[i].Name, mCategories[i].Materials, mCategories[i].Title, mCategories[i].Text, mCategories[i].Image, mCategories[i].Alpha, mCategories[i].HeightRatio, mCategories[i].LeftSlope, mCategories[i].RightSlope, mCategories[i].PositionBlend, mCategories[i].Scale, mCategories[i].ShiftX, mCategories[i].ShiftY);
            }
            //            for (int i = 0; i < mGroups.Length; i++)
            //                AddGroup(mGroups[i]);
            if (mDataSource.Rows.Count == 0)
            {
                mDataSource.Rows.Add(new DataSource.ChartDataRow("Pyramid"));
            }
            for (int i = 0; i < mData.Length; i++)
            {
                try
                {
                    DataEntry entry = mData[i];
                    mDataSource.SetValue(entry.ColumnName, entry.GroupName, entry.Amount);
                }
                catch (Exception)
                {
                }
            }

            mDataSource.SuspendEvents = false;
        }
        public void OnAfterDeserialize()
        {
            mDataSource = new ChartSparseDataSource();
            mDataSource.SuspendEvents = true;
            mDataSource.Clear();
            if (mCategories == null)
            {
                mCategories = new CategoryData[0];
            }
            if (mGroups == null)
            {
                mGroups = new string[0];
            }
            if (mData == null)
            {
                mData = new DataEntry[0];
            }
            for (int i = 0; i < mCategories.Length; i++)
            {
                AddCategory(mCategories[i].Name, mCategories[i]);
            }
            for (int i = 0; i < mGroups.Length; i++)
            {
                AddGroup(mGroups[i]);
            }

            for (int i = 0; i < mData.Length; i++)
            {
                try
                {
                    DataEntry entry = mData[i];
                    mDataSource.SetValue(entry.ColumnName, entry.GroupName, entry.Amount);
                }
                catch (Exception)
                {
                }
            }

            mDataSource.SuspendEvents = false;
        }
Esempio n. 3
0
        void IInternalPieData.OnAfterDeserialize()
        {
            mDataSource = new ChartSparseDataSource();
            mDataSource.SuspendEvents = true;
            mDataSource.Clear();
            if (mCategories == null)
            {
                mCategories = new CategoryData[0];
            }
            if (mGroups == null)
            {
                mGroups = new string[0];
            }
            if (mData == null)
            {
                mData = new DataEntry[0];
            }

            for (int i = 0; i < mCategories.Length; i++)
            {
                AddCategory(mCategories[i].Name, mCategories[i].Materials, mCategories[i].RadiusScale, mCategories[i].DepthScale, mCategories[i].DepthOffset);
            }
            //            for (int i = 0; i < mGroups.Length; i++)
            //                AddGroup(mGroups[i]);
            mDataSource.Rows.Add(new DataSource.ChartDataRow("Pie"));
            for (int i = 0; i < mData.Length; i++)
            {
                try
                {
                    DataEntry entry = mData[i];
                    mDataSource.SetValue(entry.ColumnName, entry.GroupName, entry.Amount);
                }
                catch (Exception)
                {
                }
            }

            mDataSource.SuspendEvents = false;
        }