Legend Text not showing

246 views
Skip to first unread message

Chip Davis

unread,
Jul 28, 2016, 2:32:22 PM7/28/16
to Google Visualization API
I have built a chart with this (see just below).....and I get the image at the bottom...legend text is not showing....stopped suddenly.  What is the issue?

 var RRR = new google.visualization.ChartWrapper({
          'chartType': 'ComboChart',
          'containerId': 'RevenueRunRate',
          'options': {
          'explorer': { actions: ['dragToZoom', 'rightClickToReset'] },
            'focusTarget': 'category',
            'width': 400,
            'height': 300,
            'hAxis': {direction: 1, bold: true, format: 'MMM-yy'},
            'legend': { position: 'bottom', maxLines: 3 },
            'title': 'Growth: (Revenue Run Rate & Bookings)',
            'tooltipWidth':35,
            'tooltipHeight':35,
            'tooltipFontSize':10,
            'seriesType': 'area',
            'vAxes': {
                      0: {title:'Bookings', format: '$#,###',textStyle: {color: '#707B7C'}},
                      1: {title: 'Revenue Run Rate',format: '$#,###',textStyle: {color: '#2E86C1'}}
                      },
            'series': {0: {type: 'line'}},
            'series': {0: {targetAxisIndex:0, type: 'area'},
                       1: {targetAxisIndex:1, type: 'line', lineWidth: 5,curveType: 'function', lineDashStyle: [8,2] }
                        },
                      
            'colors': ['#707B7C', '#2E86C1'],
            'animation': {
                    
                    duration: 1000,
                    easing: 'inAndOut'
                },
           
            
          },
          view: {
            columns: [5,20,6]
        },
            
      
        }
        );


Daniel LaLiberte

unread,
Jul 28, 2016, 3:19:36 PM7/28/16
to Google Visualization API
Chip,

I see you have two 'series' options.  In JS, there can only be one property in an object with the same name, and which one you end up with depends on random aspects of how JS decides to build the object.  

I don't know that this would cause what you are seeing, but you didn't provide your data, which could make more of a difference regarding the legend text, which comes from the column label.  Also, which version are you using?  How are you loading the library?  Thanks.

--
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-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@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/54afbc31-65e7-4666-b903-fe0640ba7a21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Chip Davis

unread,
Aug 1, 2016, 5:22:41 PM8/1/16
to Google Visualization API
loader:
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
  google.load('visualization', '1', {'packages':['controls']});
  google.setOnLoadCallback(drawVisualization);

Chip Davis

unread,
Aug 1, 2016, 5:24:30 PM8/1/16
to Google Visualization API
and cleaned up this: (I think)...
// Create a column chart, passing some options
        var RRR = new google.visualization.ChartWrapper({
          'chartType': 'ComboChart',
          'containerId': 'RevenueRunRate',
          'options': {
          'explorer': { actions: ['dragToZoom', 'rightClickToReset'] },
            'focusTarget': 'category',
            'width': 400,
            'height': 300,
            'hAxis': {direction: 1, bold: true, format: 'MMM-yy'},
            'title': 'Growth: (Revenue Run Rate & Bookings)',
            'tooltipWidth':35,
            'tooltipHeight':35,
            'tooltipFontSize':10,
            
            'vAxes': {
                      0: {title:'Bookings', format: '$#,###',textStyle: {color: '#707B7C'}},
                      1: {title: 'Revenue Run Rate',format: '$#,###',textStyle: {color: '#2E86C1'}}
                      },
            
            'series': {0: {targetAxisIndex:0, type: 'area', color: '#707B7C', legend: {position:'bottom' }},
                       1: {targetAxisIndex:1, type: 'line', lineWidth: 5,curveType: 'function', lineDashStyle: [8,2], color:'#2E86C1', legend: 'bottom' }
                        },
                      
            
            'animation': {
                    
                    duration: 1000,
                    easing: 'inAndOut'
                },
           
            
          },
          view: {
            columns: [5,20,6]
        },
            
      
        }
        );

On Thursday, July 28, 2016 at 1:32:22 PM UTC-5, Chip Davis wrote:
Reply all
Reply to author
Forward
0 new messages