English 中文(简体)
页: 1
原标题:Google charts- changing orientation of bars in a bar chart

我试图用两套数据绘制一张纸张。 我想从右边抽取一个系列,从左边抽取一个系列。

如果我对奥地利持消极的价值观,那么它将把这些价值观引向左边。 是否有办法使奥地利的数据系列面向左边,保加利亚的数据系列在不给价值观带来负面影响的情况下指出了正确的方向?

我正在与谷歌的维祖化亚普森的其中一个例子一起发言,这里是我所看到的(也许最容易将以下代码贴在):

     function drawVisualization() {
       // Create and populate the data table.
       var data = new google.visualization.DataTable();
       var raw_data = [[ Austria , -1336060, -1538156, -1576579, -1600652, -1968113, 1901067],
                       [ Bulgaria , 400361, 366849, 440514, 434552, 393032, 517206],
                       //[ Denmark , 1001582, 1119450, 993360, 1004163, 979198, 916965],
                       //[ Greece , 997974, 941795, 930593, 897127, 1080887, 1056036]
                      ];

       var years = [2003, 2004, 2005, 2006, 2007, 2008];

       data.addColumn( string ,  Year );
       for (var i = 0; i  < raw_data.length; ++i) {
         data.addColumn( number , raw_data[i][0]);    
       }

       data.addRows(years.length);

       for (var j = 0; j < years.length; ++j) {    
         data.setValue(j, 0, years[j].toString());    
       }
       for (var i = 0; i  < raw_data.length; ++i) {
         for (var j = 1; j  < raw_data[i].length; ++j) {
            data.setValue(j-1, i+1, raw_data[i][j]);    
         }
       }

       // Create and draw the visualization.
       new google.visualization.BarChart(document.getElementById( visualization )).
            draw(data,
                 {title:"Yearly Coffee Consumption by Country",
                  width:600, height:400,
                  isStacked:  true ,
                  vAxis: {title: "Year"},
                  hAxis: {title: "Cups"}}
            );
      }

感谢一席之事,让我知道我是否能够澄清任何事情。

问题回答

使用<代码>s的备选办法,为图表确定两个不同的横向轴。 将数值从图右侧延伸到-1>

www.un.org/Depts/DGACM/index_spanish.htm





相关问题
Editing legend name on an excel chart using C#

I want to edit the name of the legends given on my excel chart. Right now I have 5 Series on a chart and the legend displays the names "Series 1", "Series 2", "Series 3", "Series 4", "Series 5". I ...

Flash charts that can map/dither the data on X axis

I looked at different flash chart software (free and commercial) and could find only one that supports the feature I want: map my dataset on the predefined X axis. Let me give an example. Let s say ...

Grid Chart using GWT

Is there any library in gwt that will create grid chart, something similar to this : http://www.eyescience.com/images/vision/amsler_grid.gif. Thank you.

Microsoft .Net Chart Control not showing markers

I m using the Microsoft Chart Controls for Microsoft .NET Framework 3.5 and am having a spot of trouble getting Data Markers to show on the image. I m generating the chart at run-time, so can t just ...

Drawing 3D bar graphs using PHP?

I m looking to draw a 3d bar graph similar to the one below alt text http://techportal.co.za/article_images/image004.png My problem is that I can t seem to find any useful library that can do this ...