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 |
private void 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; //默认为0 axTChart1.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 |
private void 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 = new TeeChart.ESeriesClass(); int index = 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 #)