Combo Chart - Line can be started from 0 point and end to last point?

32 views
Skip to first unread message

Muhammad Liaquat

unread,
Feb 24, 2016, 11:04:22 AM2/24/16
to Google Visualization API
I have tried to update many option and data but couldn't render chart as expected (screenshot attached)

chart otpion.png

Daniel LaLiberte

unread,
Feb 24, 2016, 11:25:45 AM2/24/16
to Google Visualization API
Your data does not correspond to what you are trying to draw.  This is closer:  http://jsfiddle.net/vmb4odkt/14/

You don't need the extra column for the extensions of the line, since you can add them to the series 1 line.

On Wed, Feb 24, 2016 at 11:04 AM, Muhammad Liaquat <muhammad...@gmail.com> wrote:
I have tried to update many option and data but couldn't render chart as expected (screenshot attached)

--
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/00007b68-7935-4ffa-8303-e6cd4865d234%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Muhammad Liaquat

unread,
Feb 24, 2016, 11:45:05 AM2/24/16
to Google Visualization API
I have to make data as below

var data = google.visualization.arrayToDataTable([ 

['Name', 'Average Level', 'District Average'], 

['ABC', 3, 3.89771634615385],
['DEF', 5, 3.89771634615385],
['GHI', 4.5, 3.89771634615385],
['JKL', 3.1, 3.89771634615385]


On Wednesday, 24 February 2016 21:25:45 UTC+5, Daniel LaLiberte wrote:
Your data does not correspond to what you are trying to draw.  This is closer:  http://jsfiddle.net/vmb4odkt/14/

You don't need the extra column for the extensions of the line, since you can add them to the series 1 line.
On Wed, Feb 24, 2016 at 11:04 AM, Muhammad Liaquat <muhammad...@gmail.com> wrote:
I have tried to update many option and data but couldn't render chart as expected (screenshot attached)

--
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-visualization-api+unsub...@googlegroups.com.



--

Daniel LaLiberte

unread,
Feb 24, 2016, 11:56:41 AM2/24/16
to Google Visualization API
Since you want strings for your Name column, it would probably be easiest to actually keep using numbers, but also use the 'ticks' option like this: 
        hAxis: { 
          viewWindow: { min: 0, max: 6 },
          ticks: [{v: 1, f: 'ABC'}, {v: 3, f: 'DEF'}, {v: 5, f: 'GHI'}]
        },


On Wed, Feb 24, 2016 at 11:45 AM, Muhammad Liaquat <muhammad...@gmail.com> wrote:
I have to make data as below

var data = google.visualization.arrayToDataTable([ 

['Name', 'Average Level', 'District Average'], 

['ABC', 3, 3.89771634615385],
['DEF', 5, 3.89771634615385],
['GHI', 4.5, 3.89771634615385],
['JKL', 3.1, 3.89771634615385]

]);

http://jsfiddle.net/vmb4odkt/14/

On Wednesday, 24 February 2016 21:25:45 UTC+5, Daniel LaLiberte wrote:
Your data does not correspond to what you are trying to draw.  This is closer:  http://jsfiddle.net/vmb4odkt/14/

You don't need the extra column for the extensions of the line, since you can add them to the series 1 line.
On Wed, Feb 24, 2016 at 11:04 AM, Muhammad Liaquat <muhammad...@gmail.com> wrote:
I have tried to update many option and data but couldn't render chart as expected (screenshot attached)

--
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.



--

--
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.

For more options, visit https://groups.google.com/d/optout.



--

Muhammad Liaquat

unread,
Feb 24, 2016, 12:00:37 PM2/24/16
to Google Visualization API
If i am load data dynamically then I will use V: odd series?
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.



--

--
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-visualization-api+unsub...@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.



--

Daniel LaLiberte

unread,
Feb 24, 2016, 12:03:51 PM2/24/16
to Google Visualization API
If you are loading different data each time, then you will have to compute the ticks array from your data by some means.  You'll also have to determine the viewWindow.max from the number of rows.  Whether you use odd values for where your names go is up to you.

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.



--

--
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.



--

--
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.

For more options, visit https://groups.google.com/d/optout.



--

Muhammad Liaquat

unread,
Feb 25, 2016, 12:43:14 PM2/25/16
to Google Visualization API
I have tried this data loaded from database, given error (screenshot attached) + same code attached

var data=[

   ['CategoryId','CategoryName','ProductName','BarAverage','LineAvergage', { role: 'style' }, { role: 'tooltip' }],
   
   [1,'Air Fresheners','Febreze NOTICEables GAIN Dual Scented Oils',3,8,'',''],
   [1,'Air Fresheners','Febreze Fabric Refresher Free Nature',3,8,'',''],
   [1,'Air Fresheners','Fresh Wave Super Gel',3,8,'',''],
   [1,'Air Fresheners','Pure Citrus Orange Air Freshener',3,8,'',''],
   [1,'Air Fresheners','Air Wick Freshmatic Ultra',3,8,'',''],

   [2,'Beverages','Coca Cola',3,8,'',''],
   [2,'Beverages','Fanta',3,8,'',''],
   [2,'Beverages','Nestea Lemon',3,8,'',''],
   [2,'Beverages','Cappy Apple',3,8,'',''],
   [2,'Beverages','Fanta',3,8,'',''],
   [2,'Beverages','Hennessy',3,8,'',''],


   [3,'Cakes','Nut and Frangipan Bar',3,8,'',''],
   [3,'Cakes','Oats and Nutella Cookie',3,8,'',''],
   [3,'Cakes','Granola Bar',3,8,'','']


]

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.



--

--
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-visualization-api+unsub...@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.



--

--
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-visualization-api+unsub...@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.



--
Error-1.png
ComboChart.html

Daniel LaLiberte

unread,
Feb 25, 2016, 1:22:13 PM2/25/16
to Google Visualization API
Your data has a first column that is numbers, then 2 string columns.  How are you expecting to use this with ComboChart?   Here is the documentation on the data format expected for ComboChart:  https://google-developers.appspot.com/chart/interactive/docs/gallery/combochart#data-format

Basically, you can have a first column of strings, but the rest have to be numbers, unless you have role columns for tooltips or styles interspersed.

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.



--

--
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.



--

--
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.



--

--
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.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages