I am a tester and my company is using IBM cognos for creating dashbaords. These dashboards have many graphs and charts which can be customized by the user as per their need. Dashboards are built using Vertica database and for my manual testing, I am comparing the data displayed on the dashboard with Vertica database using SQL queries. I need to automate this testing process for which I tried to use selenium but I was facing issues with writing xpaths or CSS selectors for charts and graphs.
Given that your main objective is to compare dashboard data and database data, API testing seems to be more appropriate (cost effective and efficient) methodology for automation testing. Consider using tools like Postman, or may be creating some internal API library/tool (if feasible). Maybe, at a later stage you may consider using selenium (but) only for the purpose of UI testing. That is only for validating whether graphs displayed are correct, hence creating more appropriate software testing solutions. The following link may be helpful,