mirror of https://github.com/vitalif/dimple
Tooltip and Title Changes
parent
adac00797d
commit
570e80e809
|
@ -61,6 +61,8 @@ var dimple = {
|
||||||
this.useLog = false;
|
this.useLog = false;
|
||||||
// Help: http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-logBase
|
// Help: http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-logBase
|
||||||
this.logBase = 10;
|
this.logBase = 10;
|
||||||
|
// Help: http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-title
|
||||||
|
this.title = undefined;
|
||||||
|
|
||||||
// If this is a slave axis to a master composite axis, this stores a reference to the master
|
// If this is a slave axis to a master composite axis, this stores a reference to the master
|
||||||
this._master = null;
|
this._master = null;
|
||||||
|
@ -1507,15 +1509,16 @@ var dimple = {
|
||||||
rotate = "rotate(270, " + titleX + ", " + titleY + ")";
|
rotate = "rotate(270, " + titleX + ", " + titleY + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a title for the axis
|
// Add a title for the axis - NB check for null here, by default the title is undefined, in which case
|
||||||
if (!axis.hidden && (axis.position === "x" || axis.position === "y")) {
|
// use the dimension name
|
||||||
|
if (!axis.hidden && (axis.position === "x" || axis.position === "y") && axis.title !== null) {
|
||||||
axis.titleShape = this._group.append("text").attr("class", "axis title");
|
axis.titleShape = this._group.append("text").attr("class", "axis title");
|
||||||
axis.titleShape
|
axis.titleShape
|
||||||
.attr("x", titleX)
|
.attr("x", titleX)
|
||||||
.attr("y", titleY)
|
.attr("y", titleY)
|
||||||
.attr("text-anchor", "middle")
|
.attr("text-anchor", "middle")
|
||||||
.attr("transform", rotate)
|
.attr("transform", rotate)
|
||||||
.text((axis.categoryFields === null || axis.categoryFields === undefined || axis.categoryFields.length === 0 ? axis.measure : axis.categoryFields.join("/")))
|
.text(axis.title !== undefined ? axis.title : (axis.categoryFields === null || axis.categoryFields === undefined || axis.categoryFields.length === 0 ? axis.measure : axis.categoryFields.join("/")))
|
||||||
.each(function () {
|
.each(function () {
|
||||||
if (!chart.noFormats) {
|
if (!chart.noFormats) {
|
||||||
d3.select(this)
|
d3.select(this)
|
||||||
|
@ -2125,8 +2128,8 @@ var dimple = {
|
||||||
// Get the axis position based on the axis index
|
// Get the axis position based on the axis index
|
||||||
this.chart.axes.forEach(function (axis) {
|
this.chart.axes.forEach(function (axis) {
|
||||||
if (axis.position === "x" && !this.x.hidden) {
|
if (axis.position === "x" && !this.x.hidden) {
|
||||||
if (axis === this.x) {
|
if (this._deepMatch(axis)) {
|
||||||
// Set the y co-ordinate for the x axis
|
// Set the y co-ordinate for the x axis
|
||||||
if (xIndex === 0) {
|
if (xIndex === 0) {
|
||||||
coord.y = firstOrig.y;
|
coord.y = firstOrig.y;
|
||||||
} else if (xIndex === 1) {
|
} else if (xIndex === 1) {
|
||||||
|
@ -2135,7 +2138,7 @@ var dimple = {
|
||||||
}
|
}
|
||||||
xIndex += 1;
|
xIndex += 1;
|
||||||
} else if (axis.position === "y" && !this.y.hidden) {
|
} else if (axis.position === "y" && !this.y.hidden) {
|
||||||
if (axis === this.y) {
|
if (this._deepMatch(axis)) {
|
||||||
// Set the x co-ordinate for the y axis
|
// Set the x co-ordinate for the y axis
|
||||||
if (yIndex === 0) {
|
if (yIndex === 0) {
|
||||||
coord.x = firstOrig.x;
|
coord.x = firstOrig.x;
|
||||||
|
@ -2703,44 +2706,62 @@ var dimple = {
|
||||||
// Add the series categories
|
// Add the series categories
|
||||||
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
||||||
series.categoryFields.forEach(function (c, i) {
|
series.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
|
||||||
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.x._hasTimeField()) {
|
if (series.x._hasTimeField()) {
|
||||||
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
if (e.xField[0] !== null && e.xField[0] !== undefined) {
|
||||||
|
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
||||||
|
}
|
||||||
} else if (series.x._hasCategories()) {
|
} else if (series.x._hasCategories()) {
|
||||||
// Add the x axis categories
|
// Add the x axis categories
|
||||||
series.x.categoryFields.forEach(function (c, i) {
|
series.x.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
|
||||||
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
|
||||||
|
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.y._hasTimeField()) {
|
if (series.y._hasTimeField()) {
|
||||||
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
if (e.yField[0] !== null && e.yField[0] !== undefined) {
|
||||||
|
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
||||||
|
}
|
||||||
} else if (series.y._hasCategories()) {
|
} else if (series.y._hasCategories()) {
|
||||||
// Add the y axis categories
|
// Add the y axis categories
|
||||||
series.y.categoryFields.forEach(function (c, i) {
|
series.y.categoryFields.forEach(function (c, i) {
|
||||||
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
|
||||||
|
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
|
||||||
|
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.z !== null && series.z !== undefined) {
|
if (series.z !== null && series.z !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
|
||||||
|
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.c !== null && series.c !== undefined) {
|
if (series.c !== null && series.c !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
|
||||||
|
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
||||||
|
@ -2987,39 +3008,62 @@ var dimple = {
|
||||||
// Add the series categories
|
// Add the series categories
|
||||||
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
||||||
series.categoryFields.forEach(function (c, i) {
|
series.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
|
||||||
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.x._hasTimeField()) {
|
if (series.x._hasTimeField()) {
|
||||||
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
if (e.xField[0] !== null && e.xField[0] !== undefined) {
|
||||||
|
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
||||||
|
}
|
||||||
} else if (series.x._hasCategories()) {
|
} else if (series.x._hasCategories()) {
|
||||||
// Add the x axis categories
|
// Add the x axis categories
|
||||||
series.x.categoryFields.forEach(function (c, i) {
|
series.x.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
|
||||||
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
|
||||||
|
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.y._hasTimeField()) {
|
if (series.y._hasTimeField()) {
|
||||||
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
if (e.yField[0] !== null && e.yField[0] !== undefined) {
|
||||||
|
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
||||||
|
}
|
||||||
} else if (series.y._hasCategories()) {
|
} else if (series.y._hasCategories()) {
|
||||||
// Add the y axis categories
|
// Add the y axis categories
|
||||||
series.y.categoryFields.forEach(function (c, i) {
|
series.y.categoryFields.forEach(function (c, i) {
|
||||||
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
|
||||||
|
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
|
||||||
|
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (series.z !== null && series.z !== undefined) {
|
||||||
|
// Add the axis measure value
|
||||||
|
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
|
||||||
|
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.c !== null && series.c !== undefined) {
|
if (series.c !== null && series.c !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.c.measure + ": " + series.c._getFormat()(series.c.showPercent ? e.cPct : e.cValue));
|
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
|
||||||
|
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
||||||
|
@ -3303,44 +3347,62 @@ var dimple = {
|
||||||
// Add the series categories
|
// Add the series categories
|
||||||
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
||||||
series.categoryFields.forEach(function (c, i) {
|
series.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
|
||||||
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.x._hasTimeField()) {
|
if (series.x._hasTimeField()) {
|
||||||
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
if (e.xField[0] !== null && e.xField[0] !== undefined) {
|
||||||
|
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
||||||
|
}
|
||||||
} else if (series.x._hasCategories()) {
|
} else if (series.x._hasCategories()) {
|
||||||
// Add the x axis categories
|
// Add the x axis categories
|
||||||
series.x.categoryFields.forEach(function (c, i) {
|
series.x.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
|
||||||
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.x.measure + ": " + series.x._getFormat()(e.cx));
|
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
|
||||||
|
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.y._hasTimeField()) {
|
if (series.y._hasTimeField()) {
|
||||||
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
if (e.yField[0] !== null && e.yField[0] !== undefined) {
|
||||||
|
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
||||||
|
}
|
||||||
} else if (series.y._hasCategories()) {
|
} else if (series.y._hasCategories()) {
|
||||||
// Add the y axis categories
|
// Add the y axis categories
|
||||||
series.y.categoryFields.forEach(function (c, i) {
|
series.y.categoryFields.forEach(function (c, i) {
|
||||||
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
|
||||||
|
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.y.measure + ": " + series.y._getFormat()(e.cy));
|
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
|
||||||
|
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.z !== null && series.z !== undefined) {
|
if (series.z !== null && series.z !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
|
||||||
|
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.c !== null && series.c !== undefined) {
|
if (series.c !== null && series.c !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
|
||||||
|
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
||||||
|
@ -3686,50 +3748,62 @@ var dimple = {
|
||||||
// Add the series categories
|
// Add the series categories
|
||||||
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
||||||
series.categoryFields.forEach(function (c, i) {
|
series.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
|
||||||
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.x._hasTimeField()) {
|
if (series.x._hasTimeField()) {
|
||||||
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
if (e.xField[0] !== null && e.xField[0] !== undefined) {
|
||||||
|
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
||||||
|
}
|
||||||
} else if (series.x._hasCategories()) {
|
} else if (series.x._hasCategories()) {
|
||||||
// Add the x axis categories
|
// Add the x axis categories
|
||||||
series.x.categoryFields.forEach(function (c, i) {
|
series.x.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
|
||||||
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else if (series.x.useLog) {
|
|
||||||
// Add the y axis log
|
|
||||||
rows.push(series.x.measure + ": " + e.cx);
|
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.x.measure + ": " + series.x._getFormat()(e.cx));
|
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
|
||||||
|
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.y._hasTimeField()) {
|
if (series.y._hasTimeField()) {
|
||||||
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
if (e.yField[0] !== null && e.yField[0] !== undefined) {
|
||||||
|
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
||||||
|
}
|
||||||
} else if (series.y._hasCategories()) {
|
} else if (series.y._hasCategories()) {
|
||||||
// Add the y axis categories
|
// Add the y axis categories
|
||||||
series.y.categoryFields.forEach(function (c, i) {
|
series.y.categoryFields.forEach(function (c, i) {
|
||||||
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
|
||||||
|
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else if (series.y.useLog) {
|
|
||||||
// Add the y axis log
|
|
||||||
rows.push(series.y.measure + ": " + e.cy);
|
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.y.measure + ": " + series.y._getFormat()(e.cy));
|
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
|
||||||
|
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.z !== null && series.z !== undefined) {
|
if (series.z !== null && series.z !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
|
||||||
|
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.c !== null && series.c !== undefined) {
|
if (series.c !== null && series.c !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
|
||||||
|
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,14 +7,16 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var svg = dimple.newSvg("#chartContainer", 590, 400);
|
var svg = dimple.newSvg("#chartContainer", 590, 400);
|
||||||
d3.tsv("/data/example_data.tsv", function (data) {
|
d3.tsv("/data/example_data.tsv", function (data) {
|
||||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
|
||||||
var myChart = new dimple.chart(svg, data);
|
var myChart = new dimple.chart(svg, data);
|
||||||
myChart.setBounds(60, 30, 505, 305);
|
myChart.setBounds(60, 30, 505, 200);
|
||||||
var x = myChart.addCategoryAxis("x", "Month");
|
myChart.assignColor("Empty", "transparent", "Black");
|
||||||
x.addOrderRule("Date");
|
var x1 = myChart.addCategoryAxis("x", ["Owner", "All"]);
|
||||||
myChart.addMeasureAxis("y", "Unit Sales");
|
var x2 = myChart.addCategoryAxis(x1, ["Price Tier", "Brand"]);
|
||||||
myChart.addSeries("Channel", dimple.plot.line);
|
var y1 = myChart.addMeasureAxis("y", "Unit Sales");
|
||||||
myChart.addLegend(60, 10, 500, 20, "right");
|
var y2 = myChart.addMeasureAxis(y1, "Operating Profit");
|
||||||
|
var s1 = myChart.addSeries("Channel", dimple.plot.area, [x1, y1]);
|
||||||
|
var s2 = myChart.addSeries(["Price Tier", "Channel"], dimple.plot.area, [x2, y2]);
|
||||||
|
x1.title = null;
|
||||||
myChart.draw();
|
myChart.draw();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,14 +4,16 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var svg = dimple.newSvg("#chartContainer", 590, 400);
|
var svg = dimple.newSvg("#chartContainer", 590, 400);
|
||||||
d3.tsv("/data/example_data.tsv", function (data) {
|
d3.tsv("/data/example_data.tsv", function (data) {
|
||||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
|
||||||
var myChart = new dimple.chart(svg, data);
|
var myChart = new dimple.chart(svg, data);
|
||||||
myChart.setBounds(60, 30, 505, 305);
|
myChart.setBounds(60, 30, 505, 200);
|
||||||
var x = myChart.addCategoryAxis("x", "Month");
|
myChart.assignColor("Empty", "transparent", "Black");
|
||||||
x.addOrderRule("Date");
|
var x1 = myChart.addCategoryAxis("x", ["Owner", "All"]);
|
||||||
myChart.addMeasureAxis("y", "Unit Sales");
|
var x2 = myChart.addCategoryAxis(x1, ["Price Tier", "Brand"]);
|
||||||
myChart.addSeries("Channel", dimple.plot.line);
|
var y1 = myChart.addMeasureAxis("y", "Unit Sales");
|
||||||
myChart.addLegend(60, 10, 500, 20, "right");
|
var y2 = myChart.addMeasureAxis(y1, "Operating Profit");
|
||||||
|
var s1 = myChart.addSeries("Channel", dimple.plot.area, [x1, y1]);
|
||||||
|
var s2 = myChart.addSeries(["Price Tier", "Channel"], dimple.plot.area, [x2, y2]);
|
||||||
|
x1.title = null;
|
||||||
myChart.draw();
|
myChart.draw();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
this.useLog = false;
|
this.useLog = false;
|
||||||
// Help: http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-logBase
|
// Help: http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-logBase
|
||||||
this.logBase = 10;
|
this.logBase = 10;
|
||||||
|
// Help: http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-title
|
||||||
|
this.title = undefined;
|
||||||
|
|
||||||
// If this is a slave axis to a master composite axis, this stores a reference to the master
|
// If this is a slave axis to a master composite axis, this stores a reference to the master
|
||||||
this._master = null;
|
this._master = null;
|
||||||
|
|
|
@ -331,15 +331,16 @@
|
||||||
rotate = "rotate(270, " + titleX + ", " + titleY + ")";
|
rotate = "rotate(270, " + titleX + ", " + titleY + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a title for the axis
|
// Add a title for the axis - NB check for null here, by default the title is undefined, in which case
|
||||||
if (!axis.hidden && (axis.position === "x" || axis.position === "y")) {
|
// use the dimension name
|
||||||
|
if (!axis.hidden && (axis.position === "x" || axis.position === "y") && axis.title !== null) {
|
||||||
axis.titleShape = this._group.append("text").attr("class", "axis title");
|
axis.titleShape = this._group.append("text").attr("class", "axis title");
|
||||||
axis.titleShape
|
axis.titleShape
|
||||||
.attr("x", titleX)
|
.attr("x", titleX)
|
||||||
.attr("y", titleY)
|
.attr("y", titleY)
|
||||||
.attr("text-anchor", "middle")
|
.attr("text-anchor", "middle")
|
||||||
.attr("transform", rotate)
|
.attr("transform", rotate)
|
||||||
.text((axis.categoryFields === null || axis.categoryFields === undefined || axis.categoryFields.length === 0 ? axis.measure : axis.categoryFields.join("/")))
|
.text(axis.title !== undefined ? axis.title : (axis.categoryFields === null || axis.categoryFields === undefined || axis.categoryFields.length === 0 ? axis.measure : axis.categoryFields.join("/")))
|
||||||
.each(function () {
|
.each(function () {
|
||||||
if (!chart.noFormats) {
|
if (!chart.noFormats) {
|
||||||
d3.select(this)
|
d3.select(this)
|
||||||
|
|
|
@ -298,44 +298,62 @@
|
||||||
// Add the series categories
|
// Add the series categories
|
||||||
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
||||||
series.categoryFields.forEach(function (c, i) {
|
series.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
|
||||||
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.x._hasTimeField()) {
|
if (series.x._hasTimeField()) {
|
||||||
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
if (e.xField[0] !== null && e.xField[0] !== undefined) {
|
||||||
|
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
||||||
|
}
|
||||||
} else if (series.x._hasCategories()) {
|
} else if (series.x._hasCategories()) {
|
||||||
// Add the x axis categories
|
// Add the x axis categories
|
||||||
series.x.categoryFields.forEach(function (c, i) {
|
series.x.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
|
||||||
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
|
||||||
|
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.y._hasTimeField()) {
|
if (series.y._hasTimeField()) {
|
||||||
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
if (e.yField[0] !== null && e.yField[0] !== undefined) {
|
||||||
|
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
||||||
|
}
|
||||||
} else if (series.y._hasCategories()) {
|
} else if (series.y._hasCategories()) {
|
||||||
// Add the y axis categories
|
// Add the y axis categories
|
||||||
series.y.categoryFields.forEach(function (c, i) {
|
series.y.categoryFields.forEach(function (c, i) {
|
||||||
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
|
||||||
|
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
|
||||||
|
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.z !== null && series.z !== undefined) {
|
if (series.z !== null && series.z !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
|
||||||
|
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.c !== null && series.c !== undefined) {
|
if (series.c !== null && series.c !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
|
||||||
|
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
||||||
|
|
|
@ -180,39 +180,62 @@
|
||||||
// Add the series categories
|
// Add the series categories
|
||||||
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
||||||
series.categoryFields.forEach(function (c, i) {
|
series.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
|
||||||
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.x._hasTimeField()) {
|
if (series.x._hasTimeField()) {
|
||||||
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
if (e.xField[0] !== null && e.xField[0] !== undefined) {
|
||||||
|
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
||||||
|
}
|
||||||
} else if (series.x._hasCategories()) {
|
} else if (series.x._hasCategories()) {
|
||||||
// Add the x axis categories
|
// Add the x axis categories
|
||||||
series.x.categoryFields.forEach(function (c, i) {
|
series.x.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
|
||||||
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
|
||||||
|
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.y._hasTimeField()) {
|
if (series.y._hasTimeField()) {
|
||||||
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
if (e.yField[0] !== null && e.yField[0] !== undefined) {
|
||||||
|
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
||||||
|
}
|
||||||
} else if (series.y._hasCategories()) {
|
} else if (series.y._hasCategories()) {
|
||||||
// Add the y axis categories
|
// Add the y axis categories
|
||||||
series.y.categoryFields.forEach(function (c, i) {
|
series.y.categoryFields.forEach(function (c, i) {
|
||||||
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
|
||||||
|
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
|
||||||
|
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (series.z !== null && series.z !== undefined) {
|
||||||
|
// Add the axis measure value
|
||||||
|
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
|
||||||
|
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.c !== null && series.c !== undefined) {
|
if (series.c !== null && series.c !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.c.measure + ": " + series.c._getFormat()(series.c.showPercent ? e.cPct : e.cValue));
|
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
|
||||||
|
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
||||||
|
|
|
@ -201,44 +201,62 @@
|
||||||
// Add the series categories
|
// Add the series categories
|
||||||
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
||||||
series.categoryFields.forEach(function (c, i) {
|
series.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
|
||||||
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.x._hasTimeField()) {
|
if (series.x._hasTimeField()) {
|
||||||
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
if (e.xField[0] !== null && e.xField[0] !== undefined) {
|
||||||
|
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
||||||
|
}
|
||||||
} else if (series.x._hasCategories()) {
|
} else if (series.x._hasCategories()) {
|
||||||
// Add the x axis categories
|
// Add the x axis categories
|
||||||
series.x.categoryFields.forEach(function (c, i) {
|
series.x.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
|
||||||
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.x.measure + ": " + series.x._getFormat()(e.cx));
|
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
|
||||||
|
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.y._hasTimeField()) {
|
if (series.y._hasTimeField()) {
|
||||||
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
if (e.yField[0] !== null && e.yField[0] !== undefined) {
|
||||||
|
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
||||||
|
}
|
||||||
} else if (series.y._hasCategories()) {
|
} else if (series.y._hasCategories()) {
|
||||||
// Add the y axis categories
|
// Add the y axis categories
|
||||||
series.y.categoryFields.forEach(function (c, i) {
|
series.y.categoryFields.forEach(function (c, i) {
|
||||||
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
|
||||||
|
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.y.measure + ": " + series.y._getFormat()(e.cy));
|
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
|
||||||
|
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.z !== null && series.z !== undefined) {
|
if (series.z !== null && series.z !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
|
||||||
|
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.c !== null && series.c !== undefined) {
|
if (series.c !== null && series.c !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
|
||||||
|
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
||||||
|
|
|
@ -281,50 +281,62 @@
|
||||||
// Add the series categories
|
// Add the series categories
|
||||||
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
|
||||||
series.categoryFields.forEach(function (c, i) {
|
series.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
|
||||||
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.x._hasTimeField()) {
|
if (series.x._hasTimeField()) {
|
||||||
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
if (e.xField[0] !== null && e.xField[0] !== undefined) {
|
||||||
|
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
|
||||||
|
}
|
||||||
} else if (series.x._hasCategories()) {
|
} else if (series.x._hasCategories()) {
|
||||||
// Add the x axis categories
|
// Add the x axis categories
|
||||||
series.x.categoryFields.forEach(function (c, i) {
|
series.x.categoryFields.forEach(function (c, i) {
|
||||||
// If the category name and value match don't display the category name
|
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
|
||||||
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
// If the category name and value match don't display the category name
|
||||||
|
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else if (series.x.useLog) {
|
|
||||||
// Add the y axis log
|
|
||||||
rows.push(series.x.measure + ": " + e.cx);
|
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.x.measure + ": " + series.x._getFormat()(e.cx));
|
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
|
||||||
|
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.y._hasTimeField()) {
|
if (series.y._hasTimeField()) {
|
||||||
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
if (e.yField[0] !== null && e.yField[0] !== undefined) {
|
||||||
|
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
|
||||||
|
}
|
||||||
} else if (series.y._hasCategories()) {
|
} else if (series.y._hasCategories()) {
|
||||||
// Add the y axis categories
|
// Add the y axis categories
|
||||||
series.y.categoryFields.forEach(function (c, i) {
|
series.y.categoryFields.forEach(function (c, i) {
|
||||||
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
|
||||||
|
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} else if (series.y.useLog) {
|
|
||||||
// Add the y axis log
|
|
||||||
rows.push(series.y.measure + ": " + e.cy);
|
|
||||||
} else {
|
} else {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.y.measure + ": " + series.y._getFormat()(e.cy));
|
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
|
||||||
|
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.z !== null && series.z !== undefined) {
|
if (series.z !== null && series.z !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
|
||||||
|
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series.c !== null && series.c !== undefined) {
|
if (series.c !== null && series.c !== undefined) {
|
||||||
// Add the axis measure value
|
// Add the axis measure value
|
||||||
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
|
||||||
|
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
// Get the axis position based on the axis index
|
// Get the axis position based on the axis index
|
||||||
this.chart.axes.forEach(function (axis) {
|
this.chart.axes.forEach(function (axis) {
|
||||||
if (axis.position === "x" && !this.x.hidden) {
|
if (axis.position === "x" && !this.x.hidden) {
|
||||||
if (axis === this.x) {
|
if (this._deepMatch(axis)) {
|
||||||
// Set the y co-ordinate for the x axis
|
// Set the y co-ordinate for the x axis
|
||||||
if (xIndex === 0) {
|
if (xIndex === 0) {
|
||||||
coord.y = firstOrig.y;
|
coord.y = firstOrig.y;
|
||||||
} else if (xIndex === 1) {
|
} else if (xIndex === 1) {
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
}
|
}
|
||||||
xIndex += 1;
|
xIndex += 1;
|
||||||
} else if (axis.position === "y" && !this.y.hidden) {
|
} else if (axis.position === "y" && !this.y.hidden) {
|
||||||
if (axis === this.y) {
|
if (this._deepMatch(axis)) {
|
||||||
// Set the x co-ordinate for the y axis
|
// Set the x co-ordinate for the y axis
|
||||||
if (yIndex === 0) {
|
if (yIndex === 0) {
|
||||||
coord.x = firstOrig.x;
|
coord.x = firstOrig.x;
|
||||||
|
|
Loading…
Reference in New Issue