Thanks. Chart come up. Now i am on the same point how to setup the ticks :(
Script:
<script type='text/javascript'>
google.load('visualization', '1', {packages: [
'corechart','bar']});
google.setOnLoadCallback(drawSaleChart);
function drawSaleChart() {
var data = google.visualization.arrayToDataTable([
['Projektledare','Sale','Avg'],['Anstenius',91530,18306
],['Björnaes',140445,10031.79],['Hammarstrom ',64380,8047.5],['Fuglsang',
512575,17675]]); var options = {title: 'Projektledning: Sales'};var chart =
new google.visualization.ColumnChart(document.getElementById('div_chart'));
chart.draw(data, options);} </script>
<div id="div_chart" style="height: 325px; text-
align: left;"></div>
On Wednesday, April 1, 2015 at 10:58:35 PM UTC+2, Sergey wrote:
>
> You need to call the right class: google.visualization.ColumnChart.
>
> On Wed, Apr 1, 2015 at 4:56 PM Shahid Majeed <[email protected]
> <javascript:>> wrote:
>
>> Correct but still chart does not come up
>> <script type='text/javascript'>
>> google.load('visualization', '1', {packages: [
>> 'corechart','bar']});
>> google.setOnLoadCallback(drawSaleChart);
>>
>> function drawSaleChart() {
>> var data = google.visualization.arrayToDataTable([
>> ['Projektledare','Sale','Avg'],['Ahlenius',0,0],[
>> 'emma',54200,27100],['Anstenius',145105,16122.78],['ida',0,0],['Björnaes'
>> ,396190,13206.33],['Hammarstrom ',207230,12951.88],['Fuglsang',851005,
>> 20756.22],['Strand',817710,32708.4],['Wiberg',0,0],['Wilsletf',779635,
>> 41033.42],['Bergseije',475,475],['Samuelsson',17535,17535],['Dijkstra',0,
>> 0],['Ranheimer',287151,143575.5]]); var options = {title: 'Projektledning:
>> Sales'};var chart = new google.charts.ColumnChart(document.getElementById
>> ('div_chart'));chart.draw(data, options);} </script>
>> <div id="div_chart" style="height: 325px;
>> text-align: left;"></div>
>>
>>
>> <https://lh3.googleusercontent.com/-x8BpdZ0SrA4/VRxdIKirESI/AAAAAAAAAtU/ZUXRmENY3hg/s1600/chart2.JPG>
>>
>>
>> <https://lh3.googleusercontent.com/-x8BpdZ0SrA4/VRxdIKirESI/AAAAAAAAAtU/ZUXRmENY3hg/s1600/chart2.JPG>
>>
>>
>>
>> On Wednesday, April 1, 2015 at 10:52:25 PM UTC+2, Sergey wrote:
>>
>>> The title is specified differently for Classic Charts. It needs to be a
>>> top-level option. That means that your options structure should be as
>>> follows:
>>> var options = {title: 'Projektledning: Sales'};
>>>
>>> On Wed, Apr 1, 2015 at 4:49 PM Shahid Majeed <[email protected]>
>>> wrote:
>>>
>>>> I tried to update my script according to the example but now its does
>>>> shows on my page.
>>>> Here is my updated script
>>>> <script type='text/javascript'>
>>>> google.load('visualization', '1', {packages: [
>>>> 'corechart','bar']});
>>>> google.setOnLoadCallback(drawSaleChart);
>>>>
>>>> function drawSaleChart() {
>>>> var data = google.visualization.arrayToDataTable([
>>>>
>>>> ['Projektledare','Sale','Avg'],['Ahlenius',0,0],[
>>>> 'emma',54200,27100],['Anstenius',145105,16122.78],['ida',0,0],['
>>>> Björnaes',396190,13206.33],['Hammarstrom ',207230,12951.88],['Fuglsang'
>>>> ,851005,20756.22],['Strand',817710,32708.4],['Wiberg',0,0],['Wilsletf',
>>>> 779635,41033.42],['Bergseije',475,475],['Samuelsson',17535,17535],['
>>>> Dijkstra',0,0],['Ranheimer',287151,143575.5]]); var options = {chart: {
>>>> title: 'Projektledning: Sales'}};var chart = new google.charts.
>>>> ColumnChart(document.getElementById('div_chart'));chart.draw(data,
>>>> options);} </script>
>>>> <div id="div_chart" style="height: 325px;
>>>> text-align: left;"></div>
>>>>
>>>>
>>>>
>>>> On Wednesday, April 1, 2015 at 10:43:08 PM UTC+2, Sergey wrote:
>>>>
>>>>> Yes. Here is an example: https://jsfiddle.net/fggkgoau/
>>>>>
>>>>> On Wed, Apr 1, 2015 at 4:41 PM Shahid Majeed <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Is it possible i use two series in regular column chart. On the API
>>>>>> page i only see one series example. Do you refer me an example related
>>>>>> to
>>>>>> my data.
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> On Wednesday, April 1, 2015 at 10:33:39 PM UTC+2, Sergey wrote:
>>>>>>
>>>>>>> I think that if your two data measures have the same scale, showing
>>>>>>> them on separate axes is misleading. If the average column looks tiny,
>>>>>>> then
>>>>>>> that's the nature of the data. If I misunderstood the nature of your
>>>>>>> data,
>>>>>>> and they are on different scales, then putting them on separate axes
>>>>>>> was
>>>>>>> the right decision, and I apologize.
>>>>>>>
>>>>>>> There is currently no way to control the ticks with that sort of
>>>>>>> granularity. The regular ColumnChart supports custom ticks, so you
>>>>>>> could
>>>>>>> use that.
>>>>>>>
>>>>>>> On Wed, Apr 1, 2015 at 4:30 PM Shahid Majeed <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>
>>>>>>>> <https://lh3.googleusercontent.com/-5O5DoHpFWOc/VRxVdfFg_NI/AAAAAAAAAtE/PrYYO3VkFFg/s1600/chart1.JPG>
>>>>>>>> If i removed the series and y axis option then my chart look like
>>>>>>>> this. Now problem is I have large sale value as compared to average.
>>>>>>>> Average column look very tiny. Is it possible i can set the interval
>>>>>>>> min 0
>>>>>>>> and then gridlines increase by specific interval such as 100K
>>>>>>>>
>>>>>>>>
>>>>>>>> <https://lh3.googleusercontent.com/-5O5DoHpFWOc/VRxVdfFg_NI/AAAAAAAAAtE/PrYYO3VkFFg/s1600/chart1.JPG>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wednesday, April 1, 2015 at 10:24:40 PM UTC+2, Shahid Majeed
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>> I am new to google chart api. I am trying to create a bar chart
>>>>>>>>> with Sale and Avg sale series. I Succeed to create chart but i tried
>>>>>>>>> allot
>>>>>>>>> to set the Y-axis steps to make the chart sensible.
>>>>>>>>>
>>>>>>>>> If you check my chart left Y-axis (Sale) range from 0 to 800K and
>>>>>>>>> right Y-axis(Avg) range from 0 to150K.
>>>>>>>>> Most of the columns shows the average column higher than sale
>>>>>>>>> because its draw according to value.
>>>>>>>>>
>>>>>>>>> Any suggestion please how to make this sensible.
>>>>>>>>>
>>>>>>>>> Thanks in advance
>>>>>>>>>
>>>>>>>>> Here is my script
>>>>>>>>> <script type='text/javascript'>
>>>>>>>>> google.load('visualization', '1', {packages: [
>>>>>>>>> 'bar']});
>>>>>>>>> google.setOnLoadCallback(drawSaleChart);
>>>>>>>>>
>>>>>>>>> function drawSaleChart() {
>>>>>>>>> var data = google.visualization.arrayToDa
>>>>>>>>> taTable([
>>>>>>>>> ['Projektledare','Sale','Avg'],['Anstenius',
>>>>>>>>> 53575,13393.75],['Björnaes',147395,13399.55],['Hammarstrom ',80810
>>>>>>>>> ,26936.67],['Fuglsang',112080,56040],['Wilsletf',779635,41033.42
>>>>>>>>> ],['Ranheimer',287151,143575.5]]); var options = {chart: { title:
>>>>>>>>> 'Projektledning:
>>>>>>>>> Sales'},series: {
>>>>>>>>> 0: { axis: 'Sale' },
>>>>>>>>> 1: { axis: 'Avg' }
>>>>>>>>> },axes: {
>>>>>>>>> y: {
>>>>>>>>> Sale: {label: 'Sale'},
>>>>>>>>> Avg: {side: 'right',
>>>>>>>>> label: 'Avg Sale'}
>>>>>>>>> }
>>>>>>>>> }};var chart = new google.
>>>>>>>>> charts.Bar(document.getElementById('div_chart'));chart.draw(data,
>>>>>>>>> options);} </script>
>>>>>>>>> <div id="div_chart" style="height:
>>>>>>>>> 325px; text-align: left;"></div>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Here how the chart look like
>>>>>>>>>
>>>>>>>>> <http://i57.tinypic.com/16gfjhs.jpg>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>> 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
>>>>>>>> [email protected].
>>>>>>>>
>>>>>>> To post to this group, send email to [email protected]
>>>>>>>> om.
>>>>>>>
>>>>>>>
>>>>>>>> Visit this group at http://groups.google.com/group
>>>>>>>> /google-visualization-api.
>>>>>>>> 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-visualization-api+unsub
>>>>>> [email protected].
>>>>>> To post to this group, send email to [email protected]
>>>>>> .
>>>>>> Visit this group at http://groups.google.com/group
>>>>>> /google-visualization-api.
>>>>>> 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 [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at http://groups.google.com/
>>>> group/google-visualization-api.
>>>> 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 [email protected]
>> <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at
>> http://groups.google.com/group/google-visualization-api.
>> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.