Created
January 31, 2014 18:46
-
-
Save wetzler/8739951 to your computer and use it in GitHub Desktop.
workaround for saved queries drawing weirdness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query = new Keen.SavedQuery("activity_09_2013"); | |
query.getResponse(function(response){ | |
console.log(response.result); | |
// Call Michelle's gross function | |
drawMyLineChart(response, "daily", div , title) | |
}); | |
function drawMyLineChart(response, interval, div, title) { | |
// Create a Series object so that it can be referenced by the draw method. | |
// This is kind of a hack since we are passing in our own result object and not really querying the collection specified here. | |
// The "placeholder" is used instead of a collection name, since this is not used. | |
var placeholderSeries = new Keen.Series("placeholder", { | |
interval: interval | |
}) | |
var lineChart = new Keen.LineChart(placeholderSeries, { | |
height: 400, | |
width: 600, | |
lineWidth: 3, | |
chartAreaWidth: "60%", | |
chartAreaLeft: "10%", | |
title: title, | |
showLegend: false, | |
xAxisLabelAngle: xAxisLabelAngle | |
}); | |
lineChart.draw(document.getElementById(div), formattedResult); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment