legend and popup work