Quite good looking graph derived from d3.js http://c3js.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

56 lines
1.3 KiB

import {
CLASS,
isValue,
isFunction,
isString,
isUndefined,
isDefined,
ceil10,
asHalfPixel,
diffDomain,
isEmpty,
notEmpty,
getOption,
hasValue,
sanitise,
getPathBox,
ChartInternal
} from '../chartinternal.js';
const xgrids = function (grids) {
let $$ = this.internal, config = $$.config;
if (!grids) { return config.grid_x_lines; }
config.grid_x_lines = grids;
$$.redrawWithoutRescale();
return config.grid_x_lines;
};
xgrids.add = function (grids) {
const $$ = this.internal;
return this.xgrids($$.config.grid_x_lines.concat(grids ? grids : []));
};
xgrids.remove = function (params) { // TODO: multiple
const $$ = this.internal;
$$.removeGridLines(params, true);
};
const ygrids = function (grids) {
let $$ = this.internal, config = $$.config;
if (!grids) { return config.grid_y_lines; }
config.grid_y_lines = grids;
$$.redrawWithoutRescale();
return config.grid_y_lines;
};
ygrids.add = function (grids) {
const $$ = this.internal;
return this.ygrids($$.config.grid_y_lines.concat(grids ? grids : []));
};
ygrids.remove = function (params) { // TODO: multiple
const $$ = this.internal;
$$.removeGridLines(params, false);
};
export { xgrids, ygrids };