PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Chart with category labels coming from a table
grSourceCategoryLabel (Example)
Chart with category labels coming from a table
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileUser code (UMC)
// Name of chart
sChartName is string = "MyChart"
 
// Define the type of chart
grCreate(sChartName, grColumn)
 
// Destination of chart
grDestinationWnd(sChartName, "", sChartName)
grWndSize(sChartName, 10, 10, 650, 490)
 
// Other texts
sMyFont2 is Font
sMyFont2 = FontCreate("Arial", 9, iNormal)
grAxisTitleFont(sMyChart, sMyFont2)
grLabelFont(sChartName, sMyFont2)
grLegendFont(sChartName, sMyFont2)
 
// Title of the X axis
grAxisTitle(sChartName, "Horizontal Axis Title", grXCoordinate)
 
// Title of the Y axis
grAxisTitle(sChartName, "Vertical Axis Title", grYCoordinate)
 
// Position of legend
grLegend(sChartName, grNone)
 
// Horizontal gridlines
grGridlines(sChartName, True, grXCoordinate)
 
// Display the values
grLabel(sChartName, grShowValue, True)
 
// Series #1
// Color of series
grSeriesColor(sChartName, 1, RGB(228, 182, 45))
 
// Legend for the series
grSeriesLabel(sChartName, 1, "Series 1")
 
// Captions of categories
grSourceCategoryLabel("MyChart", grTableColumn, "table1.Column1")
 
// Spacing between the columns
grColumnSpacing(sChartName, 2)
 
// Example of data
grAddData(sChartName, 1, 7)
grAddData(sChartName, 1, 8)
grAddData(sChartName, 1, 9)
grAddData(sChartName, 1, 14)
 
// Draw the chart
grDraw(sChartName)
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment