Skip to content

Instantly share code, notes, and snippets.

@zsan
Last active April 22, 2021 22:23
Show Gist options
  • Save zsan/fb6462ace9798c35ace2595cf15e536e to your computer and use it in GitHub Desktop.
Save zsan/fb6462ace9798c35ace2595cf15e536e to your computer and use it in GitHub Desktop.
<%= area_chart @campaigns.map { |campaign|
{
name: campaign.name,
data: campaign.jump.ahoy_events.joins(:visit).group_by_day(:started_at).count,
library: {
lineTension: 0.5,
borderWidth: 2,
# borderColor: "yellow",
borderCapStyle: "square",
borderJoinStyle: "bevel",
borderDashOffset: 0.1,
# borderDash:
# pointBorderColor: "red",
# pointBackgroundColor: "blue",
# pointBorderWidth: 20,
# pointRadius: 5,
# pointHoverRadius: "10",
# pointHitRadius: "20",
# pointHoverBackgroundColor: "white",
# pointHoverBorderColor: "black",
# pointHoverBorderWidth: 10,
pointStyle: "circle",
showLine: true,
spanGaps: false,
steppedLine: false
}
}
}, library: {
chart: { tension: 0 },
title: { display: true, text: "BASED ON VISITS" },
legend: {
display: true,
labels: {
fontColor: 'rgb(255, 99, 132)'
}
},
elements: {
line: {
border_width: 20,
border_color: '#fff'
}
},
tooltips: {
enabled: true,
mode: 'label'
}
}
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment