Click here to Skip to main content
15,868,058 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Day,
I want a help to figure how I can implement C# Chart Control to draw an Image Histogram

My question is how to make x-axis reflect the series of the char (Intensity level count.
Current situation is
Y-axis represents the P(r)
Chart Series (0 - 255) represents counting of pixels at each intensity level.
Range of X-axis is (0 - 255)

Problem is when draw the chart Series does not places on the correct range of x-axis

Please your advise is appreciated


C#
Random random = new Random();

           // Add series.
           for (int i = 0; i < 255; i++)
           {
               // Add series.
               Series series = this.chart1.Series.Add(i.ToString());

               // Add point.
               series.Points.Add(random.Next(1, 700));
           }

   //Series represent the intensity levels (0 - 255)
   // Points represent counting how many pixels at each intensity
Posted
Updated 9-Feb-14 9:45am
v2
Comments
DaveAuld 9-Feb-14 14:15pm    
What code have you tried? Update your question with the code, there may be a bug in what you have done.
TnTinMn 11-Feb-14 11:50am    
Download - Samples Environment for Microsoft Chart Controls
http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418
Load "WinFormsChartSamples.sln" and run it.
In the application, under the "Contents" tab, open "Data Distribution Charts" and then select Histogram. This will help teach you how to create one.
Stevea2000 12-Feb-14 23:03pm    
Thanks, I already went through that. As I showed, my misunderstanding simply is how to draw the series as x axis

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900