Add support for changing markers after chart creation

parent 1790dc13
......@@ -121,4 +121,14 @@ c3_chart_internal_fn.getMarker = function(d, i){
var func = marker_fn[$$.config.marker_types[d.id]];
return func($$.pointR(d, i), $$.color(d, i)).node();
};
\ No newline at end of file
};
c3_chart_fn.dataMarker = function(id, value){
var $$ = this.internal;
if(typeof value !== 'string') {
return $$.config.marker_types[id];
}
if($$.config.marker_types[id] !== value){
$$.config.marker_types[id] = value;
}
};
......@@ -292,6 +292,7 @@ c3_chart_internal_fn.generateGetAreaPoints = function (areaIndices, isSub) { //
c3_chart_internal_fn.updateCircle = function () {
var $$ = this;
$$.main.selectAll('.' + CLASS.circles).selectAll('.' + CLASS.circle).remove();
$$.mainCircle = $$.main.selectAll('.' + CLASS.circles).selectAll('.' + CLASS.circle)
.data($$.lineOrScatterData.bind($$));
$$.mainCircle.enter().append($$.getMarker.bind($$))
......
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