Intervals must be associated with data, but you can make the data invisible by using a 'style' role and setting the color to none.
On Mon, Feb 6, 2017 at 9:24 AM, Luis Henrique Uchida Ishivatari < [email protected]> wrote: > Hello, > > Is there a way to put an Interval data without data from a line chart? Or > put this Interval outside the chart? (A poorly drawn example below) > > Sample code I'm using: > > <html> > <head> > <script type="text/javascript" src="https://www.gstatic.com/ > charts/loader.js"></script> > > <script> > google.charts.load('current', {'packages':['corechart']}); > google.charts.setOnLoadCallback(drawBasic); > > function drawBasic() { > > var data = new google.visualization.DataTable(); > data.addColumn('string', 'Month'); // Implicit domain column. > data.addColumn('number', 'Sales'); // Implicit data column. > data.addColumn({type:'number', role:'interval'}); > data.addColumn({type:'number', role:'interval'}); > data.addColumn({type:'number', role:'interval'}); > data.addColumn('number', 'Expenses'); > data.addRows([ > ['April', 1000, 900, 1000, 1100, 400], > ['May' , 1170, 1000, 1170, 1200, 460], > ['June' , 660 , 550, 660 , 800 , 1120], > ['July' , 1030, 950, 1030, 1080, 540], > ['' , null, 1010, 1070, 850 , null] //this interval doesn't show, > unless I add a value for 'Sales' column > ]); > > var chart = new google.visualization.LineChart( > document.getElementById('visualization')); > chart.draw(data, > {width: 800, height: 600, title: 'Company Performance'}); > > } > </script> > </head> > <body> > <div id="visualization"></div> > </body> > </html> > > > > <https://lh3.googleusercontent.com/-oHw2PL2NvnU/WJiFZWaSjpI/AAAAAAAAAJA/ER-b8HoDtLkaE2CXcC_Rv8-GLmM9A1oMwCLcB/s1600/interval_question.png> > > > > > > > > > > > > > > > > > > > > > > > > -- > 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/6f22f3ff-2698-4e9c-a5ca- > 9fe9ce853402%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/6f22f3ff-2698-4e9c-a5ca-9fe9ce853402%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge MA -- 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/CAOtcSJOMPxY0XWftr%3DmS1CwvVmyJV%3DLzibNacQXVr%3D6gfS8Jnw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
