Exemplo n.º 1
0
        private void setTitleMultiLineWithFormatedTextToolStripMenuItem_Click(object sender, EventArgs e)
        {
            chart1.TextByFormat.Clear();
            SingleLineText slt = new SingleLineText();

            slt.Add("E_f$ = mc^2", '$', '_', '^');
            chart1.TextByFormat.Add(slt);
            slt = new SingleLineText();
            slt.Add("فرمول", SingleLineText.TextFromBaseLine.Normal, true);
            chart1.TextByFormat.Add(slt);
            configForm.RebindChartConfiguration();
        }
Exemplo n.º 2
0
        public Chart1Form()
        {
            InitializeComponent();

            dtSample = new DataTable("Test");
            dtSample.Columns.Add("X", typeof(Int32));
            dtSample.Columns.Add("12.3", typeof(Double));
            dtSample.Columns.Add("Test", typeof(Int32));

            dtSample.Rows.Add(19, -0.1, 22);
            dtSample.Rows.Add(12, 21.5, 0);
            dtSample.Rows.Add(0, 31.5, 25);
            dtSample.Rows.Add(10, 20, -15);

            dgv.DataSource = dtSample;

            //Events
            lblValue.Text                   = lblItem.Text = "";
            bar1.MouseLeaveAxisArea        += new System.EventHandler(axisComponent_MouseLeaveAxisArea);
            bar1.MouseLocationValueChange  += new AxileBase.MouseLocationValueEventHandler(axisComponent_MouseLocationValueChange);
            bar1.MouseEnterBar             += new Bar.MouseAndItemEventHandler(component_MouseEnterItem);
            bar1.MouseLeaveBar             += new Bar.MouseAndItemEventHandler(component_MouseLeaveItem);
            line1.MouseLeaveAxisArea       += new System.EventHandler(axisComponent_MouseLeaveAxisArea);
            line1.MouseLocationValueChange += new AxileBase.MouseLocationValueEventHandler(axisComponent_MouseLocationValueChange);
            line1.MouseEnterPoint          += new Line.MouseAndItemEventHandler(component_MouseEnterItem);
            line1.MouseLeavePoint          += new Line.MouseAndItemEventHandler(component_MouseLeaveItem);


            chart1.DataMember = Bind.FromDataTable(dtSample);

            chart1.LegendItems.Clear();
            chart1.LegendItems.Add(new SingleLineText("Legend"));
            SingleLineText slt = new SingleLineText();

            slt.Add("E=X_1!Y^2!Z", '!', '_', '^');
            chart1.LegendItems.Add(slt);
            chart1.LegendItems.Add(new SingleLineText("123"));
            slt = new SingleLineText();
            slt.Add("فارسی", SingleLineText.TextFromBaseLine.Normal, true);
            chart1.LegendItems.Add(slt);

            list = new List <BaseChartComponent>();
            list.Add(bar1);
            list.Add(line1);

            lblNearset.Text = "";
        }
Exemplo n.º 3
0
        private void Draw(PaintEventArgs e, float x, float y, bool fixedHeight)
        {
            SingleLineText slt = new SingleLineText("");

            slt.Add("One x_1$ Two^2$", '$', '_', '^');
            slt.Add("خیاط", SingleLineText.TextFromBaseLine.Normal, true);
            slt.Add("One x_1$ Two^2$ ", '$', '_', '^');

            SingleLineText slt2 = new SingleLineText("");

            slt2.Add("خیاط", SingleLineText.TextFromBaseLine.Normal, true);

            SingleLineText slt3 = new SingleLineText("");

            slt3.Add("Ali", SingleLineText.TextFromBaseLine.Normal, false);

            Font f = new Font("Tahoma", 16);

            SizeF sz = slt.MeasureString(e.Graphics, f, fixedHeight);

            slt.DrawString(e.Graphics, f, Brushes.Black, x, y, fixedHeight);
            if (chbxAreaLine.Checked)
            {
                e.Graphics.DrawRectangle(Pens.Red, x, y, sz.Width, sz.Height);
            }
            y += sz.Height;

            sz = slt2.MeasureString(e.Graphics, f, fixedHeight);
            slt2.DrawString(e.Graphics, f, Brushes.Black, x, y, fixedHeight);
            if (chbxAreaLine.Checked)
            {
                e.Graphics.DrawRectangle(Pens.Red, x, y, sz.Width, sz.Height);
            }
            y += sz.Height;

            sz = slt3.MeasureString(e.Graphics, f, fixedHeight);
            slt3.DrawString(e.Graphics, f, Brushes.Black, x, y, fixedHeight);
            if (chbxAreaLine.Checked)
            {
                e.Graphics.DrawRectangle(Pens.Red, x, y, sz.Width, sz.Height);
            }
            y += sz.Height;
        }