Skip to content

Commit

Permalink
Merge pull request #29 from ahmednoureldeen/master
Browse files Browse the repository at this point in the history
integrate D3/C3 charts into LH sidebar
  • Loading branch information
kidwellj authored Sep 21, 2017
2 parents e69c539 + d595075 commit 858f6e5
Show file tree
Hide file tree
Showing 12 changed files with 3,926 additions and 156 deletions.
11 changes: 11 additions & 0 deletions Clustering/c3/c3.js
Original file line number Diff line number Diff line change
Expand Up @@ -4989,6 +4989,10 @@ c3_chart_internal_fn.getDefaultConfig = function () {
data_columns: undefined,
data_mimeType: undefined,
data_keys: undefined,

//ahmednoureldeen: custom code to support random scattring
data_xRandomScattering: false,
data_yRandomScattering: false,
// configuration for no plot-able data supplied.
data_empty_label_text: "",
// subchart
Expand Down Expand Up @@ -5402,6 +5406,13 @@ c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) {
if (isUndefined(d[id]) || $$.data.xs[id].length <= i) {
x = undefined;
}
//ahmednoureldeen-- custom code
//console.log(config);
if(config.data_xRandomScattering)
x = x + (Math.random() * 0.6 - 0.3);
if(config.data_yRandomScattering)
value = value + (Math.random() * 0.6 - 0.3);
////////////////////////////////////////
return { x: x, value: value, id: convertedId };
}).filter(function (v) {
return isDefined(v.x);
Expand Down
Loading

0 comments on commit 858f6e5

Please sign in to comment.