Skip to content

Commit

Permalink
Add absolute value in tooltip for pie chart
Browse files Browse the repository at this point in the history
  • Loading branch information
klikstermkd authored Dec 22, 2016
1 parent 691c4c6 commit 9c70df6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ckanext/c3charts/fanstatic/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ this.ckan.views.c3charts = this.ckan.views.c3charts || {};
var chartContainer = $(elementId).parent();
var width = chartContainer.attr('data-graph_width');
var height = chartContainer.attr('data-graph_height');
var tooltip = {};

if (chart_type === 'pie') {
tooltip = {
format: {
value: function (value, ratio, id, index) { return value; }
}
}
}

return {
size: {
Expand Down Expand Up @@ -204,7 +213,8 @@ this.ckan.views.c3charts = this.ckan.views.c3charts || {};
show: !! resourceView.y_grid
}
},
legend: legend
legend: legend,
tooltip: tooltip
}
}

Expand Down

0 comments on commit 9c70df6

Please sign in to comment.