Select to view content in your preferred language

Help: Drawing bar or pie charts on the map from feature layer!

4111
10
Jump to solution
02-09-2012 04:29 AM
HannesRömer
Occasional Contributor
Hallo,

I am very new to the ArcGIS API for Flex. I am working with FlashBuilder to develop my web-map application. I try to draw pie charts or bar charts from two attribute fields in my feature layer, to illustrate parking occupancy. In the code gallery, I found the example from EEA, so it should be possible.

http://www.eea.europa.eu/themes/water/interactive/soe-rl

However, till now, i didn't find a way how to do this. In the references i only find a way to draw chars in a popup.

(I already had the problem with the conversion of my msx to a msd. Here the applied chart symbology for the shape file involved was not supported for this conversion process. Thus, I thought there is a way to re-edit the feature layers within the Flex API.)


Thank you for your help!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
HannesRömer
Occasional Contributor
Thank you very much, for you great support. Unfortunately I didn't manage to open this mxml so far , I got the message:

file not found: "path\StackedBarSymbol.html" In the table below I see: error: Unknown Flex SDK: "Flex 4.5.1"

I simply imported the fxp file in flash builder and created a project called StackedBarSymbol_1.



What went wrong?

View solution in original post

0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus
Hannes,

   Sure you can all you need to do is extend the APIs Symbol for this purpose.

Here is a FXP that you can import into Flash Builder (once you unzip it) and it contains a project that shows exactly what you are attempting to do by extending symbol.

Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:
0 Kudos
HannesRömer
Occasional Contributor
Thank you very much, for you great support. Unfortunately I didn't manage to open this mxml so far , I got the message:

file not found: "path\StackedBarSymbol.html" In the table below I see: error: Unknown Flex SDK: "Flex 4.5.1"

I simply imported the fxp file in flash builder and created a project called StackedBarSymbol_1.



What went wrong?
0 Kudos
HannesRömer
Occasional Contributor
Hello again,


I fixed the problem, I changed the compiler settings in the project and it works. The project looks nice, the next objective is to find a way to normalize the total length of each bar with an attribute field in the feature layer....


Thanks so far.

Hannes
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Hannes,

Glad you got it working. But yo missed the most important part of the instructions below ( the very first step in the image):

Don't forget to click the Mark as answer check as shown below:
0 Kudos
HannesRömer
Occasional Contributor
Robert,

I guess you mean the evaluation issue. I hope this works now...I would give you the best mark 🙂

First, the example you gave me works excellent, but I do have a problem, when I want to apply this example to my own feature layer. Here I am using two columns in floating format ("area" and "area_usage") in my feature layer. This feature layer is a polygon file and when I compile it ("test.mxml"), I don't see the feature layer in the browser. Maybe I have to make some changes to the *as file "StackedBarSymbol"?

So I attched the 31012012.fxp with the "test.mxml" which is of my interest, maybe you can see the problem.
I also attached the metadata of my featurelayer (*xml), copied from the rest link - maybe he problem is here.


Thank you!

Hannes


Or
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Hannes,

   Yes the custom symbol I built is expecting a Point feature not a polygon. Do you think you can handle that?
0 Kudos
HannesRömer
Occasional Contributor
Robert,

mmh, I see.  Unfortunately my background in programming is very low and I think I would need several days too weeks to handle this issue.

First I tried to replace "mappoint" with "polygon" to get the right geometry. But this would be too simple as there is a need to adjust outline color and background color of the polygon. And I would need a way to define size of the stacked bar using a normalization field from the feature layer....

However, you decide which capacities you have for this issue or whether you think my concern is too much for a simple support question...

Thanks! Hannes
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Hannes,

   What exactly do you mean by this
And I would need a way to define size of the stacked bar using a normalization field from the feature layer....
Currently you are allowed to define the height and width of the symbol. Changin the MapPoint to a Polgon is that what you want to do, you need to get a MapPoint from the Polygon as all you need is a XY of where to draw the stacked symbol. This symbol is for drawing the stacked bar if you want the polygon to be drawn as well then you have to add the layer agin using a standard SimpleFillSymbol as the renderer.
0 Kudos
HannesRömer
Occasional Contributor
Hello again,

sorry for my english. I like to draw a stacked bar chart, where the height or size of the bar is not a fixed value, but is defined by a normalization field. For example, I like to draw the parking occupancy as a stacked bar chart. I use the field "occupied" and "free" as percentage values to create the stacked bar chart. The total area (in ha) of the parking space is used to define the total length of the respective bar.

I hope this is more clear now.
Regards,

Hannes
0 Kudos