Browse Source

Fix grid and region when arc tyle - #518

pull/555/head
Masayuki Tanaka 10 years ago
parent
commit
3022a2f368
  1. 10
      c3.js
  2. 4
      c3.min.js
  3. 4
      src/grid.js
  4. 6
      src/region.js

10
c3.js

@ -3217,6 +3217,10 @@
c3_chart_internal_fn.redrawGrid = function (duration, withY) {
var $$ = this, main = $$.main, config = $$.config,
xgridLine, ygridLine, yv;
// hide if arc type
$$.grid.style('visibility', $$.hasArcType() ? 'hidden' : 'visible');
main.select('line.' + CLASS.xgridFocus).style("visibility", "hidden");
if (config.grid_x_show) {
$$.updateXGrid();
@ -4521,12 +4525,16 @@
c3_chart_internal_fn.initRegion = function () {
var $$ = this;
$$.main.append('g')
$$.region = $$.main.append('g')
.attr("clip-path", $$.clipPath)
.attr("class", CLASS.regions);
};
c3_chart_internal_fn.redrawRegion = function (duration) {
var $$ = this, config = $$.config;
// hide if arc type
$$.region.style('visibility', $$.hasArcType() ? 'hidden' : 'visible');
$$.mainRegion = $$.main.select('.' + CLASS.regions).selectAll('.' + CLASS.region)
.data(config.regions);
$$.mainRegion.enter().append('g')

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

4
src/grid.js

@ -72,6 +72,10 @@ c3_chart_internal_fn.updateYGrid = function () {
c3_chart_internal_fn.redrawGrid = function (duration, withY) {
var $$ = this, main = $$.main, config = $$.config,
xgridLine, ygridLine, yv;
// hide if arc type
$$.grid.style('visibility', $$.hasArcType() ? 'hidden' : 'visible');
main.select('line.' + CLASS.xgridFocus).style("visibility", "hidden");
if (config.grid_x_show) {
$$.updateXGrid();

6
src/region.js

@ -1,11 +1,15 @@
c3_chart_internal_fn.initRegion = function () {
var $$ = this;
$$.main.append('g')
$$.region = $$.main.append('g')
.attr("clip-path", $$.clipPath)
.attr("class", CLASS.regions);
};
c3_chart_internal_fn.redrawRegion = function (duration) {
var $$ = this, config = $$.config;
// hide if arc type
$$.region.style('visibility', $$.hasArcType() ? 'hidden' : 'visible');
$$.mainRegion = $$.main.select('.' + CLASS.regions).selectAll('.' + CLASS.region)
.data(config.regions);
$$.mainRegion.enter().append('g')

Loading…
Cancel
Save