Jump to content
Software FX Community

Maps help - unable to format labels and apply conditional attributes


Recommended Posts

I'm creating a new map with a single series (number of students per state).  I can see the data in the data grid.  I'm trying to change the label to display the number of students when hovering over a state.  I also want to change the state color based on the number of students in that state.  I can't seem to make either of these happen.

My aspx page:

<chartfx7:Chart ID="Chart1" runat="server" Height="499px"

RandomData-Points="48" RandomData-Style="Labels" Width="793px" PlotAreaColor="Transparent">


<chartfx7:SeriesAttributes />



<chartfx.webforms.adornments.imageborder assemblyname="ChartFX.WebForms.Adornments"

color="109, 125, 138"></chartfx.webforms.adornments.imageborder>


<DataGrid Visible="True" />

<LegendBox Visible="False">



<chartfxmaps:Map ID="Map1" runat="server" ChartId="Chart1">


My aspx.cs page:

DataTable myDataTable = DB_state.SelectTable();


new FieldMap("short_desc", FieldUsage.Label));Chart1.DataSourceSettings.Fields.Add(new FieldMap("nbr_stds", FieldUsage.Value));


Chart1.AllSeries.PointLabels.Visible = true;Chart1.AllSeries.PointLabels.Format = "%v";


//Create conditional attributesConditionalAttributes cond1 = new ConditionalAttributes();cond1.Color = Color.Red;

cond1.Condition.To = 500;


ConditionalAttributes cond2 = new ConditionalAttributes();cond2.Color = Color.Yellow;

cond2.Condition.From = 500;

cond2.Condition.To = 2000;


ConditionalAttributes cond3 = new ConditionalAttributes();cond3.Color = Color.Green;

cond3.Condition.From = 2000;



Map1.MapSource =


Chart1.DataSource = myDataTable;

Link to comment
Share on other sites

The code looks ok. The problem may be with the data. The labels in your data need to match the label keys in the map. In this particular map the labels must be the state abbreviations (e.g. NY, FL, GA, etc.).

Please Export this chart to a binary file (Export method) and attach it to your posting. If the map contains data that is private, you can send it as a private message to me.

An alternative to this is to produce a sample program, with dummy data, that reproduces the problem.

Link to comment
Share on other sites

I can see that I have some value for Puerto Rico and the Virgin Islands (to name a few).  I guess those are messing with the map.  ???  I guess there isn't a US territories map???

 Noticing that, I trimmed the data down to a few states (not a great example since I need all the states) to see if I could get the label and conditional attributes to work.  They still don't.  Do you have to have a value for every state?  Do you have to have 50 values (no more, no less)???

 sample data


CA    3934

TX    2758

FL    2428

NY    2152

GA    2028

PA    2018

WA    1538

OK    1201

IL    1115

MO    1111

MI    1093

MD    1028

Link to comment
Share on other sites

The problem is your data labels have a bunch of white spaces at the end. You need to trim those labels before feeding them to the chart.

Your data does not have top contain all regions (states) and it may contain regions that don't exist in the map. Both situations are perfectly fine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...