First, line chart is not the best choice here. Line charts are first of all to show some process in time, that is the X-axis is for a time dimension (day, month, year, millisecond...). What information the line chart shows when the Product is the dimension?
Second, if you have millions of dimension values on chart, it will be slow.
I can't guess what exactly you trying to do and why, but you need to re-consider the way you present the data. Anyway, look at this bar chart. Here the dimension is using class() function, and expression is avg(). Performance is fine with your sample data. App is attached.