Documentation ¶
Index ¶
Constants ¶
const ( //OutDirMode is the file mode of the directory //to which output artifacts will be written OutDirMode = 0777 //OutDir is the path to the directory //(absolute or relative to the analyst executable) //to which output artifacts will be written OutDir = "../out" )
Variables ¶
This section is empty.
Functions ¶
func BuildBarChart ¶
func BuildBarChart(chartable BarChartable) (string, error)
BuildBarChart creates a bar chart from the given chartdata, exports it to PNG, saves it to the outDir (according to the given chart name) and returns the path to the png.
func BuildPDF ¶
func BuildPDF(sections ...PDFSection) error
BuildPDF creates a PDF file
*with the given PDFSections. *The resulting PDF will be written to the *outDir directory.
Types ¶
type BarChartable ¶
type BarChartable interface { GetOrderedBarChartValues() BarChartableValuesOrdered SetTitle(string) // Should raise an error if title is empty Title() string }
BarChartable must be implemented by any type that will be used as the chartdata input of a BarChart generator.
type BarChartableValue ¶
BarChartableValue Is a value containing a label and value which can be transformed into a printable bar of a bar chart.
type BarChartableValuesOrdered ¶
type BarChartableValuesOrdered []BarChartableValue
BarChartableValuesOrdered is a slice of structs that will be generated by a GetBarChartValues() method implementation of any struct that implements BarChartable. The bars will be rendered on the order of appearance in this slice.
type PDFSection ¶
PDFSection describes a
*standardized section of the *analytics report PDF to be generated. *Each section consitst of a title, a description *and a number of charts. *In the document each section will be presented *in this order, (i.e. first the title, then the description then the charts), *whereas the charts (within one section) *will be printed below each other with nothing inbetween.