
\pgfplotstableread[col sep=comma]{results/aggregated.csv}\aggregateddata

\begin{tikzpicture}
    \begin{axis}[
        width=\textwidth,
        height=.25\textheight,
        ybar=2pt,
        enlargelimits=0.15,
        ylabel={\% of total injections},
        xtick=data,
        symbolic x coords={DIMS, DIMS rand, DIMS large, NCLX}, % Group names on the x-axis
        xticklabel style={rotate=45, anchor=north east},
        ymin=0, ymax=100, % Y-axis range from 0 to 100
        axis line style={-}, % Removes the top and right axis lines
        legend style={
            at={(0,-0.45)}, % Position the legend inside the graph
            anchor=north west,
            legend columns=7,
            font=\small, % Adjust legend font size
            draw=none, % No border around the legend
        },
        nodes near coords, % Option to show values near the bars
    ]
    
        \addplot[fill=blue] table[x=Circuit, y=Timing deviation] {\aggregateddata};
        \addplot[fill=red] table[x=Circuit, y=Value failure] {\aggregateddata};
        \addplot[fill=brown] table[x=Circuit, y=Coding failure] {\aggregateddata};
        \addplot[fill=gray] table[x=Circuit, y=Glitch] {\aggregateddata};
        \addplot[fill=purple] table[x=Circuit, y=Deadlock] {\aggregateddata};
        \addplot[fill=green] table[x=Circuit, y=Token count failure] {\aggregateddata};
        \addplot[fill=cyan] table[x=Circuit, y=Nothing] {\aggregateddata};
    
        \legend{Timing deviation, Value failure, Coding failure, Glitch, Deadlock, Token count failure, Nothing}
    
    \end{axis}
\end{tikzpicture}