Browse Source

Fix clip path when URL has anchor - #52

pull/66/head
Masayuki Tanaka 11 years ago
parent
commit
dbfeb969b9
  1. 12
      c3.js
  2. 4
      c3.min.js

12
c3.js

@ -167,7 +167,7 @@
/*-- Set Variables --*/
var clipId = __bindto.replace('#', '') + '-clip',
clipPath = "url(" + document.URL + "#" + clipId + ")";
clipPath = getClipPath(clipId);
var isTimeSeries = (__axis_x_type === 'timeseries'),
isCategorized = (__axis_x_type === 'categorized'),
@ -221,6 +221,10 @@
/*-- Define Functions --*/
function getClipPath(id) {
return "url(" + document.URL.split('#')[0] + "#" + id;
}
function transformMain() {
main.attr("transform", translate.main);
main.select('.x.axis').attr("transform", translate.x);
@ -1805,7 +1809,7 @@
// Add Axis
main.append("g")
.attr("class", "x axis")
.attr("clip-path", __axis_rotated ? "" : "url(" + document.URL + "#xaxis-clip)")
.attr("clip-path", __axis_rotated ? "" : getClipPath("xaxis-clip"))
.attr("transform", translate.x)
.append("text")
.attr("class", "-axis-x-label")
@ -1814,7 +1818,7 @@
.text(__axis_rotated ? textForYAxisLabel : textForXAxisLabel);
main.append("g")
.attr("class", "y axis")
.attr("clip-path", __axis_rotated ? "url(" + document.URL + "#yaxis-clip)" : "")
.attr("clip-path", __axis_rotated ? getClipPath("yaxis-clip") : "")
.append("text")
.attr("class", "-axis-y-label")
.attr("transform", "rotate(-90)")
@ -1940,7 +1944,7 @@
context.append("g")
.attr("class", "x axis")
.attr("transform", translate.subx)
.attr("clip-path", __axis_rotated ? "url(" + document.URL + "#yaxis-clip)" : "");
.attr("clip-path", __axis_rotated ? getClipPath("yaxis-clip") : "");
}
/*-- Legend Region --*/

4
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save