CODIGO PARA FAZER GRAFICO VIA CODIGO
// Summary: Fills the initial chart
// Syntax:
//FillChart ()
//
// Parameters:
// None
// Return value:
// None
//
Procedure ExibeGrafico()
// Delete the data from the previous chart
grDeleteSeries(CHART_Chart)
// Define the colors
grWaterfallColor(CHART_Chart, grTotal, RGB(83,129,179))
grWaterfallColor(CHART_Chart, grSubTotal, RGB(83,129,179))
grWaterfallColor(CHART_Chart, grPositive, RGB(115,179,83))
grWaterfallColor(CHART_Chart, grNegative, RGB(179,84,92))
// TO 2012
grAddData(CHART_Chart, 1, 1, 298)
grCategoryLabel(CHART_Chart, 1, "TO 2011")
//grWaterfallCategoryType(CHART_Chart, 1, grTotal)
// Add the profits
grAddData(CHART_Chart, 1, 2, 420)
grCategoryLabel(CHART_Chart, 2, "Profits"+CR+"products")
grAddData(CHART_Chart, 1, 3, 210)
grCategoryLabel(CHART_Chart, 3, "Profits"+CR+"services")
// Costs
grAddData(CHART_Chart, 1, 4, -170)
grCategoryLabel(CHART_Chart, 4, "Costs"+ CR +"fixed")
grAddData(CHART_Chart, 1, 5, -140)
grCategoryLabel(CHART_Chart, 5, "Costs" + CR + "variables")
// TO 2013
grAddData(CHART_Chart, 1, 6, 0)
grCategoryLabel(CHART_Chart, 6, "TO 2012")
grWaterfallCategoryType(CHART_Chart, 6, grTotal)
gnNbCategories = 6
// Draw the chart in the Chart control
grDraw(CHART_Chart)
Nenhum comentário:
Postar um comentário