Browse Source

Accept string x values as categories when categorized - #94

pull/104/head
Masayuki Tanaka 11 years ago
parent
commit
b69be2eede
  1. 11
      c3.js
  2. 2
      c3.min.js

11
c3.js

@ -1191,7 +1191,7 @@
}
// convert to target
targets = ids.map(function (id) {
targets = ids.map(function (id, index) {
var convertedId = __data_id_converter(id);
return {
id: convertedId,
@ -1202,9 +1202,16 @@
if (isTimeSeries) {
x = d[xKey] instanceof Date ? d[xKey] : parseDate(d[xKey]);
}
else if (isCustomX) {
else if (isCustomX && !isCategorized) {
x = d[xKey] ? +d[xKey] : getXValue(id, i);
}
else if (isCustomX && isCategorized) {
x = i;
if (index === 0 && d[xKey]) {
if (i === 0) { __axis_x_categories = []; }
__axis_x_categories.push(d[xKey]);
}
}
else {
x = i;
}

2
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save