How do you title the X and Y axis?
Issue #1
resolved
If you look at the image I attached below:
It displays the graph fine.
It shows the time on the bottom axis (what I want), but it doesnt show any values on the y axis... Also is it possible to add titles to the axis?
Cheers, Stu
Comments (2)
-
reporter -
reporter - changed status to resolved
- Log in to comment
I decided to use a new chart package called chartjs/. Here is a screenshot of Atlasboard with the new graph package:
This installation tutorial assumes you have used my Google analytics tutorial: here
To install this graph package I did the following:
Download and unzip chartjs. * Copy and paste the folder into atlasboard/third-party/ - (for me this was /usr/libnode_modules/atlasboard/assets/third-party)
Include the javascript and CSS file in the dashboard.ejs file This can be found at atlasboard/templates/dashboard.ejs I then inserted this line of code into the <head> tags "<script src="/third-party/chart/Chart.min.js"></script>"
Now you have finished including the chartjs package you need to edit your job and widget files so they use it!
In the widget file (in this demonstration I am using googleanalytics.js)
Append a canvas to the content div and set the height and width depending on how big you need it to be. Parse through the data you grabbed using the job and change colour of line if need be. Make any option changes (e.g. change colour of font etc).
Full code:
Edit the Google Analytics Job
I ran a simple function to grab todays date
This should then display a Google analytics graph using the new chart package.
If I have time over the summer I will try and create an official chart package with a better tutorial.
Hope this helps!