SeedRandom[1]

    xy = RandomSample[Tuples[Range[0, 10], 2], 10];

    z = RandomReal[1, 10];

    xyz = Join[xy, List /@ z, 2]
>     {{9, 5, 0.941699}, {7, 3, 0.294264}, {1, 3, 0.188274}, {0, 0, 0.761529},
>      {6, 1, 0.169824}, {0, 3, 0.455359}, {5, 10, 0.75425}, {9, 1, 0.268291},
>      {2, 1, 0.147377}, {8, 9, 0.480659}}

### Graphics

    graphics = Graphics[{EdgeForm[Gray], Hue @ #3, Rectangle[{#, #2}]} & @@@ xyz, 
     Frame -> True];

    legend = SwatchLegend[Hue /@ xyz[[All, -1]], Defer /@ xyz];

    Legended[graphics, legend]

[![enter image description here][1]][1]

### BubbleChart

    BubbleChart[xyz, ChartStyle -> (Hue /@ xyz[[All, -1]]), 
     ChartElementFunction -> (Rectangle[Mean /@ #] &), 
     PlotRange -> {{0, 11}, {0, 11}}, 
     ChartLegends -> {Defer /@ xyz}]

[![enter image description here][2]][2]


  [1]: https://i.sstatic.net/8Llz9.png
  [2]: https://i.sstatic.net/HAsom.png