Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
X - Axis label display customization
posted

I am plotting points in a line chart continuously, reading data from a device every second. This may go upto an hour or more.

i.e, plotting almost 3600 points every hour . The elapsed time/sample number is displayed in the X-Axis label.

After a few minutes of plotting, the X-Axis labels disappear. this is because there is no more space to display them.

 I do not want to use the scroll bar and scaling.

Is it possible to modify label display at runtime ?  For example, if I have a chart display area equivalent to the size of this Text box, then to start with I will display all sample numbers/elapsed time [vertically] like 1 2 3 5 6 ....

After sometime, based on the lenght of X Axis, when some number of points have been plotted, then I will start displaying only selected labels like: 1  5  10   15   20 ......

Again after some number of points are plotted, I will change to 1  10  20  30  40  ....

and then 1  20 40 ..... like this....

Is there a way to do this? 

 

 

 

 

Parents
  • 17605
    posted

    You can try using Scatter chart for this. I've tried:

    DataTable table = new DataTable();

    table.Columns.Add("a", typeof(string));

    table.Columns.Add("x", typeof(int));

    table.Columns.Add("Y", typeof(int));

    table.Rows.Add(new object[ { "a", 10, 20 });

    table.Rows.Add(new object[ { "b", 20, 10 });

    table.Rows.Add(new object[ { "c", 40, 30 });

    this.ultraChart1.ScatterChart.ConnectWithLines = true;

    this.ultraChart1.ScatterChart.Icon = Infragistics.UltraChart.Shared.Styles.SymbolIcon.Circle;

    this.ultraChart1.ScatterChart.IconSize = Infragistics.UltraChart.Shared.Styles.SymbolIconSize.Small;

    this.ultraChart1.ScatterChart.LineAppearance.SplineTension = 0;

    this.ultraChart1.DataSource = table;

    this.ultraChart1.DataBind();

     

    In this case when you want to change the interval that the labels are displayed you can just put:

    this.ultraChart1.Axis.X.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.DataInterval;

    this.ultraChart1.Axis.X.TickmarkInterval = 10;

     

Reply Children