Template talk:Graph:MultiChart

message: 已處理：問題已經獲得解決--Poontele（留言） 2021年5月28日 (五) 06:01 (UTC)
replies: text: 下列討論已經關閉，請勿修改。如有任何意見，請至合適的討論頁進行，並不要再次編輯本討論。
----
2010-2020年宜昌市生产总值及增长速率
{"legends":[],"scales":[{"type":"ordinal","name":"x","zero":false,"domain":{"data":"chart","field":"x"},"padding":0.2,"range":"width","nice":true},{"type":"linear","name":"y","domain":{"data":"chart","field":"y"},"zero":true,"range":"height","nice":true},{"domain":{"data":"chart","field":"series"},"type":"ordinal","name":"color","range":["blue","grey"]}],"version":2,"marks":[{"type":"rect","properties":{"hover":{"fill":{"value":"red"}},"update":{"fill":{"scale":"color","field":"series"}},"enter":{"y":{"scale":"y","field":"y"},"x":{"scale":"x","field":"x"},"y2":{"scale":"y","value":0},"width":{"scale":"x","offset":-1,"band":true},"fill":{"scale":"color","field":"series"}}},"from":{"data":"chart"}},{"type":"text","properties":{"enter":{"baseline":{"value":"middle"},"align":{"value":"left"},"text":{"field":"y"},"y":{"scale":"y","offset":-4,"field":"y"},"dy":{"scale":"x","mult":0.5,"band":true},"x":{"scale":"x","field":"x"},"angle":{"value":-90},"fontSize":{"value":11},"fill":{"value":"#54595d"}}},"from":{"data":"chart"}}],"height":300,"axes":[{"type":"x","title":"年","scale":"x","format":"d","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false},{"type":"y","title":"亿元","scale":"y","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false}],"data":[{"format":{"parse":{"y":"number","x":"integer"},"type":"json"},"name":"chart","values":[{"y":1547.32,"series":"y","x":2010},{"y":2140.69,"series":"y","x":2011},{"y":2508.89,"series":"y","x":2012},{"y":2818.7,"series":"y","x":2013},{"y":3132.21,"series":"y","x":2014},{"y":3384.8,"series":"y","x":2015},{"y":3709.36,"series":"y","x":2016},{"y":3857.17,"series":"y","x":2017},{"y":4064.18,"series":"y","x":2018},{"y":4460.82,"series":"y","x":2019},{"y":4261.42,"series":"y","x":2020}]}],"width":400}
{"legends":[],"scales":[{"type":"linear","name":"x","zero":false,"domain":{"data":"chart","field":"x"},"range":"width","nice":true},{"type":"linear","name":"y","domain":{"data":"chart","field":"y"},"zero":false,"range":"height","nice":true},{"domain":{"data":"chart","field":"series"},"type":"ordinal","name":"color","range":"category10"}],"version":2,"marks":[{"type":"line","properties":{"hover":{"stroke":{"value":"red"}},"update":{"stroke":{"scale":"color","field":"series"}},"enter":{"y":{"scale":"y","field":"y"},"x":{"scale":"x","field":"x"},"stroke":{"scale":"color","field":"series"},"strokeWidth":{"value":2.5}}},"from":{"data":"chart"}},{"type":"symbol","properties":{"enter":{"y":{"scale":"y","field":"y"},"x":{"scale":"x","field":"x"},"size":{"value":50},"fill":{"scale":"color","field":"series"},"stroke":{"scale":"color","field":"series"},"shape":{"value":"circle"},"strokeWidth":{"value":0}}},"from":{"data":"chart"}}],"height":300,"axes":[{"type":"x","scale":"x","format":"d","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false},{"type":"y","scale":"y","format":"%","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false}],"data":[{"format":{"parse":{"y":"number","x":"integer"},"type":"json"},"name":"chart","values":[{"y":0.158,"series":"y1","x":2010},{"y":0.161,"series":"y1","x":2011},{"y":0.126,"series":"y1","x":2012},{"y":0.115,"series":"y1","x":2013},{"y":0.098,"series":"y1","x":2014},{"y":0.089,"series":"y1","x":2015},{"y":0.088,"series":"y1","x":2016},{"y":0.024,"series":"y1","x":2017},{"y":0.077,"series":"y1","x":2018},{"y":0.081,"series":"y1","x":2019},{"y":-0.047,"series":"y1","x":2020}]}],"width":400}
--Fxqf（留言） 2021年5月23日 (日) 06:11 (UTC)

text: 不確定現在中文區的相關module 是否支援。最快的方式是自己編寫Graph的原始碼，語法參考文件，可用Special:展开模板分別展開後再合併，並搭配Special:GraphSandbox或站外圖表測試器測試自己的圖表代碼。—- 五歲抬頭雪菲（☎️·☘️） 2021年5月24日 (一) 04:18 (UTC)
replies: text: :範例：
2010-2020年宜昌市生产总值及增长速率
{"legends":[],"scales":[{"type":"ordinal","name":"x1","zero":false,"domain":{"data":"chart1","field":"x"},"padding":0.2,"range":"width","nice":true},{"type":"linear","name":"y1","domain":{"data":"chart1","field":"y"},"zero":true,"range":"height","nice":true},{"domain":{"data":"chart1","field":"series"},"type":"ordinal","name":"color1","range":["blue","grey"]},{"type":"linear","name":"x","zero":false,"domain":[2009,2021],"range":"width","nice":true},{"type":"linear","name":"y","domain":{"data":"chart2","field":"y"},"zero":false,"range":"height","nice":true},{"domain":{"data":"chart2","field":"series"},"type":"ordinal","name":"color","range":"category10"}],"version":2,"marks":
[{"type":"rect","properties":{"hover":{"fill":{"value":"red"}},"update":{"fill":{"scale":"color1","field":"series"}},"enter":{"y":{"scale":"y1","field":"y"},"x":{"scale":"x1","field":"x"},"y2":{"scale":"y1","value":0},"width":{"scale":"x1","offset":-1,"band":true},"fill":{"scale":"color1","field":"series"}}},"from":{"data":"chart1"}},{"type":"text","properties":{"enter":{"baseline":{"value":"middle"},"align":{"value":"left"},"text":{"field":"y"},"y":{"scale":"y1","offset":-4,"field":"y"},"dy":{"scale":"x1","mult":0.5,"band":true},"x":{"scale":"x1","field":"x"},"angle":{"value":-90},"fontSize":{"value":11},"fill":{"value":"#54595d"}}},"from":{"data":"chart1"}},{"type":"line","properties":{"hover":{"stroke":{"value":"red"}},"update":{"stroke":{"scale":"color","field":"series"}},"enter":{"y":{"scale":"y","field":"y"},"x":{"scale":"x","field":"x"},"stroke":{"scale":"color","field":"series"},"strokeWidth":{"value":2.5}}},"from":{"data":"chart2"}},{"type":"symbol","properties":{"enter":{"y":{"scale":"y","field":"y"},"x":{"scale":"x","field":"x"},"size":{"value":50},"fill":{"scale":"color","field":"series"},"stroke":{"scale":"color","field":"series"},"shape":{"value":"circle"},"strokeWidth":{"value":0}}},"from":{"data":"chart2"}}]
,"height":300,"axes":[{"type":"x","title":"年","scale":"x1","format":"d","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false},{"type":"y","title":"亿元","scale":"y1","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false},{"type":"y","scale":"y","format":"%","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false,"orient": "right"}],
"data":[{"format":{"parse":{"y":"number","x":"integer"},"type":"json"},"name":"chart1","values":[{"y":1547.32,"series":"y","x":2010},{"y":2140.69,"series":"y","x":2011},{"y":2508.89,"series":"y","x":2012},{"y":2818.7,"series":"y","x":2013},{"y":3132.21,"series":"y","x":2014},{"y":3384.8,"series":"y","x":2015},{"y":3709.36,"series":"y","x":2016},{"y":3857.17,"series":"y","x":2017},{"y":4064.18,"series":"y","x":2018},{"y":4460.82,"series":"y","x":2019},{"y":4261.42,"series":"y","x":2020}]},{"format":{"parse":{"y":"number","x":"integer"},"type":"json"},"name":"chart2","values":[{"y":0.158,"series":"y1","x":2010},{"y":0.161,"series":"y1","x":2011},{"y":0.126,"series":"y1","x":2012},{"y":0.115,"series":"y1","x":2013},{"y":0.098,"series":"y1","x":2014},{"y":0.089,"series":"y1","x":2015},{"y":0.088,"series":"y1","x":2016},{"y":0.024,"series":"y1","x":2017},{"y":0.077,"series":"y1","x":2018},{"y":0.081,"series":"y1","x":2019},{"y":-0.047,"series":"y1","x":2020}]}]
,"width":400}

text: -- 五歲抬頭雪菲（☎️·☘️） 2021年5月24日 (一) 04:55 (UTC)
*(：)回應以上操作對於您來說可能過於複雜，因此我把它寫成了一個Lua腳本Module:Graph:MultiChart，希望能更方便使用。使用方法：
你所看到的                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	你所輸入的
{"legends":[],"scales":[{"type":"ordinal","name":"x1","zero":false,"domain":{"data":"chart1","field":"x"},"padding":0.2,"range":"width","nice":true},{"type":"linear","zero":true,"name":"y1","domain":{"data":"chart1","field":"y"},"range":"height","nice":true},{"name":"color1","type":"ordinal","range":["blue","grey"],"domain":{"data":"chart1","field":"series"}},{"clamp":true,"type":"linear","zero":false,"range":"width","nice":true,"name":"x2","domainMax":2020.5,"domainMin":2009.5,"domain":{"data":"chart2","field":"x"}},{"type":"linear","zero":false,"name":"y2","domain":{"data":"chart2","field":"y"},"range":"height","nice":true},{"name":"color2","type":"ordinal","range":"category10","domain":{"data":"chart2","field":"series"}}],"version":2,"marks":[{"type":"rect","properties":{"hover":{"fill":{"value":"red"}},"update":{"fill":{"scale":"color1","field":"series"}},"enter":{"y":{"scale":"y1","field":"y"},"x":{"scale":"x1","field":"x"},"y2":{"scale":"y1","value":0},"width":{"band":true,"scale":"x1","offset":-1},"fill":{"scale":"color1","field":"series"}}},"from":{"data":"chart1"}},{"type":"text","properties":{"enter":{"baseline":{"value":"middle"},"align":{"value":"left"},"text":{"field":"y"},"y":{"scale":"y1","offset":-4,"field":"y"},"dy":{"scale":"x1","mult":0.5,"band":true},"x":{"scale":"x1","field":"x"},"angle":{"value":-90},"fontSize":{"value":11},"fill":{"value":"#54595d"}}},"from":{"data":"chart1"}},{"type":"line","properties":{"hover":{"stroke":{"value":"red"}},"update":{"stroke":{"scale":"color2","field":"series"}},"enter":{"y":{"scale":"y2","field":"y"},"x":{"scale":"x2","field":"x"},"stroke":{"scale":"color2","field":"series"},"strokeWidth":{"value":2.5}}},"from":{"data":"chart2"}},{"type":"symbol","properties":{"enter":{"y":{"scale":"y2","field":"y"},"x":{"scale":"x2","field":"x"},"size":{"value":50},"fill":{"scale":"color2","field":"series"},"stroke":{"scale":"color2","field":"series"},"shape":{"value":"circle"},"strokeWidth":{"value":0}}},"from":{"data":"chart2"}}],"height":300,"axes":[{"type":"x","title":"年","scale":"x1","format":"d","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false},{"type":"y","title":"亿元","scale":"y1","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false},{"orient":"right","type":"y","scale":"y2","format":"%","properties":{"title":{"fill":{"value":"#54595d"}},"grid":{"stroke":{"value":"#54595d"}},"ticks":{"stroke":{"value":"#54595d"}},"axis":{"strokeWidth":{"value":2},"stroke":{"value":"#54595d"}},"labels":{"fill":{"value":"#54595d"}}},"grid":false}],"data":[{"format":{"parse":{"y":"number","x":"integer"},"type":"json"},"name":"chart1","values":[{"y":1547.32,"series":"y","x":2010},{"y":2140.69,"series":"y","x":2011},{"y":2508.89,"series":"y","x":2012},{"y":2818.7,"series":"y","x":2013},{"y":3132.21,"series":"y","x":2014},{"y":3384.8,"series":"y","x":2015},{"y":3709.36,"series":"y","x":2016},{"y":3857.17,"series":"y","x":2017},{"y":4064.18,"series":"y","x":2018},{"y":4460.82,"series":"y","x":2019},{"y":4261.42,"series":"y","x":2020}]},{"format":{"parse":{"y":"number","x":"integer"},"type":"json"},"name":"chart2","values":[{"y":0.158,"series":"y1","x":2010},{"y":0.161,"series":"y1","x":2011},{"y":0.126,"series":"y1","x":2012},{"y":0.115,"series":"y1","x":2013},{"y":0.098,"series":"y1","x":2014},{"y":0.089,"series":"y1","x":2015},{"y":0.088,"series":"y1","x":2016},{"y":0.024,"series":"y1","x":2017},{"y":0.077,"series":"y1","x":2018},{"y":0.081,"series":"y1","x":2019},{"y":-0.047,"series":"y1","x":2020}]}],"width":400}   	
replies: text: :-- 五歲抬頭雪菲（☎️·☘️） 2021年5月25日 (二) 05:42 (UTC)
replies: text: ::@-{A2569875}-：非常感谢！--Fxqf（留言） 2021年5月25日 (二) 10:59 (UTC)
----

text: 本討論已經關閉，請勿修改。如有任何意見，請至合適的討論頁進行，並不要再次編輯本討論。
thread_title:  柱状图、折线图如何合并成一个图？