Hi,
Can U try this
<html>
<head>
<script type="text/javascript" src="
https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.arrayToDataTable([
['Nombre', 'campo1', 'campo2'],
['Campo1 / Campo2', 50000, 20000]
/*['Enviados / Devueltos', 8000,7000],
['Enviados / Reenviados', 5600,3200],
['Enviados / Alcanzados', 4500,2600],
['Enviados / Devueltos', 1500,2500],*/
]);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{ calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation" },
2]);
var options = {
title: "Density of Precious Metals, in g/cm^3",
width: 600,
height: 400,
bar: {groupWidth: "50%"},
legend: { position: "none" },
};
var chart = new
google.visualization.BarChart(document.getElementById("barchart_values"));
chart.draw(view, options);
}
</script>
<div id="barchart_values" style="width: 900px; height: 300px;"></div>
</head>
<body>
<div id="dual_x_div"></div>
</body>
</html>
*Thanks & Regards*
*K. Ponni*
On Mon, Aug 13, 2018 at 7:53 PM, Luis Serrano <[email protected]> wrote:
> Hi K.Ponni,
>
>
> I copy/paste your code and still dont work, i think that just cant be doit.
>
> El lun., 13 ago. 2018 a las 0:53, Ponni Mano (<[email protected]>)
> escribió:
>
>> hi,
>>
>> Can U try this
>>
>> <html>
>> <head>
>> <script type="text/javascript"
>> src="https://www.gstatic.com/charts/loader.js"></script>
>> <script type="text/javascript">
>> google.charts.load('current', {'packages':['bar']});
>> google.charts.setOnLoadCallback(drawStuff);
>>
>> function drawStuff() {
>> var data = new google.visualization.arrayToDataTable([
>> ['Nombre', 'campo1', 'campo2'],
>>
>> ['Campo1 / Campo2', 50000, 20000]
>>
>> /*['Enviados / Devueltos', 8000,7000],
>> ['Enviados / Reenviados', 5600,3200],
>> ['Enviados / Alcanzados', 4500,2600],
>> ['Enviados / Devueltos', 1500,2500],*/
>> ]);
>>
>> var options = {
>> width: 700,
>> height: 400,bar: {groupWidth: "95%"}, chart: {
>>
>> title: 'Estado de las campañas',
>> subtitle: 'Estado de la campaña: '
>> },
>> bars: 'horizontal', // Required for Material Bar Charts.
>> series: {
>> 0: { axis: 'brightness' }, // Bind series 0 to an axis named
>> 'distance'. cambiado bright por brightness
>> 1: { axis: 'brightness' } // Bind series 1 to an axis named
>> 'brightness'.
>> },
>> axes: {
>> x: {
>> distance: {label: 'parsecs'}, // Bottom x-axis.
>> brightness: {side: 'top', label: 'Estado de las campañas'} //
>> Top x-axis.
>> }
>> }
>>
>> };
>>
>> var chart = new
>> google.charts.Bar(document.getElementById('dual_x_div'));
>> chart.draw(data, options);
>> };
>> </script>
>> </head>
>> <body>
>> <div id="dual_x_div"></div>
>> </body>
>> </html>
>>
>>
>>
>> *Thanks & Regards*
>>
>> *K. Ponni*
>>
>>
>>
>> On Thu, Aug 9, 2018 at 7:03 PM, Luis Serrano <[email protected]>
>> wrote:
>>
>>> Hello Community, im new on google charts and may be my question will be
>>> really dumb. But here it is:
>>>
>>> I have this code:
>>>
>>>
>>> <html>
>>> <head>
>>> <script type="text/javascript"
>>> src="https://www.gstatic.com/charts/loader.js"></script>
>>> <script type="text/javascript">
>>> google.charts.load('current', {'packages':['bar']});
>>> google.charts.setOnLoadCallback(drawStuff);
>>>
>>> function drawStuff() {
>>> var data = new google.visualization.arrayToDataTable([
>>> ['Nombre', 'campo1', 'campo2'],
>>>
>>> ['Campo1 / Campo2', 50000, 20000]
>>>
>>> /*['Enviados / Devueltos', 8000,7000],
>>> ['Enviados / Reenviados', 5600,3200],
>>> ['Enviados / Alcanzados', 4500,2600],
>>> ['Enviados / Devueltos', 1500,2500],*/
>>> ]);
>>>
>>> var options = {
>>> width: 700,
>>> height: 400,
>>> chart: {
>>> title: 'Estado de las campañas',
>>> subtitle: 'Estado de la campaña: '
>>> },
>>> bars: 'horizontal', // Required for Material Bar Charts.
>>> series: {
>>> 0: { axis: 'brightness' }, // Bind series 0 to an axis named
>>> 'distance'. cambiado bright por brightness
>>> 1: { axis: 'brightness' } // Bind series 1 to an axis named
>>> 'brightness'.
>>> },
>>> axes: {
>>> x: {
>>> distance: {label: 'parsecs'}, // Bottom x-axis.
>>> brightness: {side: 'top', label: 'Estado de las campañas'} //
>>> Top x-axis.
>>> }
>>> }
>>>
>>> };
>>>
>>> var chart = new
>>> google.charts.Bar(document.getElementById('dual_x_div'));
>>> chart.draw(data, options);
>>> };
>>> </script>
>>> </head>
>>> <body>
>>> <div id="dual_x_div"></div>
>>> </body>
>>> </html>
>>>
>>>
>>>
>>>
>>> And all that i want is redice the width of the bars, if i add more data the
>>> width will be small, but i want an smaller bar with only 2 bars.
>>>
>>> Any help will be aprreciated.
>>>
>>> PD: Sorry for my apprentice
>>>
>>> --
>>> 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 google-visualization-api@
>>> 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/e1b5f455-78a3-4b37-86f3-
>>> 1831cfc42703%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-visualization-api/e1b5f455-78a3-4b37-86f3-1831cfc42703%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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 google-visualization-api@
>> 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/CAKdjpwiSVN%2BR7OuoLzEOuAE8Y%3DbE%
>> 2BB8NffpAPgsFbRcrsk-4xA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-visualization-api/CAKdjpwiSVN%2BR7OuoLzEOuAE8Y%3DbE%2BB8NffpAPgsFbRcrsk-4xA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> 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 google-visualization-api@
> 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/CALntadiVUW6eS4U7%
> 3DJRG5Ly-AXv-5-9N9x9B8Q1CBK7T%3Dsu-rw%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-visualization-api/CALntadiVUW6eS4U7%3DJRG5Ly-AXv-5-9N9x9B8Q1CBK7T%3Dsu-rw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> 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 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/CAKdjpwjqujAuKgdP0u26HYEEE7z_E5%3D5%2BiCB_QKqEeBdxFZYXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.