In 2013, with the introduction of the Transparency Law in Spain, a number of Spanish newsrooms started working with data journalism methods. In Sweden, which has one of the oldest Freedom of Information acts in the world, newsrooms invested in the skill development of data journalism at approximately the same time. Because previous research suggests that access to public data has been one of the key driving forces for the development of data journalism worldwide, it is important to understand how legislation is actually shaping the practice of data journalism. Based on a survey of 66 key informants in Spain and Sweden and ten in-depth interviews with data journalists from five media companies in each country, we conducted a comparative study, building on the frameworks of media systems to explore data journalism practices in these two countries. The differences found indicate that the national and EU legislation in both nations shape journalistic strategies for accessing data, turning journalists at times into activists fighting for the right to access public data. Beyond the law, data journalists advocate for a transparency culture among the civil servants, in order to secure public accountability.