google / google-visualization-issues

288 stars 35 forks source link

Display data labels by default #963

Open orwant opened 9 years ago

orwant commented 9 years ago
What would you like to see us add to this API?

Currently, data is only displayed in charts by a tooltip triggered by a mouse-hover.

It would be great to have the ability to display these values at once  so that the
user does not have to hover. Much like a pie chart where the percentage of a wedge
in pie can be displayed, I'd like to see all the values of all points in my line chart,
bar chart, or even the total sum of a column in a stacked column chart.

What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?

All charts.
*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by jmr.julian on 2012-07-17 03:11:51

orwant commented 9 years ago
Having the same issue...

Original issue reported on code.google.com by marketing@yourshare.com.au on 2012-09-06 03:32:40

orwant commented 9 years ago
was there any option in Google charts for data labels to be displayed on bars. if any
options please post the code. for me the issue is related in column charts

Original issue reported on code.google.com by satti.sss on 2013-01-17 11:25:45

orwant commented 9 years ago
I wrote a hack that end-routes the problem of not being able to use annotations in ColumnCharts,
which can be adapted to serve as bar labels: http://jsfiddle.net/asgallant/QjQNX/.
 It's not a perfect solution, but it may fit your needs until the dev team adds support.

Original issue reported on code.google.com by drew_gallant@abtassoc.com on 2013-01-17 18:09:08

orwant commented 9 years ago
Thanks for the reply....for a single bar it was displaying values.is it possible for
showing labels for multiple or more bars??

Original issue reported on code.google.com by satti.sss on 2013-01-18 06:29:40

orwant commented 9 years ago
That will display labels for all bars in a single series (if you set the annotations
in the DataTable).  Doing multiple series might prove to be impractical, given the
method I had to use to make this work.  Maybe it would work if they were stacked columns?

Original issue reported on code.google.com by drew_gallant@abtassoc.com on 2013-01-18 17:06:04

orwant commented 9 years ago
hi,
i am having this requirement for multiple series. 
on googling on this task i have found this google chart once check out the URL: https://code.google.com/apis/ajax/playground/?type=visualization#image_bar_chart
in this example also data labels are displaying for only single series. if multiple
series values are given then multiple bars are displaying but labels on the bars are
showing for only series,by setting this index property we can choose labels to be display
on which series( var index = 0 or 1;)..........if any ideas or examples you found on
this issue then please post it...Thank you

Original issue reported on code.google.com by satti.sss on 2013-01-21 07:01:05

orwant commented 9 years ago
hi,

http://jsfiddle.net/3mYbp/ this was the solution for lables on bars. if any one searching
for this issue go through this link

Original issue reported on code.google.com by satti.sss on 2013-01-23 08:09:15

orwant commented 9 years ago
That works for ImageCharts, but not for the interactive charts.

Original issue reported on code.google.com by drew_gallant@abtassoc.com on 2013-01-23 18:27:39

orwant commented 9 years ago
Hello,
I am using google donut chart for display information. i want to customize like: http://screencast.com/t/48YVPc7R8DM
, please help me.

Here is my code:

<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">

      // Load the Visualization API and the piechart package.
      google.load('visualization', '1.0', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.setOnLoadCallback(drawChart);

      // Callback that creates and populates a data table, 
      // instantiates the pie chart, passes in the data and
      // draws it.
      function drawChart() {

      // Create the data table.
     // var data = new google.visualization.DataTable();
    var data = new google.visualization.DataTable(
     {
       cols: [{id: 'task', label: 'Task', type: 'string'},
                {id: 'hours', label: 'Hours per Day', type: 'number'}],
       rows: [{c:[{v: 'Work'}, {v: 11}]},
              {c:[{v: 'Eat'}, {v: 2}]},
              {c:[{v: 'Commute'}, {v: 2}]},
              {c:[{v: 'Watch TV'}, {v:2}]},
              {c:[{v: 'Sleep'}, {v:7, f:'7.000'}]}
             ]
     },
   0.6
)

      // Set chart options
      var options = {
                             'legend':'left',
  'title':'My Big Pie Chart',
  'is3D':true,
  'chartArea':{left:70,top:40,width:"50%",height:"75%",left:true},
  'pieSliceBorderColor':'red',
  'width':400,
  'height':300
  };

      // Instantiate and draw our chart, passing in some options.
      var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
      chart.draw(data, options);
    }
    </script>
  </head>

  <body>
<!--Div that will hold the pie chart-->
    <div id="chart_div" style="width:400; height:300"></div>
  </body>
</html>s

Thanks

Original issue reported on code.google.com by gurpreetk@swiftsetup.com on 2013-09-05 08:12:21

orwant commented 9 years ago
gurpreetk, you should say which aspects of the image you linked to are what you are
interested in.  Is it the labels, which is the subject of this thread?  If so, there
is an undocumented 'legend': { 'position': 'labeled' } option that might work for you.

Original issue reported on code.google.com by dlaliberte@google.com on 2013-09-10 18:54:39

orwant commented 9 years ago
Hi,
Having the same issue. not able to display data label for stacked column chart.please
help me out from this issue. 

Thanks,
Suja Arjunan

Original issue reported on code.google.com by suja.grt on 2013-10-09 04:54:06