Skip to content
Snippets Groups Projects
Commit 6d07a974 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

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

parent 3fba2114
No related branches found
No related tags found
No related merge requests found
@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)
Loading
@@ -31,11 +31,6 @@
Loading
@@ -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);
}) })
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment