//generateChart is a required function which will be called to generate your Javascript chart generateChart = function(options) { // This will trigger a breakpoint in your browser debugger so you can debug your javascript debugger; // This is the div you draw your chart into var $chartDrawDiv = $(options.divSelector); // To stop scrollbars in any portlets regardless of your javascript, use this css class $chartDrawDiv.addClass('jsChartNoOverflow'); // This gets the height and width from the dataset. Use these when creating your chart so that // it will fit the dashboard, canvas and storyboard correctly var height = options.dataset.chart_information.height; var width = options.dataset.chart_information.width; // Convert the raw data JSON to the format required for the chart if required. var processedData = processData(options.dataset.data); // Do the actual drawing of the chart into $chartDiv. doDrawing(processedData, $chartDrawDiv, height, width, options.errorCallback); }, processData = function(dataset) { // Data is in the dataset in a column based format, where each column has an array of data // eg. dataset.column_name[0].raw_data, dataset.column_name[0].formatted_data data={x: [], y1: [], y2: [] } for (i=0;i