Skip to content

Replies

0
Irakli Machabeli
Irakli Machabeli answered on Oct 1, 2008 3:53 PM

I tried your suggestion.

In this case chart displays  labels of wrong column (instead of column 0 it uses labels from column 1).

By the way is there a possibility to tell chart to plot just say first 100 rows from table?

            DataTable tbl = new DataTable();
            tbl.Columns.Add("Age",typeof(int));
            tbl.Columns.Add("Value",typeof(double ));
            int lcount = 300;
            for( int i = 1; i<lcount; i++)
            {
                DataRow r= tbl.NewRow();
                r["Age"]=i; r["Value"]=Math.Sin(3.14*i/100);
                tbl.Rows.Add( r);
            }

            dgForecasts.DataSource = tbl;
            chartForecasts.DataSource = tbl;

            //chartForecasts.Axis.X.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Percentage;
            //chartForecasts.Axis.X.TickmarkPercentage = 10;
            chartForecasts.Axis.X.Labels.Layout.Behavior =
                Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.None;
            //chartForecasts.Axis.X.Labels.Layout.Behavior =
            //    Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.Auto;
            chartForecasts.Axis.X.TickmarkStyle =
                Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart;
            chartForecasts.Data.RowLabelsColumn = 0;
            chartForecasts.Data.UseRowLabelsColumn = true;
            chartForecasts.DataBind();