Jump to content
Software FX Community

dstarkey

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by dstarkey

  1. Hello, Now my map is not coloring my map regions. I have figured out my previous problem but am still only half way there. It seems that my DMA array size needed to be 210 rather than 211. Now I am having a different issue, the same code that I used before to color my map will not work. Each Point property is set to -1, and the only thing that displays is a dark blue dma map of the US. I see that the datasource (DMA object list) is bound properly, because when I step through the code I see NY has a value of 1000, Chicago likewise etc.... However, instead of coloring the map region red (values of 1000) which is my intention, the whole map is colored dark blue. Which I believe is the default. Why would the map behave differently and not color these point attributes??? Is there any way to assign the Point property of the DataItem??? Please help. Here is my code for the entire Method. private void LoadDMAChart() { AssignConditionalAttributes(); //dma_001_--_New_York_NY 1 //dma_002_--_Los_Angeles_CA 1 //dma_003_--_Chicago_IL 100Chart1.AllSeries.Link.Url = "Default.aspx?Region=$DataText"; Map1.MapSource = "C:\\Maps svg\\USA_DMA_v1.svg";DMA[] dmas = new DMA[210]; string text;int pnt;for (int i = 0; i < Map1.VisibleMapRegions.Count; i++) { text = Map1.VisibleMapRegions.DisplayText; pnt = Map1.VisibleMapRegions.Point; //Map1.VisibleMapRegions.Point = i;switch (i) { case 0: case 1:case 2: case 3:dmas = new DMA(text, 1000); break;case 10: case 11:case 12: case 13:dmas = new DMA(text, 100); break;case 30: case 31:case 32: case 33:dmas = new DMA(text, 30);break; default:dmas = new DMA(text, 0);break; } } ListProvider lstProvider = new ListProvider(dmas); Chart1.DataSourceSettings.DataSource = lstProvider; //Chart1.DataSource = lstProvider;int total = 0;for (int i = 0; i < Map1.VisibleMapRegions.Count; i++) { total = ( int)Chart1.Data[0, i];switch (total) { case 0: Map1.VisibleMapRegions.PointAttributes.Color = Color.Orange;break; case 30:Map1.VisibleMapRegions.PointAttributes.Color = Color.Blue; break;case 5: case 100:Map1.VisibleMapRegions.PointAttributes.Color = Color.Violet; break;case 3: case 1000:Map1.VisibleMapRegions.PointAttributes.Color = Color.Red; break;default: Map1.VisibleMapRegions.PointAttributes.Color = Color.White;break; } } } Everything seems to be working except for the coloring. Please help, cannot figure this out especially since it works from the text data source. The only diffirence that I can see is that the text file starts with the first item, whereas the object data source starts at index 0. Below is the first few lines of my text document that works. DMA Count dma_001_--_New_York_NY 1 dma_002_--_Los_Angeles_CA 1 dma_003_--_Chicago_IL 100 dma_004_--_Philadelphia_PA 1 dma_005_--_San_Francisco_CA 1
  2. I have a map of the US DMA areas (Market Areas, ie NY = 001, LA = 002 etc). Now I would like the chart and map to work together to display the data on the Map. I created a very simple Business object (based off of your PassingData example) that I wanted to use for the charts data, and then plot this data on the Map. For example: dma_001_--_New_York_NY 1 dma_002_--_Los_Angeles_CA 10 dma_003_--_Chicago_IL 100This works fine when I retrieve these same values from a Text file in the AppData folder (similar to your WorldPopulation sample). So I know that the map should can display the items. I created a very simple class called DMA, as above the class has two properties Name, and Count to simulate my TextFile. Then I create an array of these DMA items, just like your PassingData sample application. But I get a TargetException Error when I try to assign the Chart1.DataSource property in the same fashion that your PassingData solution employs. Both of these throw the same error. Chart1.DataSourceSettings.DataSource = lstProvider; Chart1.DataSource = lstProvider; Here is your sample code from the PassingData solution using a business object: Chart1.Gallery = Gallery.Bar; /* Chart FX also supports reading data from a Business Object. In this case, we have created a class containing the* data (DMA) and used the ListProvider to populate Chart FX with multiple instances of the class. * Chart FX also supports direct databinding to business object, using the Smart Tag Data Wizard. Please refer to the * .NET documentation to create a business object that can be used as a data source.*/ DMA[] dmas = new DMA[3]; dmas[0] = new DMA("dma_001_--_New_York_NY ", 15);dmas[1] = new DMA("dma_002_--_Los_Angeles_CA ", 0);dmas[2] = new DMA("dma_003_--_Chicago_IL", 20); ListProvider lstProvider = new ListProvider(dmas);Chart1.DataSourceSettings.DataSource = lstProvider; This displays fine as a chart. But when I try to display those items on a map, in this case Chicago Market should have 20 items I get the error. Here is the method that throws this error modeled from the code above that works. Map1.MapSource = "C:\\Maps svg\\USA_DMA_v1.svg"; DMA[] dmas = new DMA[211];string text;for (int i = 0; i < Map1.VisibleMapRegions.Count; i++){ text = Map1.VisibleMapRegions.DisplayText; switch (i){ case 0: case 1: case 2: dmas = new DMA(text, 1000); break;default:dmas = new DMA(text, 0); break;} } ListProvider lstProvider = new ListProvider(dmas); Chart1.DataSourceSettings.DataSource = lstProvider; //Chart1.DataSource = lstProvider; l checked the Name value of the DMA object and it is correct. The code above was written to test plotting out certain regions within the map. In the case ab ove I simply wanted NY, LA, and Chicago's corresponding Total to be at 1000, and every other region to have a data value of 0. What am I missing??? This should be very easy to do but I cannot find out any additional information about: * Chart FX also supports direct databinding to business object, using the Smart Tag Data Wizard. Please refer to the * .NET documentation to create a business object that can be used as a data source.*/ I really need someones help on this. It is GREATLY APPRECIATED. Just to reiterate, I can display the map properly opening the file as a tab delimeted text file. It is when I try to assign the DataSource to a simple Business Object that will not work. What am I missing???? This should be an easy task. Thanks, Don
  3. Hello, We are running our production application on a web farm. Currently we are not using the pss sevice, and instead we are using the local chartfx dll. It is my understanding that the pss service is designed to aid chart/map generation when working on a web farm. Is there a way to set this up on my local box so I can test the functionality? Any way to simulate more than one server? All help is greatly appreciated. We keep getting an intemittent error with our maps where one of the parameters sent from chart fx to system.drawing is invalid. I was hoping that using the pss service would eliminate this error. See below: MESSAGE: Parameter is not valid. SOURCE: System.Drawing TARGETSITE: Void .ctor(Int32, Int32, System.Drawing.Imaging.PixelFormat) STACKTRACE: at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at System.Drawing.Bitmap..ctor(Int32 width, Int32 height) at ChartFX.WebForms.Internal.u.a(Graphics A_0, Int32 A_1, Int32 A_2) at ChartFX.WebForms.Chart.m() at ChartFX.WebForms.Chart.cm() at ChartFX.WebForms.Annotation.AnnotationText.SizeToFit() at ChartFX.WebForms.Annotation.AnnotationText.set_Text(String value) at ChartFX.WebForms.Maps.MapElement.set_DisplayText(String value) Thanks in advance, Don
  4. I am also having an issue with large maps crashing. What is the solution for this problem? Is there a patch that we need to apply? Any help is greatly appreciated. Thank you, Don Sample.zip
  5. Please Help, I have inherited the chart fx project at our company. I have been looking for examples of any kind, I keep hearing reference to a "Chart FX Resource Center" but I am not sure where to find it. If anyone can point me to this resource I would appreciate it. Second question: I have a xml depictation of a United States Map, broken down by States. How do I highlight certain states?? For example, color Indiana blue and Illinois red, based on points that would exist with those state boundaries. What is the API chart fx property that needs to be set, if in fact one exists?? As a final note any tutorials on chart fx would also be greatly appreciated! Thank you, Don
×
×
  • Create New...