Commit 434af4b8 authored by Masayuki Tanaka's avatar Masayuki Tanaka Committed by masayuki

Use d3 line object when no region

parent ac7d9cbd
...@@ -222,17 +222,22 @@ ...@@ -222,17 +222,22 @@
})() })()
} }
// For main region // TODO: use nornal line when no region // For main region
var lineOnMain = function (d) { var lineOnMain = (function () {
var x0, y0 var line = d3.svg.line()
if (isLineType(d)) { .x(__axis_rotated ? function(d){ return getYScale(d.id)(d.value) } : xx)
return lineWithRegions(d.values, x, getYScale(d.id), __data_regions[d.id]) .y(__axis_rotated ? xx : function(d){ return getYScale(d.id)(d.value) })
} else { return function (d) {
x0 = x(d.values[0].x) var x0, y0
y0 = getYScale(d.id)(d.values[0].value) if (isLineType(d)) {
return __axis_rotated ? "M "+y0+" "+x0 : "M "+x0+" "+y0 return __data_regions.length > 0 ? lineWithRegions(d.values, x, getYScale(d.id), __data_regions[d.id]) : line(d.values)
} else {
x0 = x(d.values[0].x)
y0 = getYScale(d.id)(d.values[0].value)
return __axis_rotated ? "M "+y0+" "+x0 : "M "+x0+" "+y0
}
} }
} })()
// For brush region // For brush region
var lineOnSub = (function () { var lineOnSub = (function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment