#1 Random characters are showing up in the middle of my facet chart labels in the Facet Axis. My FacetChart is very simple (see below). I tried upgrading from 1.12.2 to 1.13.3, but it did not fix the issue.
#2 I'm not clear how I can make facet labels multi-line. I tried embedding a BR tag and also tried a carriage return + line feed.
t = new FacetChart(
settings = {
container: document.getElementById("chartContainer"),
data: { dataFunction: GetSelectionData
},
"title": {
"text": "Facet Viewer"
},
"facetAxis": {
"labels": {
"lineSpacing": 0.2,
"angle": -30
},
"enabled": true
},
series: [
{
data: { field: "value" },
style: { fillColor: "#09c", depthBrightness: 0.6, shadowColor: "rgba(0,0,0,0.5)" }
}
],
info: {
valueFormatterFunction: function (val) {
return val ? (numberWithCommas(val.first.toFixed(0))) : "No data";
}
},
interaction: { resizing: { enabled: false} },
series: [
{ id: "s1", data: { field: "value"} }
]
}
);
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function GetSelectionData(chartID, limit, offset, successCallback, errorCallback) {
// custom error handling code]
var myErrorCallback = function () {
if (window.console) console.log("There was an error while requesting data for chart '" + chartID + "'");
errorCallback();
};
jQuery.ajax({
url: 'FacetViewer.aspx/GetChartData',
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
if (window.console) console.log("Facet ID: (" + chartID + ") returned from webmethod: " + JSON.stringify(result));
successCallback(result.d);
},
error: myErrorCallback
}
);