Horizontal legend using the javascript api?

1535
2
Jump to solution
11-25-2014 11:01 AM
DavidYarnell
New Contributor III

I'm trying to create a legend that is horizontal using the javascript api. I can't seem to to it with the legenddijit. Has anyone been able to do this?

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

Ran a few quick tests and it looks like you can do this using css. The legend is created using tables and rows so if you set the row to float left you should get a horizontally aligned legend.  Here's the css I added to my test app:

      .esriLegendLayer tr{
        float:left;
      }

And here's a fiddle showing my test app:

Edit fiddle - JSFiddle

View solution in original post

2 Replies
KellyHutchins
Esri Frequent Contributor

Ran a few quick tests and it looks like you can do this using css. The legend is created using tables and rows so if you set the row to float left you should get a horizontally aligned legend.  Here's the css I added to my test app:

      .esriLegendLayer tr{
        float:left;
      }

And here's a fiddle showing my test app:

Edit fiddle - JSFiddle

DavidYarnell
New Contributor III

Thanks Kelly this worked great!!

0 Kudos