2

I have created a Chart control based visual webpart. I have used custom labels for both x and y axis. The problem when i am trying to plot xy values, it is not visible in the chart.

enter image description here

Code

    chart1.Series["Series1"].ChartType = SeriesChartType.Bar;
    chart1.Series["Series1"]["PointWidth"] = "0.6";

    foreach(string x in axisXValues)
    {
         clabelX = new CustomLabel(xpos, xpos + 1, x, 0, LabelMarkStyle.None);
         chart1.ChartAreas[0].AxisX.CustomLabels.Add(clabelX);
         xpos++;
    }

    foreach (DataRow r in dt.Rows)
    {
        string c=r[0].ToString();
        string s=r[1].ToString();
        chart1.Series["Series1"].Points.AddXY(c,s);
    }

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.