0001-misc-remove-PNG-export-button-38731.patch
bijoe/static/css/bijoe.css | ||
---|---|---|
126 | 126 |
padding-bottom: 3px; |
127 | 127 |
} |
128 | 128 | |
129 |
/* chart representation */ |
|
130 | ||
131 |
.bijoe-png-button { |
|
132 |
/* move PNG button slightly inside the chart frame */ |
|
133 |
float: right; |
|
134 |
bottom: -3em; |
|
135 |
left: -2em; |
|
136 |
position: relative; |
|
137 |
} |
|
138 | ||
139 | 129 |
/* misc */ |
140 | 130 |
canvas { |
141 | 131 |
box-sizing: border-box; |
bijoe/templates/bijoe/cube_chart.html | ||
---|---|---|
2 | 2 |
{% for table in visualization %} |
3 | 3 |
<h2>{{ table.table_title }}</h2> |
4 | 4 | |
5 |
<a href="#" target="none" class="button bijoe-png-button">PNG</a> |
|
6 | 5 |
<div class="graph"> |
7 | 6 |
<canvas id="canvas-{{ forloop.counter }}"></canvas> |
8 | 7 |
</div> |
... | ... | |
15 | 14 |
draw_piechart(canvas, drilldown, [measure], measure.name, data); |
16 | 15 |
} else { |
17 | 16 |
draw_barchart(canvas, drilldown, [measure], measure.name, data); |
18 |
/* Allow getting a PNG without using 'Save image as' */ |
|
19 |
$(".bijoe-png-button").on('click', function() { |
|
20 |
this.href = toDataURL($(this).next().find("canvas")[0], "graph.png"); |
|
21 |
}) |
|
22 | 17 |
} |
23 | 18 |
}, 500 * {{ forloop.counter }}); |
24 | 19 |
}); |
25 |
- |