Hello,
I created a dual y-axis
Ireceived a chart with dual y-axis but with 2 separate x axes.
Here is the code:
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawVisualization);
//////////////////////// Drawing the graph //////////////////////
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Couple');
data.addColumn('number', 'profit');
data.addColumn('number','trades');
for(var i = 0; i < datum_b.length; i++){
datum_b[i].profit=parseFloat(datum_b[i].profit);
datum_c[i].trades=parseFloat(datum_c[i].trades);
var obj_b = datum_b[i];
var obj_c = datum_c[i];
data.addRow([obj_b.item, obj_b.profit, obj_c.trades]);
}
var Options = {
series: {
0: {targetAxisIndex: 0},
1: {targetAxisIndex: 1}
},
title:'Profit / Loss (left) and trades count (right) of all
traded couples',
vAxes: {
0: {title: 'Profit', textStyle: {color: 'DodgerBlue', bold: true
}},
1: {title: 'Trades', textStyle: {color: 'Tomato', bold: true}}
},
hAxis: {title: 'Traded Couples ', direction: 1,
slantedText: true,
slantedTextAngle: 45
}
};
var chart = new google.visualization.ColumnChart(document.getElementById
('chart_div'));
chart.draw(data, Options);
}//END CHART 1
Here is a print screen of the result:
[image: dual y.png]
how do I change it to a single 0 x-axis
Can I change the title of the y-axes color to the legend color?
Thanks
--
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 [email protected].
To post to this group, send email to [email protected].
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/db81dd65-e6fb-487d-9c4b-d414e3a578b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.