Return TypeFunction nameArguments
voidhdsChartPie::Generate(hzChain&,hzHttpEvent*,unsigned int&,)

Declared in file: hzDissemino.h
Defined in file : hdsGenerate.cpp

Function Logic:

0:START 1:hzChain::Printf 2:m_Header 3:_hds_svg_drawText 4:last_x last_y val sofar n 5:n 6:pSlice bSmall items 7:(n+1)==m_nSlices 8:X Y hzChain::Printf 9:sofar deg ang sin X cos Y hzChain::Printf last_x last_y 10:X Y n 11:n 12:pSlice hzChain::Printf _hds_svg_drawText Y 13:m_Footer 14:_hds_svg_drawText 15:items 16: No text

Function body:

void hdsChartPie::Generate (hzChain& Z, hzHttpEvent* pE, unsigned int& nLine)
{
   _hzfunc("hdsChartPie::Generate") ;
   _pie*       pSlice ;
   double      val ;
   double      sofar ;
   double      deg ;
   double      ang ;
   uint32_t    X ;
   uint32_t    Y ;
   uint32_t    last_y = 0;
   uint32_t    last_x = 0;
   uint32_t    n ;
   uint32_t    bSmall ;
   Z.Printf("\n<svg id="%s" height="%d" width="%d" style="background:#%06x;">"        , *m_Id, m_Height, m_Width, m_BgColor) ;
   if (m_Header)
       _hds_svg_drawText(Z, m_Header, m_Width/2,20,m_FgColor,1);
   last_x = m_ccX ;
   last_y = m_ccY - m_Rad ;
   sofar = val = 0.0;
   for (n = 0; n < m_nSlices ; n++)
   {
       pSlice = m_pSlices + n ;
       bSmall = pSlice->m_nValue/m_Total >&eq; 0.5?1:0;
       Z << "\t<path d=""  ;
       if ((n+1)== m_nSlices)
       {
           X = m_ccX ;
           Y = m_ccY - m_Rad ;
           Z.Printf("M %u %u L %u %u A %u %u 0 %d 1 %u %u Z" fill="#%06x"/>\n"   , m_ccX, m_ccY, last_x, last_y, m_Rad, m_Rad, bSmall, X, Y, pSlice->color) ;
       }
       else
       {
           sofar += pSlice->m_nValue ;
           deg = (360*sofar)/m_Total;
           ang = (deg * M_PI)/180;
           X = m_ccX + (m_Rad * sin(ang)) ;
           Y = m_ccY - (m_Rad * cos(ang)) ;
           Z.Printf("M %u %u L %u %u A %u %u 0 %d 1 %u %u Z" fill="#%06x"/>\n"   , m_ccX, m_ccY, last_x, last_y, m_Rad, m_Rad, bSmall, X, Y, pSlice->color) ;
           last_x = X ;
           last_y = Y ;
       }
   }
   X = m_ccX + m_Rad + 40;
   Y = m_ccY - m_Rad ;
   for (n = 0; n < m_nSlices ; n++)
   {
       pSlice = m_pSlices + n ;
       Z.Printf("<rect x="%u" y="%u" width="%u" height="%u" style="fill:#%06x;stroke:#%06x;stroke-width:1"/>\n"          ,
           X, Y, 12,12,pSlice->color,m_FgColor,1);
       _hds_svg_drawText(Z, pSlice->header, X+15,Y+12,m_FgColor,0);
       Y += 20;
   }
   if (m_Footer)
       _hds_svg_drawText(Z, m_Footer, m_Width/2,m_Height - 20,m_FgColor,1);
   Z << "</svg>\n" ;
}