slight modification of getLegendGraphic api