dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: [RESOLVED] Circle Color Palette Pie Chart

  1. #1
    Join Date
    Nov 2011
    Location
    India
    Posts
    308

    [RESOLVED] Circle Color Palette Pie Chart

    Hi,

    I don't know how to create Circle Color Palette Pie Chart.
    I refer this project,Create-2d-pie-chart
    Using this example, i tried like this,
    Code:
    int deta;
    	for(int i=0; i<=255; i++)
    	{
    		for(int j=0; j<=255; j++)
    		{
    			for(int k=0; k<=255; k++)
    			{			
    				//deta = (no.of.obj / tot no of obj ) * 360;
    				deta = i*j*k;
    				deta = deta /(255*255*255);
                                    deta = deta * 360;
    		
    				m_pGraphObject1->Add2DPieGraphSegment(deta, RGB(i,j,k), "" );
    			}
    		}
    	}
    Not working.
    Regards,

    SaraswathiSrinath

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,562

    Re: Circle Color Palette Pie Chart

    1. the link you have provided does not work.
    2. The code you have posted does not make much sense:
    the deta will equal 360 if i == j == k == 255 and zero for any other i,j,k combination.
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2011
    Location
    India
    Posts
    308

    Re: Circle Color Palette Pie Chart

    Quote Originally Posted by VictorN View Post
    1. the link you have provided does not work.
    www . u can code . net / Visual_C_MFC_Samples / Create-2d-bar-line-pie-chart-vc-example.htm

    can not put this link inside url tag. remove the space and use.

    Quote Originally Posted by VictorN View Post
    2. The code you have posted does not make much sense:
    the deta will equal 360 if i == j == k == 255 and zero for any other i,j,k combination.
    yes. i don't know how to pass float value in that example.
    Last edited by saraswathisrinath; September 19th, 2015 at 03:38 AM.
    Regards,

    SaraswathiSrinath

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,562

    Re: Circle Color Palette Pie Chart

    Quote Originally Posted by saraswathisrinath View Post
    ...
    i don't know how to pass float value in that example.
    Then learn how to do it. Or, at least ask the author of the example!
    Victor Nijegorodov

  5. #5
    Join Date
    Nov 2011
    Location
    India
    Posts
    308

    Re: Circle Color Palette Pie Chart

    Quote Originally Posted by VictorN View Post
    Then learn how to do it. Or, at least ask the author of the example!
    i changed the methods to pass double value instead of int. Wrong display faced. Step by step analysed then found when angle's percentage reached 1.15%, pie chart segment/slice reaches 100%. so only ploted 1.15% out of 100%.

    here s_percent = 1.15%, then AddSegment() method reaches 100%.
    Code:
    Add2DPieGraphSegment(double s_percent, COLORREF s_color, CString s_text);
    no mail id provided to ask the author of the example.

    Pls clear the below details,

    1. To plot Color Palette Pie Chart, how many colors needed.(Angle = 360, 360 colors or 255x255x255 -RGB)
    2. if needed 255x255x255 colors, is possible to plot too much slices (255x255x255) in a pie chart?
    3. If yes, is it take long time?. Else how to plot?

    Suggest any ideas to plot H vs S circle pie chart using RGB colors.
    Regards,

    SaraswathiSrinath

  6. #6
    Join Date
    Nov 2011
    Location
    India
    Posts
    308

    Re: Circle Color Palette Pie Chart

    I thought pie chart is the only way to plot the color wheel. But i found GDI+ and plotted the color wheel - GDI + Color Wheel.jpg, Using GDI+ Lineto(), Moveto() methods i plotted the GDI + Color Wheel.jpg. Here Every line contains single RGB Value. Kindly find the attachment.

    But i want to plot the wheel like Requirement.jpg. Here, Every point contains individual RGB Value. How is possible.
    Attached Images Attached Images   
    Regards,

    SaraswathiSrinath

  7. #7
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Circle Color Palette Pie Chart

    in the top image, the values towards the middle have higher saturation levels.

    this is essentially polar coordinates. the hue is the angle (0..255) from the zero line
    and the saturation is the relative distance (0..255) from the middle.

    in these color wheels, luminance is typically the same overall.

  8. #8
    Join Date
    Nov 2011
    Location
    India
    Posts
    308

    Re: Circle Color Palette Pie Chart

    Quote Originally Posted by OReubens View Post
    in the top image, the values towards the middle have higher saturation levels.

    this is essentially polar coordinates. the hue is the angle (0..255) from the zero line
    and the saturation is the relative distance (0..255) from the middle.

    in these color wheels, luminance is typically the same overall.
    i like to plot HSL color Wheel (or HSV )like

    1. Hue Vs Saturation and,
    2. Hue Vs Luminance.

    i tried, but i don't know, where i locked.
    Pls help me. Kindly find the attchment.
    Attached Files Attached Files
    Last edited by saraswathisrinath; September 29th, 2015 at 04:08 AM.
    Regards,

    SaraswathiSrinath

  9. #9
    Join Date
    Nov 2011
    Location
    India
    Posts
    308

    Re: Circle Color Palette Pie Chart

    Finally i plotted

    Error found - i calculate, the points X, Y from x origin & y origin points & radius.

    same radius used to find the circle's inside points.

    Now problem solved.
    Regards,

    SaraswathiSrinath

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)