-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pie chart legend placement is at bottom left. #443
Comments
@richardbarad I already posted about it in Slack, but just copying what I wrote for here!
We can try to apply the same thing to the pie chart legend as well! |
@kaylakremer. Thanks! Just to confirm, we would use a Max width for both pie charts and badges? How does MapBuilder know which widgets to apply a max-width to? Is this something we would specify in the configuration file. Richard |
@richardbarad Yes, that would be the idea to set |
Hey @richardbarad! After researching this some more, I think it may be possible to center position the legend if we use Vega Charts version 5.0 or higher. I found this in the Vega docs. Scroll down to Legend Layout Properties >= 5.0 I also found it addressed here in Vega's Github Issues As their example shows with
It seems like we're currently using Vega 3.0.7. I'm not sure if upgrading to the latest version of Vega would break anything. I'll keep looking for other solutions in the meantime if you don't think upgrading the Vega version is a good idea. |
@kaylakremer. Thank you for researching this! Do you know if upgrading to the latest version of VEGA would be an update that just needs to made in MapBuilder or would it also require changes to the API. I know our CMS Widgets which are also saved in the API are using version 3.x. Also, did applying the Richard |
@richardbarad I don't know the answer to your first question. I'll have to ask @SwampGuzzler about it! Or perhaps @csphang can answer this too?
|
@kaylakremer. Thanks! Let me know what @SwampGuzzler says about the first question. Is updating the VEGA version of the MapBuilder easy enough to test? If not, could you try this widget and see how it behaves: Richard |
@richardbarad I tried out your new widget ID and I think we're close (see screenshot). The legend is now centered, even when I resize the window, but the pie chart is now off. With the widget ID I was using before, Do you mind creating a new widget ID to test this out? |
At @kaylakremer. Please try this on: I am not sure why the one above |
I modified the widget configuration a bit, and it seems like that on initial load the pie chart loads correctly, but once you start to resize the pie chart it is no longer centered. In the widget, the |
@richardbarad Putting the build here that I slacked you: http://alpha.blueraster.io/gfw-mapbuilder/452-update-resources-to-distinguish-chart-types/ It looks like setting the As I mentioned, if you need to make any further adjustments to the pie chart's |
I just updated the widget pie chart to have a |
@richardbarad Great, I'll update it now! And good catch on the fires badge. I'll update that to be a |
Verified as fixed on consolidated builds and country builds. for example, |
Pie chart legend text is appearing off center in report in: http://alpha.blueraster.io/gfw-mapbuilder/396-resizing-widgets/. The legend placement is currently set to
bottom
which seems to place it at the bottom left. Based on VEGA documentation, there does not seem to be an option to have the legend placement set to bottom-center.Possible solutions:
There is an option in VEGA to specify x and y settings for the legend. I tried to make these proportional so that the to the height and width so that the legend would be centered and posted a new widget LCC widget:
cdc27c28-2ca4-4027-9593-634a362f38db
.Other option could be to place a
max-width
on the MapBuilder side so that the container size is always square.Open to other ideas as well!
Note:: We have custom country analysis which use pie charts as well so we will need to make sure the solution is deployed in a way such that it can be applied to other analysis. For example, hazard analysis here: https://atlas.mepa.gov.ge/maps/map?l=en
The text was updated successfully, but these errors were encountered: