Once data is pulled from the database, same will be sent to the HighCharts in JSON
notation.
CLI reports use following files to do that:
- <cli-reports-installation-folder>/types/<report-chart-type-folder>/template.html
- <cli-reports-installation-folder>/types/<report-chart-type-folder>/script
-
Create a folder (with a meaningful name) anywhere in the file system.
For example, create one in your home directory:
/home/userid/. Let's refer to the newly created folder
as myNewChartType folder (located at:
/home/userid/myNewChartType).
-
Create following files inside myNewReport folder:
README (optional), script and
template.html.
Tip: You can either create those files afresh or copy any existing
chart type files (from any immediate child folder under
<cli-reports-installation-folder>/types
folder) and edit them appropriately for your new chart type. The latter
approach is recommended.
-
Note: You can use dummy data and make use of fiddle.net to arrive at the required
HighCharts configuration.
Edit the script file.
This file gets the data pulled from the database and does the post processing,
if required. It then uses the template.html to generate the
final chart rendering HTML/JavaScript content.
-
Add the files to the repository. In TeamForge, custom chart types can be added
to the CLI reports by committing the chart type files into the 'branding'
repository.
-
Assuming you had already checked out the 'branding' repository under
<workspace-folder>/branding folder, run the
following command.
- cd <workspace-folder>/branding
-
Create a folder cli/custom-reports/types/.
- mkdir -p cli/custom-reports/types/
-
Copy myNewChartType folder to
cli/custom-reports/types/ svn add
cli/custom-reports/types/.
-
Run the following commands.
- svn add cli/custom-reports/types/
- svn commit -m “adding a new chart
type”
- If the commit was successful, you should be able to use the new chart
type in any of the report.
- Note that the chart type for a report is configured via “outputType” key
in
<workspace-folder>/branding/cli/custom-reports/pkg/<report-folder>/config.ini
file.
- Note that the report you committed into 'branding' repository will be
automatically checked out and added to the CLI reports.
- You can find the installed version of the checked in files under
<cli-reports-installation-folder>/../../cli/custom-reports/.