Hello,
I want to create a dual Y-axis column chart instead of 2 separate column
charts.
Here are images of th 2 column charts
[image: counter.png]
[image: balance.png]
Here is a screenshot of the dual Y-axis
[image: dual_y.png]
Here is the code for the dual t-axis
google.charts.load('current', {'packages':['corechart', 'bar']});
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 = {
title :'Profit / Loss and trades count of all traded couples',
series: {
0: {axis: 'Balance'},
1: {axis: 'Trades'}
},
axes: {
y: {
'Balance': {label: 'Balance'},
'Trades': {label: 'Trades'}
},
x: {title: 'Traded Couples ', direction: 1,
slantedText: true,
slantedTextAngle: 45},
colors:['navy', 'pink']
},
animation: {
duration: 1000,
easing: 'out',
startup: true},
bar: { groupWidth: '80%' },
barVisibilityThreshold :-1,
seriesType: 'bars'};
var chart = new google.charts.Bar(document.getElementById('chart_div'));
chart.draw(data, options);
}//END CHART 1
</script>
The dual Y-axis doesn't give slanted text on the X-axis
I got 2 sepatated x axes with partial data on the axis due to lack of space
I suppose that it has something to do with classic / material charts
Can I have a dual Y-axis chart with 1 x-axis and slanted text on x-axis?
Can I change the color of the text of each Y-axis to fit the color of its
columns?
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/2781beae-6196-4899-83eb-f0aef709f125%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.