We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Plotting marks vs Student names in Column chart

hi,
i have a list of students and their marks in one subject like Christ-60, Andrey-55 and James-55.
i want to plot a graph on this with names on X-Axis and their Marks on Y-axis.

Please help me in creating this graph.
I am in deep need of this kind of graph.

regards vamsi


1 Reply

SS Sri Subhashini M Syncfusion Team November 28, 2007 08:08 AM UTC

Hi Vamsi,

Thank you for using Syncfusion product.

We can plot the graph with student names on X axes by creating Labels for the ChartPoints. We can display the mark range on Y axes by setting Range values. Kindly review the code snippet.

// Displaying names in X axes
this.chartControl1.PrimaryXAxis.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.UserMode;
this.chartControl1.PrimaryXAxis.Labels.Clear();
this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("Christ", Color.Crimson, new Font("Times New Roman", 13), 0, "", ChartValueType.Custom));
this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("Andrey", Color.Crimson, new Font("Times New Roman", 13), 1, "", ChartValueType.Custom));
this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("James", Color.Crimson, new Font("Times New Roman", 13), 2, "", ChartValueType.Custom));

this.chartControl1.PrimaryYAxis.RangePaddingType = ChartAxisRangePaddingType.None;
this.chartControl1.PrimaryYAxis.Range.Interval = 10;
this.chartControl1.PrimaryYAxis.Range.Min = 10;
this.chartControl1.PrimaryYAxis.Range.Max = 100;

Please take a look at the sample and let me know if its helpful.

http://websamples.syncfusion.com/samples/Chart.Windows/F70073/main.htm


Regards,
Suba



Loader.
Live Chat Icon For mobile
Up arrow icon