LSUgirl Posted July 24, 2007 Report Share Posted July 24, 2007 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"> <Series> <chartfx7:SeriesAttributes /> </Series> <SpecialObjects> <chartfx.webforms.adornments.imageborder assemblyname="ChartFX.WebForms.Adornments" color="109, 125, 138"></chartfx.webforms.adornments.imageborder> </SpecialObjects> <DataGrid Visible="True" /> <LegendBox Visible="False"> </LegendBox> </chartfx7:Chart> <chartfxmaps:Map ID="Map1" runat="server" ChartId="Chart1"> </chartfxmaps:Map>My aspx.cs page: DataTable myDataTable = DB_state.SelectTable(); Chart1.DataSourceSettings.Fields.Add( 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; Chart1.ConditionalAttributes.Add(cond1); ConditionalAttributes cond2 = new ConditionalAttributes();cond2.Color = Color.Yellow; cond2.Condition.From = 500; cond2.Condition.To = 2000; Chart1.ConditionalAttributes.Add(cond2); ConditionalAttributes cond3 = new ConditionalAttributes();cond3.Color = Color.Green; cond3.Condition.From = 2000; Chart1.ConditionalAttributes.Add(cond3); Map1.MapSource = "US\\USA-StatesAbrev.svg";Chart1.DataSource = myDataTable; Link to comment Share on other sites More sharing options...
Frank Posted July 27, 2007 Report Share Posted July 27, 2007 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 More sharing options...
LSUgirl Posted July 27, 2007 Author Report Share Posted July 27, 2007 Here is the binary export. I used the extension of ".txt" so you will probably have to rename it. Jessica Link to comment Share on other sites More sharing options...
LSUgirl Posted July 27, 2007 Author Report Share Posted July 27, 2007 this is a text file if I "copy" the data out of the map once it is rendered. Jessica Link to comment Share on other sites More sharing options...
LSUgirl Posted July 27, 2007 Author Report Share Posted July 27, 2007 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 nbr_stds 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 More sharing options...
Frank Posted July 27, 2007 Report Share Posted July 27, 2007 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 More sharing options...
LSUgirl Posted July 30, 2007 Author Report Share Posted July 30, 2007 O my God!!! The white spaces were the issue. I've been going crazy for more than a week over that one. Thanks so much. My week is going to be good. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.