0
votes

I have some questions about Teechart abilities, that i couldn't find in TeeChart Examples.

1) Is it posible to do a static X-axis with different scaled Y-axes, that increase its maximal value when the chart gets the right side of the window with scrolling visible part of current chart to left, with a scroll bar which allows to see history of charting. ( like it made in Welcome !\Chart styles\Standard\Line(Strip)\Realtime charting, but each line has its own axis( axes might have different scale ), X-axis scroll only when charts reaches its rightmost value by some fixed value, and having ability to remote chart to any previos interval of X (like a time window that moves through the time axis )).

2) If first is ok, is it possible to make a special label( like horizontal line with label on the chart) dinamicaly on the chart.

3) If i have a polyline or contour, can i chage a point value by moving it throuhg a field? ( for example in case of interpolation, can i chage Y value by moving it by mouse right on chart at the given interpolation point). are there any special mesages that lets do this? Same question for control points of Bezier curve.

1

1 Answers

1
votes
  1. Yes, you can have multiple custom axes in a chart as explained in tutorial 4 and examples in the All Features\Welcome !\Axes section of the features demo. For the scrolling part you require I recommend the Scroll Pager tool demoed at What's New?\Welcome !\New Chart Tools\ScrollPager Tool. Both tutorials and features demo are available at TeeChart's program group.

  2. I recommend using ColorLine tool combined with Annotation tool for this. An example can be found here. Alternatively you can draw custom text in the chart canvas as in this example:

    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }
    
    private Steema.TeeChart.Tools.ColorLine colorLine1;
    
    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
    
      tChart1.Series.Add(new Steema.TeeChart.Styles.HorizBar()).FillSampleValues();
    
      colorLine1 = new Steema.TeeChart.Tools.ColorLine(tChart1.Chart);
      colorLine1.Axis = tChart1.Axes.Bottom;
      colorLine1.Value = tChart1[0].MinXValue() + (tChart1[0].MaxXValue() - tChart1[0].MinXValue()) / 2;
    
      tChart1.AfterDraw += tChart1_AfterDraw;
    }
    
    void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
    {
      string text = "My custom caption";
      SizeF size = g.MeasureString(g.Font, text);
    
      Rectangle rect = tChart1.Chart.ChartRect;
      int x = tChart1.Axes.Bottom.CalcPosValue(colorLine1.Value) - (int)size.Height;
      int y = rect.Top + (int)size.Width + 5;
    
      g.Font.Color = Color.Red;
    
      g.RotateLabel(x, y, text, 90);
    }
    
  3. There's DragPoint tool for that. See the All Features\Welcome !\Tools\Drag Point example in the features demo. However, using this tool you'll be able to change the points in the source series, not calculated series. Polynomial, Contour and Bezier series/functions are calculated from a given source data. You won't be able to modify those calculated values directly, you'll have to modify source data series so they are recalculated.