BigW Consortium Gitlab

Commit 6d07a974 by Dmitriy Zaporozhets

move js code related to repo barchart to chart.js.coffee

parent 3fba2114
@Chart =
labels: []
values: []
init: (labels, values, title) ->
r = Raphael('activity-chart')
r.text(160, 10, title).attr font: "13px sans-serif"
r.barchart(
10, 10, 400, 160,
[values],
{colors:["#456"]}
).label(labels, true)
...@@ -31,11 +31,6 @@ ...@@ -31,11 +31,6 @@
$(function(){ $(function(){
var labels = [#{@graph.labels.to_json}]; var labels = [#{@graph.labels.to_json}];
var commits = [#{@graph.commits.join(', ')}]; var commits = [#{@graph.commits.join(', ')}];
var r = Raphael('activity-chart'); var title = "Commit activity for last #{@graph.weeks} weeks";
r.text(160, 10, "Commit activity for last #{@graph.weeks} weeks").attr({ font: "13px sans-serif" }); Chart.init(labels, commits, title);
r.barchart(
10, 10, 400, 160,
[commits],
{colors:["#456"]}
).label(labels, true);
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment