// Set chart default optionsvar options = { width: '100%', height: 260, legend: 'none', backgroundColor: '#fff', chartArea: { backgroundColor: '#fff', width: '100%', height: '100%', left: 10, right: 20, top: 20 }, hAxis: { // baseline: 0, // viewWindowMode: 'pretty', gridlines: {count: 5}, textPosition: 'none' }, vAxis: { baseline: 0.0, baselineColor: 'red', gridlines: {count: 5}, textPosition: 'none' }, series: {0: {color: '#7bd7f0'}}, gridlines: {color: "#cacfd8"}, baselineColor: '#cacfd8',};
// Load the Visualization API and the linechart package.google.charts.load('current', {'packages':['corechart'], 'language': 'sk'});
var from = "{arguments.from}";var to = "{arguments.to}";
google.charts.setOnLoadCallback(drawChart{fund.uid});
function drawChart{fund.uid}() { var fund = {fund.uid}; var jsonData{fund.uid} = $.ajax({ method: 'POST', url: 'service/', data: { tx_rtgfunds_fund: { action: 'performance', id: fund, from: from, to: to } }, dataType: 'json', async: false }).responseText; var data = new google.visualization.DataTable(jsonData{fund.uid}); var chart{fund.uid} = new google.visualization.LineChart(document.getElementById('chart_div{fund.uid}')); // Get chart range var axisRange = data.getColumnRange(1); var min = Math.abs(axisRange.min); var max = Math.abs(axisRange.max); var optionsLocal = options; //console.log('min/max: ' + Math.ceil(min) + ' - ' + Math.ceil(max)); if (max >= min) { // optionsLocal.hAxis.viewWindowMode = 'pretty'; optionsLocal.vAxis.minValue = Math.ceil(max) * -1; optionsLocal.vAxis.maxValue = Math.ceil(max); } else { optionsLocal.vAxis.minValue = Math.ceil(min) * -1; optionsLocal.vAxis.maxValue = Math.ceil(min); } chart{fund.uid}.draw(data, optionsLocal);}
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/eb5ce779-d6da-45b9-80ca-8d2af6eab457%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Daniel,I did what you suggested, but it is still not showing gridlines... I have there option gridlines: {count: 5} but it is not working...
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/c3cf80b7-2669-4e0b-b86b-fb380205d265%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes, I removed textPosition and also tried to remove count...still not working :(
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/98d61712-344a-4194-acf6-94b9e8c2f0be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/46014719-c7a3-4dcb-b906-a6b695ef7e58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/eb5ce779-d6da-45b9-80ca-8d2af6eab457%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--dlali...@Google.com Cambridge MA
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/eb5ce779-d6da-45b9-80ca-8d2af6eab457%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--dlali...@Google.com Cambridge MA
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/8b24ebbf-dd4f-4692-a91c-6555baf5095c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/eb5ce779-d6da-45b9-80ca-8d2af6eab457%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--dlali...@Google.com Cambridge MA
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/8b24ebbf-dd4f-4692-a91c-6555baf5095c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--dlali...@Google.com Cambridge MA