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
630
Line Chart 3D or 2D cant get data mappings happening?
posted

I am trying to bind a DataTable to a Line chart. The table is just quarterly figures

Number      QRT
------------     -------
1000            Q1
1001            Q2
1002            Q3
1003            Q4

So I wish to have the 4 series, the code snippit is shown below... any ideas?

 foreach (DataRow dr in dt.Rows)
                    {
                        Series c = new Series();
                        c.Stroke = Brushes.Black;
                        c.Label = dr[1].ToString();
                        c.ChartType = ChartType.Line;
                        c.DataSource = dr;
                        c.Fill = Brushes.Blue;                     
                        c.DataMapping = "ValueX = Number; ValueY = QTR;";
                       
                        Marker seriesMarker = new Marker();
                        seriesMarker.Type = MarkerType.Rectangle;
                        seriesMarker.Foreground = Brushes.Black;
                        seriesMarker.FontSize = 14;

                        xamChart5.Series.Add(c);
                        this.xamChart5.Series[Index].Marker = seriesMarker;
                        Index = Index + 1;
                    }

Parents Reply Children