To better explain my problem I prepared a stand alone page which allow
to test different settings for scales parameters.
Both charts are initially plotted using the following options:
{displayAnnotations: true, scaleType: 'allfixed', scaleColumns: [0,
1], legendPosition: 'newRow'}
As you can clearly see:
1 - in both charts all values of the series "Search Page Views" are
plotted over corresponding values of the series "Libero Portal Overall
Page Views", even if the firsts are lesser than the seconds;
2 - in chart 1 is absolutely not clear the proportion between "Search
Page Views" values and "Libero Portal Overall Page Views" values
because no scale is plotted for the first series (ok, in this case I
can add a third series in "scaleColumns", but what about using 4 or
more series???);
3 - you can see the real proportions using a single scale:
{displayAnnotations: true, legendPosition: 'newRow'}
What I need is a way to link more series to the same scale, but I have
not found anything suitable.
Here is the code of the page:
<html>
<head>
<script type='text/javascript' src='http://www.google.com/jsapi'></
script>
<script type='text/javascript' src='json2.js'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages':
["annotatedtimeline"]});
var chart;
var data;
var query;
var queryG;
var options;
//google.setOnLoadCallback(drawChart);
function drawChart1() {
data = new google.visualization.DataTable({
"cols":[
{"id":"C1","label":"Data","type":"date"},
{"id":"C2","label":"Libero Portal Overall Page Views (Millions)
1","type":"number"},
{"id":"C3","label":"Label","type":"string"},
{"id":"C4","label":"Note","type":"string"},
{"id":"C5","label":"Libero Portal Main Areas Avg Total Response
Time (Seconds)36","type":"number"},
{"id":"C6","label":"Label","type":"string"},
{"id":"C7","label":"Note","type":"string"},
{"id":"C8","label":"Search Page Views (Millions)
3","type":"number"},
{"id":"C9","label":"Label","type":"string"},
{"id":"C10","label":"Note","type":"string"}
],
"rows":[
{"c":[{"v":new Date(2007, 02 - 1, 16, 0, 0, 0)},
{"v":"372.15895"},{"v":null},{"v":null},{"v":0.345},{"v":null},
{"v":null},{"v":"31.82076"},{"v":null},{"v":null}]},
{"c":[{"v":new Date(2007, 02 - 1, 17, 0, 0, 0)},
{"v":"111.66915"},{"v":null},{"v":null},{"v":2.006},{"v":"Worst
response time"},{"v":"Due to server fault"},{"v":"22.13901"},
{"v":null},{"v":null}]},
{"c":[{"v":new Date(2007, 02 - 1, 18, 0, 0, 0)},{"v":"76.89600"},
{"v":null},{"v":null},{"v":0.768},{"v":null},{"v":null},
{"v":"20.10142"},{"v":null},{"v":null}]},
{"c":[{"v":new Date(2007, 02 - 1, 19, 0, 0, 0)},
{"v":"313.95685"},{"v":"Top portal page views"},{"v":"New layout
increases page views"},{"v":1.025},{"v":null},{"v":null},
{"v":"33.55877"},{"v":"Top competitor PV"},{"v":"New section in home
page"}]},
{"c":[{"v":new Date(2007, 02 - 1, 20, 0, 0, 0)},
{"v":"286.94327"},{"v":null},{"v":null},{"v":1.234},{"v":null},
{"v":null},{"v":"32.27204"},{"v":null},{"v":null}]}
]
});
chart = new google.visualization.AnnotatedTimeLine
(document.getElementById('chart_div'));
chart.draw(data, {displayAnnotations: true, scaleType: 'allfixed',
scaleColumns: [0, 1]});
enableUpdate();
}
function drawChart2() {
data = new google.visualization.DataTable({
"cols":[
{"id":"C1","label":"Data","type":"date"},
{"id":"C2","label":"Libero Portal Overall Page Views (Millions)
1","type":"number"},
{"id":"C3","label":"Label","type":"string"},
{"id":"C4","label":"Note","type":"string"},
{"id":"C8","label":"Search Page Views (Millions)
3","type":"number"},
{"id":"C9","label":"Label","type":"string"},
{"id":"C10","label":"Note","type":"string"}
],
"rows":[
{"c":[{"v":new Date(2007, 02 - 1, 16, 0, 0, 0)},
{"v":"372.15895"},{"v":null},{"v":null},{"v":"31.82076"},{"v":null},
{"v":null}]},
{"c":[{"v":new Date(2007, 02 - 1, 17, 0, 0, 0)},
{"v":"111.66915"},{"v":null},{"v":null},{"v":"22.13901"},{"v":null},
{"v":null}]},
{"c":[{"v":new Date(2007, 02 - 1, 18, 0, 0, 0)},{"v":"76.89600"},
{"v":null},{"v":null},{"v":"20.10142"},{"v":null},{"v":null}]},
{"c":[{"v":new Date(2007, 02 - 1, 19, 0, 0, 0)},
{"v":"313.95685"},{"v":"Top portal page views"},{"v":"New layout
increases page views"},{"v":"33.55877"},{"v":"Top competitor PV"},
{"v":"New section in home page"}]},
{"c":[{"v":new Date(2007, 02 - 1, 20, 0, 0, 0)},
{"v":"286.94327"},{"v":null},{"v":null},{"v":"32.27204"},{"v":null},
{"v":null}]}
]
});
chart = new google.visualization.AnnotatedTimeLine
(document.getElementById('chart_div'));
chart.draw(data, {displayAnnotations: true, scaleType: 'allfixed',
scaleColumns: [0, 1]});
enableUpdate();
}
function enableUpdate() {
document.getElementById('options').disabled = false;
document.getElementById('upd_btn').disabled = false;
}
function updateChart(opt) {
chart.draw(data, eval("options =" + opt));
}
</script>
</head>
<body>
<table width='800' border=1>
<tr>
<td>
<form>
<input type='button' value='draw chart 1'
onclick='drawChart1()'/>
<input type='button' value='draw chart 2'
onclick='drawChart2()'/>
<input type='text' value='' id='options' size='50'
disabled='true'/>
<input type='button' id='upd_btn' disabled='true'
value='update chart' onclick="updateChart(document.getElementById
('options').value)"/>
</form>
</td>
</tr>
<tr height='600'>
<td>
<div id='chart_div' style='width: 100%; height: 100%;'></
div>
</td>
</tr>
</table>
</body>
</html>
Regards,
G
On Apr 6, 1:41 pm, VizGuy <[email protected]> wrote:
> Please look at the configuration options called columnScales and scaleTypes.
>
> Regards,
> VizGuy
>
> On Fri, Apr 3, 2009 at 5:41 PM, Giuseppe Costa
> <[email protected]>wrote:
>
>
>
> > Hi,
> > I'm trying to show in the same chart 3 series with 2 different scales:
>
> > - series 1: millions, values from 0 to 13,000,000
>
> > - series 2: millions, values from 0 to 90,000,000
>
> > - series 3: seconds, values from 0 to 10
>
> > It seems that Annotated Timeline component assigns a scale to each
> > series and tries to "stretch" the scale on the whole height of the
> > chart area.
>
> > This causes a wrong visualization of the first two series: top values
> > of the first series are plotted over minimum values of the second,
> > even if they are smaller!
>
> > If a plot the first two series in a chart with a single scale, all
> > works fine because both are plotted using the same scale.
>
> > Is there a way to tell Annotated Timeline to use the same scale for
> > multiple series? If not, is this feature planned in future releases?
>
> > Thanks,
> > G
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---