Teechart Common Programming Statement Summary (C #)

Source: Internet
Author: User

I am using C # from the Internet to see the copy of the document come in and learn together:
    • Set Chart title: AxTChart1.Header.Text.Add ("title");
    • Modified title: AxTChart1.Header.Text.set_Item (Index, "modified title");
    • Header Header clear: AxTChart1.Header.Text.Clear ();
    • Remove the first n (int) headings: axTChart1.Header.Text.Remove (1);
    • Title centered: AxTChart1.Header.Alignment = TeeChart.ETitleAlignment.taCenter;
    • The title moves right 50:axtchart1.header.customposition = true;

axtchart1.header.left= AxTChart1.Header.Left + 50;

    • Title background: axTChart1.Header.Transparent = false;//background opaque

AxTChart1.Header.Brush.Style = teechart.ebrushstyle.bsbackcrosssmall;//background style

    • Title Background shadow color: AxTChart1.Header.Transparent = false;

Axtchart1.header.shadowcolor= (UINT) (1255);

Description (Legend):

    • Description is visible: AxTChart1.Legend.Visible = true;
    • Whether the split line is visible in the description box: AxTChart1.Legend.DividingLines.Visible = true;
    • Description box Split Line color: axtchart1.legend.color= (UINT) (2201);
    • Description box downward Shift (volume): TChart1.Legend.TopPos =50
    • Length of the illustration in the Description box: AxTChart1.Legend.ColorWidth = 150;
    • Text color in Description box: AxTChart1.Legend.Font.Color = (UINT) (130000);
    • Color and depth of the shaded section of the Description box: axtchart1.legend.shadowcolor= (UINT) (13000);

AxTChart1.Legend.ShadowSize = 6;

Panels (panel):

    • Loading panel background Image: AxTChart1.Panel.BackImageLoad (@ "e:\121.jpg");
    • Panel Tilt Settings:
?
1234 axTChart1.Panel.Gradient.Visible = true;axTChart1.Panel.Gradient.StartColor = (uint)(1);axTChart1.Panel.Gradient.EndColor = (uint)(13000);axTChart1.Panel.Gradient.Direction = TeeChart.EGradientDirection.gdFromTopLeft;

3D Effect:

    • Hide 3D effect: AxTChart1.Aspect.View3D = false;

Chart pagination:

    • Run-Time Display charteditor dialog box: Axtchart1.showeditor ();
    • The maximum number of points that can be displayed per page: AxTChart1.Page.MaxPointsPerPage = 20;
    • Next && Previous page (you need to set a button to do it): AxTChart1.Page.Next ();

AxTChart1.Page.Previous ();

    • Skip to the last page: AxTChart1.Page.Current = AxTChart1.Page.Count;
    • Decide on the last page to shrink: AxTChart1.Page.ScaleLastPage = false;
    • Get current page: MessageBox.Show (axTChart1.Page.Current.ToString ());

Coordinates (AXIS):

    • Add 20 points to a sequence:?
      1234567 for(int i = 1; i <= 20; i++) { axTChart1.Series(1).Add(i*i, i.ToString(), (uint)(50000));}
    • Set axis scale (Y-axis is axis.left, x-axis is Axis.bottom)
    • Set the end and start point of the y-axis, minimum scale value:
?
1234 axTChart1.Axis.Left.Automatic = false;//必须有,或者用.AutomaticMaximum等代替axTChart1.Axis.Left.Maximum = 600;//最大值的声明必须在最小值先,否则报错axTChart1.Axis.Left.Minimum = 500;axTChart1.Axis.Left.Increment = 20;
    • Fixed y-axis minimum, maximum automatic growth: fatal error
    • The maximum y-axis is fixed and the minimum value is automatically:
?
123 axTChart1.Axis.Left.AutomaticMaximum = false;axTChart1.Axis.Left.Maximum = 600;axTChart1.Axis.Left.AutomaticMinimum = true;

(* Conclusion: When setting the maximum minimum value, setting the minimum value will fail if the maximum value is not set)

Custom axis labels (add axis events):

?
123 privatevoid axTChart1_OnGetAxisLabel(object sender, AxTeeChart.ITChartEvents_OnGetAxisLabelEvent e) {e.labelText = "p"+ e.valueIndex.ToString();}

To set the Axis custom label:

?
1234 axTChart1.Axis.Left.Logarithmic = true;axTChart1.Axis.Left.Increment = 0;//默认为0axTChart1.Axis.Left.SetMinMax(0, 10000);axTChart1.Axis.Left.Labels.ValueFormat = "#e+0";

Custom Cross axes: can only be set in the chart editor.

Axis Click event :

?
12345 privatevoid axTChart1_OnClickAxis(object sender, AxTeeChart.ITChartEvents_OnClickAxisEvent e){MessageBox.Show(axTChart1.Axis.Bottom.CalcPosPoint(e.x).ToString());//显示位置}

Series:

    • Delete 5th point (starting from 0): axtchart1.series (0). Delete (5);
    • Add a coordinate: axtchart1.series (0). Addnull ("label");
    • Add a series:
?
1234 TeeChart.ESeriesClass ns = newTeeChart.ESeriesClass();intindex = axTChart1.AddSeries(ns);axTChart1.Series(index).HorizontalAxis = TeeChart.EHorizontalAxis.aTopAxis;axTChart1.Series(index).VerticalAxis = TeeChart.EVerticalAxis.aRightAxis;
    • Set the data source for Series1 to Series0:
?
12 axTChart1.Series(1).DataSource = "Series0";axTChart1.Series(1).SetFunction(TeeChart.EFunctionType.tfCopy);
    • Exchange the order of two series:
?
1 axTChart1.ExchangeSeries(0, 1); //After exchanging Series, the index for the Series will be changed.
    • Displays the Y value of the third position: MessageBox.Show (axtchart1.series (0). Yvalues.get_value (3). ToString ());
    • Modify the Y value of the 9th position to 21:axtchart1.series (0). Yvalues.set_value (int. Parse (9,21);
    • Move the coordinates of the first position to the x-axis forward 5 coordinates: axtchart1.series (0). Xvalues.set_value (5,9);
    • Clear drawing: Axtchart1.series (0). Clear ();
    • Clear scale: AxTChart1.Axis.Visible = false;
    • Clear the bottom scale: axTChart1.Axis.Bottom.Visible = false;
    • Margin and left distance 20%: AxTChart1.Panel.MarginLeft = 20;

Teechart Common Programming Statement Summary (C #)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.