Home Forums WinForms controls Xceed Chart for WinForms DataZoomTool & axis ticks scale

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19096 |

    I’m using DataZoomTool, but after zoom in, ticks on axis are not changed. For example, for 100% zoom I want just say 5 major ticks. But after zoom in, I need axis ticks for that zoom area. How can I achieve it?

    Imported from legacy forums. Posted by Igor (had 4057 views)

    User (Old forums)
    Member
    Post count: 23064

    The major ticks should zoom along the chart.  This is the default behavior.  Have you change a property on the DataZoomTool?  How do you set up your chart?

    You can try the following code, to see that the major ticks zoom fine :

    using Xceed.Chart;
    using Xceed.Chart.Core;

        private void Form1_Load( object sender, EventArgs e )
        {
          ChartControl chartControl1 = new ChartControl();
          this.Controls.Add( chartControl1 );
          chartControl1.Dock = DockStyle.Fill;

          chartControl1.InteractivityOperations.Add( new DataZoomTool() );

          Chart chart = chartControl1.Charts[ 0 ];

          LineSeries line = ( LineSeries )chart.Series.Add( SeriesType.Line );

          line.Add( 100 );
          line.Add( 200 );
          line.Add( 500 );
          line.Add( 300 );
          line.Add( 800 );
          line.Add( 700 );
          line.Add( 400 );
          line.Add( 900 );
          line.Add( 600 );
        }

     

    Imported from legacy forums. Posted by André (had 355 views)

    User (Old forums)
    Member
    Post count: 23064

    I set the DataZoomTool as follows:

    MinVertPageSize = 200      // to zoom only on X

    HorizontalAxisId = (int) StandardAxis.PrimaryX

    VerticalAxisId = (int) StandardAxis.PrimaryY

     

    and the axis:

    Axis( StandardAxis.PrimaryX ).NumericScale.Min = 360;

    Axis( StandardAxis.PrimaryX ).NumericScale.Max = 940;

    Axis( StandardAxis.PrimaryX ).NumericScale.AutoMax = false;

    Axis( StandardAxis.PrimaryX ).NumericScale.AutoMin = false;

     

    Also, I use it together with the DataPanTool.

    Imported from legacy forums. Posted by Igor (had 2409 views)

    User (Old forums)
    Member
    Post count: 23064

    I’ve solved it via ZoomDataTool.EndDrag and setting MaxTickCount. For the correct value to calculate I’ve used Ruler.PageSize.

    Imported from legacy forums. Posted by Igor (had 597 views)

    User (Old forums)
    Member
    Post count: 23064

    I still could not reproduce this with the settings you use, but I’m glad you found a solution for your issue.

    Imported from legacy forums. Posted by André (had 3628 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.