Pregunta

Tengo un DUATABLE QUE AGREGUIR A LA TRABAJO EN LA CIERNO DE FOLDOUTE COMO SIGUIENTE Y ASIGUIENTE DATMONTH DATAROW A XAXIS DE LA TRABAJA, QUE ES MES NOMBRES:

                foreach (DataRow dr in dtMD.Rows)
                {

                    DataTable dtMDByName = ocw.GetMDByName(Convert.ToDateTime(txtStartDate.Text), Convert.ToDateTime(txtEndDate.Text), dr["MD"].ToString());

                    if (dtMDByName.Rows.Count > 0)
                    {
                        ChartSeries MDChartSeries = new ChartSeries();
                        MDChartSeries.Name = dtMDByName.Rows[0][1].ToString();
                        MDChartSeries.Type = ChartSeriesType.Line;

                        foreach (DataRow drByName in dtMDByName.Rows)
                        {
                            MDChartSeries.AddItem(Convert.ToDouble(drByName["T"]));

                            radMD.PlotArea.XAxis.DataLabelsColumn = drByName["dtMonth"].ToString();
                        }

                        radMD.ChartTitle.TextBlock.Text = "MDs";
                        radMD.PlotArea.XAxis.AutoScale = true;
                        radMD.Series.Add(MDChartSeries);

                    }
                }

¿Pero aún así se muestra como números en XAXIS, algo que estoy haciendo mal en código anterior?

Incluso si lo hago fuera del segundo bucle i.e siguiente código aún no muestra los nombres de mes:

radMD.PlotArea.XAxis.DataLabelsColumn = "dtMonth";

gracias

¿Fue útil?

Solución

Descubierto que necesita para configurar Autoescale a FALSO y luego agregar bloques de texto de la siguiente manera:

                              radMD.PlotArea.XAxis.AutoScale = true;
                                for (int i = 0; i < dtMDByName.Rows.Count; i++)
                                {
                                    radMD.PlotArea.XAxis[i].TextBlock.Text = dtMDByName.Rows[i][3].ToString();
                                }

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top