PC SOFT
DEPOT EN LIGNE
POUR WINDEVWEBDEV ET WINDEV MOBILE

WD Chart Age Pyramid - Grafico Histograma Piramede
Publié par Boller
dans la catégorie Outils
Nouveautés



Description
WD Chart Age Pyramid - Grafico Histograma Piramede

// Summary: Calling the various "gr" functions of the control template to create the first example of age pyramid (fictitious data)
// Syntax:
//DrawPyramidExampleOneSeries ()
//
// Parameters:
// None
// Return value:
// None

PROCEDURE DrawPyramidExampleOneSeries()

//********************************TITLE OF THE CHART********************************//

fntFontTitle is Font
fntFontTitle = FontCreate("Trebuchet MS", 14, iBold, iBlack)
CTPL_AgePyramid.grTitleFont(fntFontTitle)
CTPL_AgePyramid.grTitle("POPULATION IN FRANCE",grAtTop)


//********************************TITLES FOR THE MEN AND WOMEN SIDES********************************//

//Defines the title for each side of the age pyramid: "Men" and "Women" in most cases
fntFontGenderTitle is Font
fntFontGenderTitle = FontCreate("Trebuchet MS", 10, iBold, RGB(0,129,145))
CTPL_AgePyramid.grFontGenderTitle(fntFontGenderTitle)
CTPL_AgePyramid.grGenderTitles("MEN", "WOMEN")


//********************************SERIES********************************//

//Defines the series of the chart for the men and for the women
//They are coming from an array
CTPL_AgePyramid.grSourceSeries(CTPL_AgePyramid.MEN, 1, grTable, "garrMenSeries")
CTPL_AgePyramid.grSourceSeries(CTPL_AgePyramid.WOMEN,1, grTable, "garrWomenSeries")

//Color for the chart on the series 1 (there is only one in this simple example), Men and Women side
CTPL_AgePyramid.grSeriesColor(1, RGB(18,137,169))


//********************************LEGEND********************************////

fntLegendFont is Font
fntLegendFont = FontCreate("Trebuchet MS", 8, iNormal, iBlack)
CTPL_AgePyramid.grLegendFont(fntLegendFont)
CTPL_AgePyramid.grSeriesLabel(1,"Active population")
CTPL_AgePyramid.grLegend(grAtBottom)


//********************************AXES********************************//
//Defines the interval between the marks on the X and Y axes
CTPL_AgePyramid.grGraduate(100, grXCoordinate)
CTPL_AgePyramid.grGraduate(5, grYCoordinate)

//Defines the title of the horizontal axis (men and women side .. the same information is represented on both sides)
fntFontAxisTitle is Font
fntFontAxisTitle = FontCreate("Trebuchet MS", 7, iNormal, iBlack)
CTPL_AgePyramid.grAxisTitleFont(fntFontAxisTitle)
CTPL_AgePyramid.grAxisTitle("Total strength in thousands", grXCoordinate)
CTPL_AgePyramid.grAxisTitle("Ages", grYCoordinate)


//********************************CONFIGURE THE CHART: STYLE, TOOLTIP.. ********************************//

//Horizontal and vertical gridlines
CTPL_AgePyramid.grGridlines(True)
CTPL_AgePyramid.grGridlines(True, grYCoordinate)

//Color of the gridlines and color of the axes
CTPL_AgePyramid.grColor(grColorGridlines, DarkGray)
CTPL_AgePyramid.grColor(grColorAxis, DarkGray)

//No raised effect
CTPL_AgePyramid.grRaised(0)

//No gradient on the bars
CTPL_AgePyramid.grGradient(False)

//Defines the category labels .. for our age pyramid, it corresponds to the display of the marks on the y-coordinate axis
CTPL_AgePyramid.grSourceCategoryLabel(grTable, "garrCategoryLabel")

//Actual drawing of the chart
CTPL_AgePyramid.grDraw()



//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

// Summary: Calling the various "gr" functions of the control template to create the second example of age pyramid (fictitious data)
// Syntax:
//DrawPyramidExampleTwoSeries ()
//
// Parameters:
// None
// Return value:
// None

PROCEDURE DrawPyramidExampleTwoSeries()

//********************************TITLE OF THE CHART********************************//

fntFontTitle is Font
fntFontTitle = FontCreate("Trebuchet MS", 12, iBold + iUnderlined , Black)
CTPL_AgePyramid.grTitleFont(fntFontTitle)
CTPL_AgePyramid.grTitle("Age pyramid (France vs Europe)",grAtBottom)


//********************************TITLES FOR THE MEN AND WOMEN SIDES********************************//

//Defines the title for each side of the age pyramid: "Men" and "Women" in most cases
fntFontGenderTitle is Font
fntFontGenderTitle = FontCreate("Trebuchet MS", 10, iNormal, Black)
CTPL_AgePyramid.grFontGenderTitle(fntFontGenderTitle)
CTPL_AgePyramid.grGenderTitles("Men", "Women", grAtBottom)


//********************************SERIES********************************//

//Defines the series of the chart for the men and for the women
//They are coming from a HFSQL file
CTPL_AgePyramid.grSourceSeries(CTPL_AgePyramid.MEN, 1, grItem, "Population","NbMenFrance")
CTPL_AgePyramid.grSourceSeries(CTPL_AgePyramid.WOMEN,1, grItem, "Population","NbWomenFrance")
CTPL_AgePyramid.grSourceSeries(CTPL_AgePyramid.MEN, 2, grItem, "Population","NbMenEurope")
CTPL_AgePyramid.grSourceSeries(CTPL_AgePyramid.WOMEN,2, grItem, "Population","NbWomenEurope")

//Color for the chart on the series 1 (there is only one in this simple example), Men and Women side
CTPL_AgePyramid.grSeriesColor(1, RGB(254,153,0))
CTPL_AgePyramid.grSeriesColor(2, RGB(219,117,182))


//********************************LEGEND********************************////

fntLegendFont is Font
fntLegendFont = FontCreate("Trebuchet MS", 8, iNormal, iBlack)
CTPL_AgePyramid.grLegendFont(fntLegendFont)
CTPL_AgePyramid.grSeriesLabel(1,"France")
CTPL_AgePyramid.grSeriesLabel(2,"Europe")
CTPL_AgePyramid.grLegend(grAtRight)


//********************************AXES********************************//
//Defines the interval between the marks on the X and Y axes
CTPL_AgePyramid.grGraduate(0.1, grXCoordinate)
CTPL_AgePyramid.grGraduate(5, grYCoordinate)

//Defines the title of the horizontal axis (men and women side .. the same information is represented on both sides)
fntFontAxisTitle is Font
fntFontAxisTitle = FontCreate("Trebuchet MS", 8, iNormal, iBlack)
CTPL_AgePyramid.grAxisTitleFont(fntFontAxisTitle)
CTPL_AgePyramid.grAxisTitle("In % of the total population", grXCoordinate)
CTPL_AgePyramid.grAxisTitle("Ages", grYCoordinate)


//********************************CONFIGURE THE CHART: STYLE, TOOLTIP.. ********************************//

//Horizontal and vertical gridlines
CTPL_AgePyramid.grGridlines(True, grXCoordinate)
CTPL_AgePyramid.grGridlines(False, grYCoordinate)

//Color of the gridlines and color of the axes
CTPL_AgePyramid.grColor(grColorGridlines, DarkGray)
CTPL_AgePyramid.grColor(grColorAxis, DarkGray)

//No raised effect
CTPL_AgePyramid.grRaised(0)

//Gradient on the bars
CTPL_AgePyramid.grGradient(True)

//Defines the category labels .. for our age pyramid, it corresponds to the display of the marks on the y-coordinate axis
CTPL_AgePyramid.grSourceCategoryLabel(grTable, "garrCategoryLabel")

//Actual drawing of the chart
CTPL_AgePyramid.grDraw()




//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

// Summary: <specify the action of the procedure>
// Syntax:
//GenerateDataPyramid1 (<arrSeries>)
//
// Parameters:
// arrSeries: <specify the role of arrSeries>
// Return value:
// None
//
// Example:
// Indicate an example.
//
PROCEDURE GenerateDataPyramid1(arrSeries)


FOR i = 1 TO 35
ArrayAdd(arrSeries, Random(300, 400))
END
FOR i = 35 TO 60
ArrayAdd(arrSeries, Random(400, 480))
END
FOR i = 60 TO 70
ArrayAdd(arrSeries, Random(200, 300))
END
FOR i = 70 TO 80
ArrayAdd(arrSeries, Random(180, 220))
END
FOR i = 80 TO 90
ArrayAdd(arrSeries, Random(80, 150))
END
FOR i = 90 TO 95
ArrayAdd(arrSeries, Random(15, 50))
END
FOR i = 95 TO 100
ArrayAdd(arrSeries, Random(0, 5))
END
Illustrations, copies d'écran
none
none
Avis des utilisateurs
(Pour noter la ressource, cliquez sur Ecrire un avis)
Aucun avis ou commentaire ? Soyez le premier !