Esempio n. 1
0
        /// <summary>
        /// Add Group of Chart for coordinating with the defined axile to existing group
        /// </summary>
        /// <param name="axile">Which axile for coordinating</param>
        /// <param name="group">Send 'ID' of existing group</param>
        /// <param name="charts">Group of Chart</param>
        public void InsertCoordinator(Axile axile, int group, params Chart[] charts)
        {
            foreach (Coordinated c in coordinated)
            {
                foreach (Chart chart in charts)
                {
                    if (chart.Component == null)
                    {
                        throw new Exception("Chart has not axile component");
                    }
                    else
                    {
                        AxileBase ab = chart.Component as AxileBase;
                        if (ab == null)
                        {
                            throw new Exception("Chart has not axile component");
                        }
                        else
                        {
                            if (c.Contains(chart) && c.Axile == axile)
                            {
                                throw new Exception("Repeat add axile chart");
                            }
                        }
                    }
                }
            }

            SetChartDrawManager(charts);

            coordinated[group].AddRange(charts);
        }
Esempio n. 2
0
 private void chbxIndependentZero_CheckedChanged(object sender, EventArgs e)
 {
     if (cbxChart.SelectedIndex >= 0 && cbxChart.SelectedIndex < list.Count)
     {
         BaseChartComponent c     = list[cbxChart.SelectedIndex];
         AxileBase          axile = c as AxileBase;
         if (c != null)
         {
             this.chbxIndependentZero.CheckedChanged -= new System.EventHandler(this.chbxIndependentZero_CheckedChanged);
             axile.SecondDataMemberIndependentZero    = chbxIndependentZero.Checked;
             chbxIndependentZero.Checked              = axile.SecondDataMemberIndependentZero;
             this.chbxIndependentZero.CheckedChanged += new System.EventHandler(this.chbxIndependentZero_CheckedChanged);
         }
     }
 }
Esempio n. 3
0
        void Chart_ComponentChanged(object sender, EventArgs e)
        {
            Chart c = (Chart)sender;

            if (c.Component == null)
            {
                throw new Exception("Chart has not axile component");
            }
            else
            {
                AxileBase ab = c.Component as AxileBase;
                if (ab == null)
                {
                    throw new Exception("Chart has not axile component");
                }
            }
        }
Esempio n. 4
0
        protected override void InternalPaintFinish(Graphics grChart, IBindingData data)
        {
            //TODO : active VerticalGrid in BackOfData
            if (this.VerticalGrid != HorizontalGridMode.None)
            {
                Pen penGrid = new Pen(base.GridColor, 1);
                AxileBase.SetDashStyle(penGrid, this.GridDashStyle);

                int wBegin = (int)this.DrawArea.Top;
                int wEnd   = (int)this.DrawArea.Bottom;

                foreach (AxileLabelText dt in LabelsX)
                {
                    ItemPointInfo ipi = new ItemPointInfo
                    {
                        ColIndex = -1
                    };

                    foreach (ItemPointInfo ipi2 in pointLocation)
                    {
                        if (ipi2.ColIndex == dt.ColumnIndex)
                        {
                            ipi = ipi2;
                            break;
                        }
                    }

                    if (ipi.ColIndex != -1)
                    {
                        int x = (int)(ipi.Center.X);
                        grChart.DrawLine(penGrid, x, wBegin, x, wEnd);
                    }
                    else
                    {
                        grChart.FillRectangle(Brushes.DarkKhaki, dt.Rectangle);
                    }
                }

                penGrid.Dispose();
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Add Group of Chart for coordinating with the defined axile
        /// </summary>
        /// <param name="axile">Which axile for coordinating</param>
        /// <param name="charts">Group of Chart</param>
        /// <returns>return 'ID' for add chart to this group later</returns>
        public int AddCoordinatorGroup(Axile axile, params Chart[] charts)
        {
            foreach (Coordinated c in coordinated)
            {
                foreach (Chart chart in charts)
                {
                    if (chart.Component == null)
                    {
                        throw new Exception("Chart has not axile component");
                    }
                    else
                    {
                        AxileBase ab = chart.Component as AxileBase;
                        if (ab == null)
                        {
                            throw new Exception("Chart has not axile component");
                        }
                        else
                        {
                            if (c.Contains(chart) && c.Axile == axile)
                            {
                                throw new Exception("Repeat add axile chart");
                            }
                        }
                    }
                }
            }
            SetChartDrawManager(charts);

            Coordinated co = new Coordinated(axile);

            co.AddRange(charts);
            coordinated.Add(co);

            return(coordinated.Count - 1);
        }