|
|
|
Google Charts . Кто умеет строить несколько графиков в одной сист. координат ?
|
|||
|---|---|---|---|
|
#18+
собственно вопрос в наименовании темы. Как это делается ? особо ведь нигде не документировано явно. 2 графика есть в примере "Area Chart" , переделал его в тот что мне нужно : Код: javascript 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. но не подходит по причине того что у 2 - х графиков могут быть разные абсциссы. а в данном случае табличное представление задаёт именно одинаковые абсциссы. То есть в примере выше данные идут так , что у одного есть точка ((2006, 1, 28, 10,30,01) , 100), а у другого ((2006, 1, 28, 10,30,01), 200). а как сделать , что скажем у одного точка ((2006, 1, 28, 10,30,01) , 100) имеется , а другово с абсциссой x=(2006, 1, 28, 10,30,01) точки нет ? если кто понял вопрос )))) и есть альтруистическое желание помочь подскажите, пожалуйста ;) Модератор: Тема перенесена из форума "Java". ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.05.2012, 10:37:51 |
|
||
|
Google Charts . Кто умеет строить несколько графиков в одной сист. координат ?
|
|||
|---|---|---|---|
|
#18+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns=" http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <script type="text/javascript" src=" http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1', {packages: ['corechart']}); </script> <script type="text/javascript"> function drawVisualization() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Fill up'); data.addColumn('number', 'Gallons'); data.addColumn({type:'string', role:'tooltip'}); data.addColumn('number', 'MPG'); data.addColumn({type:'string', role:'tooltip'}); data.addColumn('number', 'Mileage'); data.addColumn({type:'string', role:'tooltip'}); data.addRows([ ['05/24', 13.92, 'Fill up: 05/24\nGalons: 13.92\nMPG: 19.7\nMileage: 7124\nStation: Shell', 13.99, 'Fill up: 05/24\nGalons: 13.92\nMPG: 19.7\nMileage: 7124\nStation: Shell', 7.67, 'Fill up: 05/24\nGalons: 13.92\nMPG: 19.7\nMileage: 7124\nStation: Shell'], ['06/07', 10.70, 'Fill up: 06/07\nGalons: 10.70\nMPG: 19.5\nMileage: 7333\nStation: BP', 13.85, 'Fill up: 06/07\nGalons: 10.70\nMPG: 19.5\nMileage: 7333\nStation: BP', 7.89, 'Fill up: 06/07\nGalons: 10.70\nMPG: 19.5\nMileage: 7333\nStation: BP'], ['06/23', 15.39, 'Fill up: 06/23\nGalons: 15.39\nMPG: 19.9\nMileage: 7640\nStation: BP', 14.13, 'Fill up: 06/23\nGalons: 15.39\nMPG: 19.9\nMileage: 7640\nStation: BP', 8.22, 'Fill up: 06/23\nGalons: 15.39\nMPG: 19.9\nMileage: 7640\nStation: BP'], ['06/28', 12.80, 'Fill up: 06/28\nGalons: 12.80\nMPG: 19.1\nMileage: 7884\nStation: TNK', 13.56, 'Fill up: 06/28\nGalons: 12.80\nMPG: 19.1\nMileage: 7884\nStation: TNK', 8.48, 'Fill up: 06/28\nGalons: 12.80\nMPG: 19.1\nMileage: 7884\nStation: TNK'], ['07/05', 14.73, 'Fill up: 07/05\nGalons: 14.73\nMPG: 17.5\nMileage: 8142\nStation: John&John', 12.43, 'Fill up: 07/05\nGalons: 14.73\nMPG: 17.5\nMileage: 8142\nStation: John&John', 8.76, 'Fill up: 07/05\nGalons: 14.73\nMPG: 17.5\nMileage: 8142\nStation: John&John'], ['07/05', 7.67, 'Fill up: 07/05\nGalons: 7.67\nMPG: 18.9\nMileage: 8287\nStation: Steve Best Gas', 13.42, 'Fill up: 07/05\nGalons: 7.67\nMPG: 18.9\nMileage: 8287\nStation: Steve Best Gas', 8.92, 'Fill up: 07/05\nGalons: 7.67\nMPG: 18.9\nMileage: 8287\nStation: Steve Best Gas'] ]); // Create and draw the visualization. new google.visualization.ColumnChart(document.getElementById('visualization')). draw(data, { chartArea:{left:30,top:20,width:"100%",height:"75%"}, //title:"Fill up chart", hAxis: {title: "Fill up"}, vAxis: {title: "Gallons"}, width:320, height:335, seriesType: "bars", legend: {position: "in"}, series: { 0: {pointSize: 5}, 1: {type: "line", pointSize: 5}, 2: {type: "line", pointSize: 10}} } ); } google.setOnLoadCallback(drawVisualization); </script> </head> <body style="font-family: Arial;border: 0 none;"> <div id="visualization"></div> </body> </html> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.07.2012, 17:45:37 |
|
||
|
Google Charts . Кто умеет строить несколько графиков в одной сист. координат ?
|
|||
|---|---|---|---|
|
#18+
оффавторМодератор: Тема перенесена из форума "Java". Тьфу-ты! Я уже было поверил, что на форуме про яву модератор, наконец-то, появился. А это оказывается аж с 10-го мая. :( ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.07.2012, 20:34:43 |
|
||
|
Google Charts . Кто умеет строить несколько графиков в одной сист. координат ?
|
|||
|---|---|---|---|
|
#18+
akim2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns=" http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <script type="text/javascript" src=" http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1', {packages: ['corechart']}); </script> <script type="text/javascript"> function drawVisualization() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Fill up'); data.addColumn('number', 'Gallons'); data.addColumn({type:'string', role:'tooltip'}); data.addColumn('number', 'MPG'); data.addColumn({type:'string', role:'tooltip'}); data.addColumn('number', 'Mileage'); data.addColumn({type:'string', role:'tooltip'}); data.addRows([ ['05/24', 13.92, 'Fill up: 05/24\nGalons: 13.92\nMPG: 19.7\nMileage: 7124\nStation: Shell', 13.99, 'Fill up: 05/24\nGalons: 13.92\nMPG: 19.7\nMileage: 7124\nStation: Shell', 7.67, 'Fill up: 05/24\nGalons: 13.92\nMPG: 19.7\nMileage: 7124\nStation: Shell'], ['06/07', 10.70, 'Fill up: 06/07\nGalons: 10.70\nMPG: 19.5\nMileage: 7333\nStation: BP', 13.85, 'Fill up: 06/07\nGalons: 10.70\nMPG: 19.5\nMileage: 7333\nStation: BP', 7.89, 'Fill up: 06/07\nGalons: 10.70\nMPG: 19.5\nMileage: 7333\nStation: BP'], ['06/23', 15.39, 'Fill up: 06/23\nGalons: 15.39\nMPG: 19.9\nMileage: 7640\nStation: BP', 14.13, 'Fill up: 06/23\nGalons: 15.39\nMPG: 19.9\nMileage: 7640\nStation: BP', 8.22, 'Fill up: 06/23\nGalons: 15.39\nMPG: 19.9\nMileage: 7640\nStation: BP'], ['06/28', 12.80, 'Fill up: 06/28\nGalons: 12.80\nMPG: 19.1\nMileage: 7884\nStation: TNK', 13.56, 'Fill up: 06/28\nGalons: 12.80\nMPG: 19.1\nMileage: 7884\nStation: TNK', 8.48, 'Fill up: 06/28\nGalons: 12.80\nMPG: 19.1\nMileage: 7884\nStation: TNK'], ['07/05', 14.73, 'Fill up: 07/05\nGalons: 14.73\nMPG: 17.5\nMileage: 8142\nStation: John&John', 12.43, 'Fill up: 07/05\nGalons: 14.73\nMPG: 17.5\nMileage: 8142\nStation: John&John', 8.76, 'Fill up: 07/05\nGalons: 14.73\nMPG: 17.5\nMileage: 8142\nStation: John&John'], ['07/05', 7.67, 'Fill up: 07/05\nGalons: 7.67\nMPG: 18.9\nMileage: 8287\nStation: Steve Best Gas', 13.42, 'Fill up: 07/05\nGalons: 7.67\nMPG: 18.9\nMileage: 8287\nStation: Steve Best Gas', 8.92, 'Fill up: 07/05\nGalons: 7.67\nMPG: 18.9\nMileage: 8287\nStation: Steve Best Gas'] ]); // Create and draw the visualization. new google.visualization.ColumnChart(document.getElementById('visualization')). draw(data, { chartArea:{left:30,top:20,width:"100%",height:"75%"}, //title:"Fill up chart", hAxis: {title: "Fill up"}, vAxis: {title: "Gallons"}, width:320, height:335, seriesType: "bars", legend: {position: "in"}, series: { 0: {pointSize: 5}, 1: {type: "line", pointSize: 5}, 2: {type: "line", pointSize: 10}} } ); } google.setOnLoadCallback(drawVisualization); </script> </head> <body style="font-family: Arial;border: 0 none;"> <div id="visualization"></div> </body> </html> это не то что мне надо. я же говорил. у тебя во всех контрольных точках на всех 3 графиках абсциссы одинаковые. а мне надо , чтобы разные были. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.07.2012, 22:12:40 |
|
||
|
|

start [/forum/topic.php?fid=22&msg=37878938&tid=1449580]: |
0ms |
get settings: |
8ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
172ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
40ms |
get tp. blocked users: |
1ms |
| others: | 215ms |
| total: | 462ms |

| 0 / 0 |
