Hi. Simple solution is adding a field for distinguish lines to each data.
Vega can automatically group data and add color and show labels using specified field value.
[{"id":"1f906ee0.5c2161","type":"tab","label":"[Vega-Lite] Line Chart","disabled":false,"info":""},{"id":"e1975b82.6738d8","type":"ui_group","z":"","name":"Group 1","tab":"d377485b.0c8d28","order":1,"disp":false,"width":"10","collapse":false},{"id":"d377485b.0c8d28","type":"ui_tab","z":"","name":"[Vega-Lite] Line Chart","icon":"dashboard","order":6,"disabled":false,"hidden":false},{"id":"e04fbeac.c436d","type":"sqlitedb","z":"","db":"/tmp/sqlite","mode":"RWC"},{"id":"a0cc684c.322958","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED ダッシュボード","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"YYYY/MM/DD","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"82a22184.c10bf","type":"ui_vega","z":"1f906ee0.5c2161","group":"e1975b82.6738d8","name":"Line Chart","order":5,"width":"10","height":"6","vega":"","x":890,"y":240,"wires":[]},{"id":"a0950706.562aa8","type":"template","z":"1f906ee0.5c2161","name":"Vega-Lite Spec","field":"vega","fieldType":"msg","format":"json","syntax":"plain","template":"{\n \"width\": \"350\",\n \"height\": \"230\",\n \"data\": {\n \"values\": []\n },\n \"mark\": {\n \"type\": \"line\",\n \"point\": false\n },\n \"encoding\": {\n \"x\": {\n \"field\": \"year\",\n \"type\": \"ordinal\"\n },\n \"y\": {\n \"field\": \"value\",\n \"type\": \"quantitative\"\n },\n \"color\": {\n \"field\": \"country\",\n \"type\": \"nominal\"\n }\n }\n}","output":"json","x":500,"y":240,"wires":[["ab77d0a1.af305"]]},{"id":"a193f307.a7f57","type":"comment","z":"1f906ee0.5c2161","name":"↓ Display on Dashboard","info":"","x":920,"y":200,"wires":[]},{"id":"e5c1fbc9.a85cc8","type":"comment","z":"1f906ee0.5c2161","name":"↑ Add Data to Spec.","info":"","x":710,"y":280,"wires":[]},{"id":"a97da9da.b58858","type":"comment","z":"1f906ee0.5c2161","name":"↓ Visualization Spec.","info":"","x":510,"y":200,"wires":[]},{"id":"262294d6.179ecc","type":"inject","z":"1f906ee0.5c2161","name":"Initialize","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":120,"wires":[["59c18be9.57be44"]]},{"id":"677be1d0.e1bb1","type":"inject","z":"1f906ee0.5c2161","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":240,"wires":[["6b26e468.a8bdec"]]},{"id":"618cbe42.4a4b2","type":"debug","z":"1f906ee0.5c2161","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":890,"y":300,"wires":[]},{"id":"9a564739.a7e148","type":"debug","z":"1f906ee0.5c2161","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":120,"wires":[]},{"id":"ab77d0a1.af305","type":"change","z":"1f906ee0.5c2161","name":"Create Spec","rules":[{"t":"set","p":"vega.data.values","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"vega","tot":"msg"},{"t":"delete","p":"vega","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":240,"wires":[["618cbe42.4a4b2","82a22184.c10bf"]]},{"id":"6eeb270.978bdd8","type":"comment","z":"1f906ee0.5c2161","name":"↓ Read DB","info":"","x":300,"y":200,"wires":[]},{"id":"59c18be9.57be44","type":"sqlite","z":"1f906ee0.5c2161","mydb":"e04fbeac.c436d","sqlquery":"fixed","sql":"create table population(country, year, value);\n","name":"Create","x":290,"y":120,"wires":[["f84d5d95.5c099"]]},{"id":"6b26e468.a8bdec","type":"sqlite","z":"1f906ee0.5c2161","mydb":"e04fbeac.c436d","sqlquery":"fixed","sql":"select year, country, value from population;\n","name":"","x":320,"y":240,"wires":[["a0950706.562aa8"]]},{"id":"f84d5d95.5c099","type":"sqlite","z":"1f906ee0.5c2161","mydb":"e04fbeac.c436d","sqlquery":"fixed","sql":"insert into population \nvalues \n ('JP',1960,92500572),\n ('JP',1961,94943000),\n ('JP',1962,95832000),\n ('JP',1963,96812000),\n ('JP',1964,97826000),\n ('JP',1965,98883000),\n ('JP',1966,99790000),\n ('JP',1967,100725000),\n ('JP',1968,101061000),\n ('JP',1969,103172000),\n ('JP',1970,104345000),\n ('JP',1971,105697000),\n ('JP',1972,107188000),\n ('JP',1973,108079000),\n ('JP',1974,110162000),\n ('JP',1975,111940000),\n ('JP',1976,112771000),\n ('JP',1977,113863000),\n ('JP',1978,114898000),\n ('JP',1979,115870000),\n ('JP',1980,116782000),\n ('JP',1981,117648000),\n ('JP',1982,118449000),\n ('JP',1983,119259000),\n ('JP',1984,120018000),\n ('JP',1985,120754000),\n ('JP',1986,121492000),\n ('JP',1987,122091000),\n ('JP',1988,122613000),\n ('JP',1989,123116000),\n ('JP',1990,123537000),\n ('JP',1991,123921000),\n ('JP',1992,124229000),\n ('JP',1993,124536000),\n ('JP',1994,124961000),\n ('JP',1995,125439000),\n ('JP',1996,125757000),\n ('JP',1997,126057000),\n ('JP',1998,126400000),\n ('JP',1999,126631000),\n ('JP',2000,126843000),\n ('JP',2001,127149000),\n ('JP',2002,127445000),\n ('JP',2003,127718000),\n ('JP',2004,127761000),\n ('JP',2005,127773000),\n ('JP',2006,127854000),\n ('JP',2007,128001000),\n ('JP',2008,128063000),\n ('JP',2009,128047000),\n ('JP',2010,128070000),\n ('JP',2011,127833000),\n ('JP',2012,127629000),\n ('JP',2013,127445000),\n ('JP',2014,127276000),\n ('JP',2015,127141000),\n ('JP',2016,126994511),\n ('JP',2017,126785797),\n ('JP',2018,126529100),\n ('US',2018,327170000),\n ('US',2017,325150000),\n ('US',2016,323070000),\n ('US',2015,320740000),\n ('US',2014,318390000),\n ('US',2013,316060000),\n ('US',2012,313870000),\n ('US',2011,311580000),\n ('US',2010,309330000),\n ('US',2009,306770000),\n ('US',2008,304090000),\n ('US',2007,301230000),\n ('US',2006,298380000),\n ('US',2005,295520000),\n ('US',2004,292810000),\n ('US',2003,290110000),\n ('US',2002,287630000),\n ('US',2001,284970000),\n ('US',2000,282160000),\n ('US',1999,279040000),\n ('US',1998,275850000),\n ('US',1997,272650000),\n ('US',1996,269390000),\n ('US',1995,266279999),\n ('US',1994,263130000),\n ('US',1993,259920000),\n ('US',1992,256510000),\n ('US',1991,252980000),\n ('US',1990,249620000),\n ('US',1989,246820000),\n ('US',1988,244500000),\n ('US',1987,242290000),\n ('US',1986,240130000),\n ('US',1985,237920000),\n ('US',1984,235820000),\n ('US',1983,233790000),\n ('US',1982,231660000),\n ('US',1981,229470000),\n ('US',1980,227220000),\n ('US',1979,225060000),\n ('US',1978,222580000),\n ('US',1977,220240000),\n ('US',1976,218040000),\n ('US',1975,215970000),\n ('US',1974,213850000),\n ('US',1973,211910000),\n ('US',1972,209900000),\n ('US',1971,207660000),\n ('US',1970,205050000),\n ('US',1969,202680000),\n ('US',1968,200710000),\n ('US',1967,198710000),\n ('US',1966,196560000),\n ('US',1965,194300000),\n ('US',1964,191890000),\n ('US',1963,189240000),\n ('US',1962,186540000),\n ('US',1961,183690000),\n ('US',1960,180670000),\n ('UK',1960,52372500),\n ('UK',1961,52807400),\n ('UK',1962,53291800),\n ('UK',1963,53624900),\n ('UK',1964,53990800),\n ('UK',1965,54349500),\n ('UK',1966,54642700),\n ('UK',1967,54959000),\n ('UK',1968,55213500),\n ('UK',1969,55460600),\n ('UK',1970,55632200),\n ('UK',1971,55928000),\n ('UK',1972,56096000),\n ('UK',1973,56223000),\n ('UK',1974,56235000),\n ('UK',1975,56225000),\n ('UK',1976,56216000),\n ('UK',1977,56189000),\n ('UK',1978,56178000),\n ('UK',1979,56240000),\n ('UK',1980,56329000),\n ('UK',1981,56357000),\n ('UK',1982,56290000),\n ('UK',1983,56315000),\n ('UK',1984,56409000),\n ('UK',1985,56554000),\n ('UK',1986,56683000),\n ('UK',1987,56804000),\n ('UK',1988,56916000),\n ('UK',1989,57076000),\n ('UK',1990,57237000),\n ('UK',1991,57438000),\n ('UK',1992,57584000),\n ('UK',1993,57713000),\n ('UK',1994,57862000),\n ('UK',1995,58024000),\n ('UK',1996,58164000),\n ('UK',1997,58314000),\n ('UK',1998,58474000),\n ('UK',1999,58684000),\n ('UK',2000,58886000),\n ('UK',2001,59113000),\n ('UK',2002,59365000),\n ('UK',2003,59636000),\n ('UK',2004,59950000),\n ('UK',2005,60413000),\n ('UK',2006,60827000),\n ('UK',2007,61319000),\n ('UK',2008,61823000),\n ('UK',2009,62260000),\n ('UK',2010,62759000),\n ('UK',2011,63285000),\n ('UK',2012,63705000),\n ('UK',2013,64105000),\n ('UK',2014,64596000),\n ('UK',2015,65110000),\n ('UK',2016,65648000),\n ('UK',2017,66040200),\n ('UK',2018,66436000);","name":"Init","x":430,"y":120,"wires":[["9a564739.a7e148"]]}]